Syntax highlighting in vim

一笑奈何 提交于 2020-06-24 22:26:28

问题


I'm having trouble reading dark blue on black when I turn on syntax colours in vim.

How do I change some of the default colours or the colours of schemas like:

http://www.vim.org/scripts/script.php?script_id=1571


回答1:


First, try :set background=dark, which will cause vim to change to a color scheme that works better for reading on a black background.

If that doesn't work well enough, you can create your own color scheme by following these directions: http://vim.wikia.com/wiki/Create_a_color_scheme_based_on_another




回答2:


You can switch the colorscheme with:

:colo <colorscheme-name>

Tab circles over all available colorschemes:

:colo <Tab>

If you need more schemes get some from http://vimcolorschemetest.googlecode.com/svn/html/index-c.html




回答3:


As stefanB says, you can change colorschemes with the :colo[rscheme] command. There are a dozen or so built in schemes, and you can download thousands more from the Vim website.

I recommend installing the Color Sampler Pack - this is a selection of the 100 most popular colorschemes, and in Gvim it adds a menu that will let you switch between them easily.




回答4:


Favorite colorschemes (set with :colo[rscheme] as mentioned a few times)

" Dark Background
"colo desert256
"colo xoria256 "colo vylight
"colo slate

" Light Background
"colo summerfruit256
"colo beauty256 "colo phpx
"colo morning

The *256 ones work well when working through putty.

My understanding of the background settings is that it tweaks the colors of your colorscheme so they are more visible on a dark or light background. Although the schemes i use seem to handle this themselves well. See:

:h 'background'



回答5:


That dark blue color is hard to see for sure. I don't know what environment you're working in, but I normally tweak the color settings in my console or putty so that it shows up better. This will protect you from other programs that want to use that color too.




回答6:


I'm not sure if this answers your question, but there are several ways to get different color schemes. My favorite (and the only one I'm really familiar with) is

:set bg=dark

This makes most code easier to read.



来源:https://stackoverflow.com/questions/2421022/syntax-highlighting-in-vim

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!