Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Text in Gvim disappearing

Tags:

vim

ubuntu

I have been having a font rendering problem with GVim on Ubuntu for quite a while. I frequently notice the problem when switching between tabs. After I switch between tabs, sometimes lines will not be rendered. If I hit ctrl+l, the content in the tab will be redrawn and the missing lines are rendered correctly. I guess I could write a function in my .vimrc to automatically run ctrl+l after I switch tabs, but I feel that I would only be avoiding a problem rather than fixing the underlying issue.

  • Ubuntu 11.10
  • GVim 7.3
  • .vimrc: set guifont=Inconsolata\ 12

I have been having the problem for a long time with different versions of Ubuntu and different gui fonts set. I'd love to hear any ideas anyone has that might help me fix this problem.

These are the functions I use for switching tabs:

function TabLeft()
   let tab_number = tabpagenr() - 1
   if tab_number == 0
      execute "tabm" tabpagenr('$') - 1
   else
      execute "tabm" tab_number - 1
   endif
endfunction

function TabRight()
   let tab_number = tabpagenr() - 1
   let last_tab_number = tabpagenr('$') - 1
   if tab_number == last_tab_number
      execute "tabm" 0
   else
      execute "tabm" tab_number + 1
   endif
endfunction

map <silent><C-S-PageUp> :execute TabRight()<CR>
map <silent><C-S-PageDown> :execute TabLeft()<CR>
like image 450
Sean McCleary Avatar asked Dec 21 '11 22:12

Sean McCleary


1 Answers

I have seen font rendering glitches on Ubuntu. My workaround has been to use 'textmode' style tabheadings, see guioptions.

Here is my preferred setting:

:se guioptions=agim

Note that

  • I may be imagining things, but is seems snappier too
  • It results in more screen real estate for editing
  • The above settings also remove all scrollbars (who needs scrollbars?)

To just change the tab heading style, try, e.g.

:se guioptions-=e
like image 160
sehe Avatar answered Oct 18 '22 07:10

sehe