I was modifying an email template and I noticed that when moving the cursor over a piece of code it changed.

Here is a screenshot from before:

enter image description here

and after:

enter image description here

Vim version is 7.4 on Ubuntu 16.04. Any idea what would make something like this happen?

  • This looks like a problem in your terminal emulator. Which terminal are you using? What's the TERM environment variable set to? You can also try following these steps, to make sure it's not a plugin or something in your vimrc. – Martin Tournoij May 19 '17 at 15:01

Your terminal window isn't configured to display colors properly.

You can test whether this is the case by disabling color in vim and see if the problem goes away.

Disables color features in vim:

:syntax off
:set nohlsearch
:set t_Co=0

If this fixes it but you want color support, the next step I suggest is to check your terminal emulator and shell configuration for ANSI support.

  • it displays the colors properly, the photos are from when trying to replicate the behavior and ubuntu probably didn't recognized the code because i named the file test instead of test.php – Mitocariu Emilian May 19 '17 at 14:56
  • but if i disable color features like you said it seems to work properly – Mitocariu Emilian May 19 '17 at 15:02
  • try this before starting vim: export TERM=xterm – Jim U May 19 '17 at 15:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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