Syntax highlighting in vim

前端 未结 6 1188
面向向阳花
面向向阳花 2021-02-20 15:12

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:

相关标签:
6条回答
  • 2021-02-20 15:43

    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

    0 讨论(0)
  • 2021-02-20 15:49

    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'
    
    0 讨论(0)
  • 2021-02-20 16:03

    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

    0 讨论(0)
  • 2021-02-20 16:05

    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.

    0 讨论(0)
  • 2021-02-20 16:05

    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.

    0 讨论(0)
  • 2021-02-20 16:08

    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.

    0 讨论(0)
提交回复
热议问题