Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm using vi on linux - vi --version gives: VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Apr 16 2010 12:47:47)

A few weeks ago, for no apparent reason, every time I use vi the entire text is flashing, is highlighted in green and yellow seemingly at random, and each line ends with a visible $ sign. Although the editing keystrokes work it's totally unusable because the text is blinking the whole time!

At the bottom of the screen is the following:

N ? crontab.2siKb4/crontab ? ? unix ? latin1 ? crontab ? 2% ? a 1:1

This leads me to suspect it may be some kind of character encoding issue, but I'm not sure what could have caused that, or how to correct it. Searching the web didn't really seem to come up with much.

If anyone could help me to get vi back to normal please I'd be very grateful.

Thanks in advance, Ian.

share|improve this question

migrated from stackoverflow.com Jul 16 '12 at 2:41

This question came from our site for professional and enthusiast programmers.

6  
Try starting the editor with no config file: vim -u NONE. Are the effects still there? –  Thor Jul 15 '12 at 21:48
    
What do you get if you write echo $LANG - $TERM in your shell? –  Matteo Italia Jul 15 '12 at 21:51
    
Hello, Thanks for your help. If I run: echo $LANG - $TERM I get: - xterm-color If I start vi with the command: vim -u NONE filename.txt then the effects are not still there and vi performs as normal. So we're getting somewhere! Do you know how I can set vi back into this normal state now, so that when I run crontab -e (so I'm not starting vi from the command line directly) it works properly? Many thanks, Ian –  Ian Howlett Jul 16 '12 at 6:08
2  
With -u NONE you tell vim to use no configuration file. If it works that way, it means the culprit is in your configuration. Reame your .vimrc (into .vimrc.flashing for instance) and create a new .vimrc readding lines from .vimrc.flashing, one by one. When it start flashing again, you found the culprit. –  Dakatine Jul 17 '12 at 7:34

3 Answers 3

The offending lines making vim flash were these:

"tell the term has 256 colors
set t_Co=256

" Color scheme
let g:Powerline_symbols = 'fancy'
colors jellybeans_black

I took them out and everything worked fine again. Thanks a lot for your help, everyone, much appreciated.

share|improve this answer

This is often caused by setting colors that the $TERM cannot use. Try using export TERM=xterm-256color before opening vim and see if that helps.

share|improve this answer

Instead of setting TERM to xterm, sit to linux: export TERM=linux

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.