Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim on Ubuntu: Text rendering bug, repeating and disappearing weirdly

Tags:

text

vim

ubuntu

I had vim installed on ubuntu 12.04 not long ago. Sometimes when I run my cursor (using keyboard, not mouse) over code, text disappears, as though there is a problem rendering the character. When I run the cursor back again, it usually reappears.

This seems to happen quite randomly but is often enough to make it irritating.

To make it clearer, here's an example:

1.Original text:

Hi! How are you today.

2.Text after cursor runs over it

H ! How re yo today.

3.After running the cursor over the sentence again

i! How ar you tod y.

  1. Finally, after running the cursor over the sentence a few times, it is back to normal

.vimrc file:

set nocompatible               " be iMproved
 syntax on        "Syntax highlighting
 filetype off 
 set rtp+=~/.vim/bundle/vundle/
 call vundle#rc()

 colorscheme evening 
  
 "font
 set nu
 set guifont=Monospace\ 12
 set foldmethod=indent
 set foldlevel=99
 set lines=50 columns=80
 set ignorecase "searching is not case sensitive 
 set smartcase "if a pattern contains uppercase, searching IS case sensitive 
 set autoindent
 set tabstop=4
 
 winpos 1068 24
 " Type 'za' to open and close a fold
 " let Vundle manage Vundle
 
 Bundle 'gmarik/vundle'

 " original repos on github
 Bundle 'tpope/vim-fugitive'
 " vim-scripts repos
 Bundle 'L9'
 Bundle 'FuzzyFinder'
 " git repos on your local machine (ie. when working on your own plugin)
 
 "Bundles I install
 Bundle 'https://github.com/scrooloose/nerdtree.git' 
 Bundle 'scrooloose/syntastic'
 Bundle 'dbakker/vim-lint'
 Bundle 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim/'} 

 "snipmate
 Bundle "MarcWeber/vim-addon-mw-utils"
 Bundle "tomtom/tlib_vim"
 Bundle "snipmate-snippets"

"Install snipmate:
 Bundle "garbas/vim-snipmate"

 Bundle "sudar/vim-arduino-snippets"

 "PYTHON
 filetype plugin indent on
 Bundle 'klen/python-mode'
 autocmd BufRead *.py nmap <F5> :!python %<CR>
 set laststatus=2
 " :BundleList          - list configured bundles
 " :BundleInstall(!)    - install(update) bundles
 " :BundleSearch(!) foo - search(or refresh cache first) for foo
 " :BundleClean(!)      - confirm(or auto-approve) removal of unused bundles
 " see :h vundle for more details or wiki for FAQ
 " NOTE: comments after Bundle command are not allowed..
 " ARDUINO
 autocmd! BufNewFile,BufRead *.pde,*.ino  setlocal ft=arduino

Edit:

I tried to take a screenshot of the problem, but realized that after taking a screenshot, gvim would sort of "refresh", and missing fonts appear again. Alt-Tabbing helps too. But I have not found a permanent solution to this problem.

Also, moving my cursor over the line of text with characters missing would sometimes cause other characters to go missing while old characters appear. Sometimes the cursor would also leave behind static images of other cursors.

I've also got vim installed on windows, shall try it there to see if the same problem appears.

Screenshot, notice the empty rectangle in the bottom left:

Disappearing text on screen with GVim on Ubuntu

Update: So I've reinstalled ubuntu (this time to 14.04), gvim and vim. There are still some annoying rendering issues, although it manifests differently (see screenshot 2). Line numbers and percentages go haywire and scroll along with the page when I scroll down using "j". Only happens for vim so far. Gvim is working okay. enter image description here

like image 669
Yan Yi Avatar asked Dec 15 '13 09:12

Yan Yi


2 Answers

So I found out whats the problem. Turns out after I removed one line from my .vimrc, the weird visual rendering bugs are gone.

Did not expect this innocuous looking line to be the cause:

set lines=50 columns=100

Not sure why this is the case though.

like image 101
Yan Yi Avatar answered Sep 28 '22 08:09

Yan Yi


Maybe a late reply. I'm running ubuntu 16.04 on a virtualbox machine, and had the same issue with the default VI. Fixed by just installing VIM on top:

sudo apt-get install vim

like image 29
Hugo Pinto Avatar answered Sep 28 '22 07:09

Hugo Pinto