开发者

Custom colorscheme not working on VIM

开发者 https://www.devze.com 2023-02-04 08:26 出处:网络
Here\'s what I did: cp ~/.vim/colors/ir_black.vim /usr/share/vim/vim72/colors/ Then tried to open some code and :colorscheme ir_black

Here's what I did:

cp ~/.vim/colors/ir_black.vim /usr/share/vim/vim72/colors/

Then tried to open some code and :colorscheme ir_black

It changes a few colors but makes most of the text start to blink wi开发者_高级运维th the cursor. It happens with almost all the other custom colorschemes as well. Does anyone have any ideas of what might be wrong?

I added t_Co=256 to my .vimrc file and it didn't seem to help.

PS: I'm on a Mac OS X.


Set your TERM to xterm-256color. Follow up on the iterm2 mailing list if that still doesn't work.


Edit : I found an exact duplicate of your question :here. It seems to be an issue with iTerm not supporting 256 colors by default.

The usual problem with color scheme and terminal is that terminal are often limited to 256 colors, and GUI color scheme are using 2^32 colors. So some of them are not correctly rendered in terminal.

There is a simple test to check: if you are lauching the GUI version is the color scheme rendered correctly ?

The possible solution are :
1. Convert your color scheme to 256 colors using the following plugin : CSApprox.vim
2. Choose a different color scheme. (Often on Vim.org color schemes compatible with Terminal have "256" in their name, like "wombat256" for example)
3. Use a GUI version like MacVim or GVim

If I remember correctly, the color sheme Zenburn is working nicely with both GUI and terminal version. It is rather dark with pastel colors.

Personal story : after spending ages to fiddle with color scheme to get something right for terminal, I switched to the GUI version. The GUI version with the icon bar hidden is not really different to terminal version anyway, as long as you are working locally


the default vim binary in /usr/bin/ will not work with any terminal. you need to have a version that supports gui - type "echo has('gui')" in vim command mode to check.

so your only option is to use a gui one (macvim etc.), or compile it with athena, gtk or x11 with macports, but i would advise against the latter, because it pulls down a shitload of dependencies.

i think it's better to use macvim for serious development that needs syntax highlighting, and use the 16 colour version in the terminal for quick edits.

0

精彩评论

暂无评论...
验证码 换一张
取 消