3

I just installed Linux Mint 18.3 and to my surprise colors in vim changed!

comparison screenshot

Vim in the terminal on the left has the color scheme I've always seen and got used to. Vim in the terminal on the right has the new colors. On the left, I'm ssh'ed into a different machine. On the right is my new Mint.

Both windows are of the same terminal emulator, with the same profile settings, so the issue is not with my color scheme.

How can I get the normal colors back?

Update: It looks like the old colors flash for a tenth of a second when I open a file, but then the colors are reverted to new. As I wrote in the comments, in both cases, :colorscheme returns default.

  • 2
    What does :colorscheme schow? – Martin Tournoij Dec 18 '17 at 8:09
  • Use :verbose highlight normal to find the script that last set the "normal" highlight group. Run echo synIDattr(synID(line("."),col("."),1),"name") to find a highlight group in effect at the cursor position. Combining them you can find out which script set the colors at the cursor position: exe "verb hi " . synIDattr(synID(line("."),col("."),1),"name"). – jjaderberg Dec 18 '17 at 10:42
  • @Carpetsmoker :colorscheme says default for both. – SU3 Dec 19 '17 at 6:02
  • @jjaderberg In both cases, :verbose highlight normal says E411: highlight group not found: normal, :echo synIDattr(synID(line("."),col("."),1),"name") doesn't print anything. – SU3 Dec 19 '17 at 6:05
4

I'm not sure what you mean by "profile settings", but I'm assuming you mean terminal profiles, which don't affect vim (much).

Try opening your .vimrc. It should be in your home directory, named that. Inside the .vimrc, you can set different settings to load every time you open vim, such as colorschemes. If you want to always use the default one, just add colorscheme default into the file.

However, neither of the images you have look like the default scheme to me. Your best bet is to check the colorscheme of the terminal you like with :colorscheme (with vim open, of course) and add that to your newer terminal's vimrc. You may also need to copy the colorscheme file from /usr/share/vim/colors/, into the new terminal. You may need to poke around a bit in /usr/share/vim first, it's been a while since I've installed Mint. After the scheme is copied over, set the scheme you want with colorscheme name_of_scheme_you_desire in your vimrc, and that's it.

  • Yes, I meant terminal profiles. – SU3 Dec 19 '17 at 6:38
  • Explicitly stating :colorscheme default appears to fix the issue. – SU3 Dec 19 '17 at 6:43
  • @SU3 that indeed fixes the issue, but only for the current instance of vim. If you relaunch vim, it will go back to the setting in the vimrc, which may not be default. I'm glad you figured it out! – Riker Dec 19 '17 at 17:00

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.