Ubuntu, vim, and the solarized color palette

前端 未结 8 1864
别跟我提以往
别跟我提以往 2020-12-07 07:54

I\'d really like to get in on all the colorful goodness of the solarized colorscheme, but I can\'t seem to get it configured just right.
I have the main solarized file i

相关标签:
8条回答
  • 2020-12-07 08:34

    set t_Co=16 and let g:solarized_termcolors=16 did not work for me. This is what worked:

    syntax on
    let g:solarized_termcolors=256
    set t_Co=256 
    set background=dark
    colorscheme solarized
    

    I hope this helps someone.

    0 讨论(0)
  • 2020-12-07 08:34

    From the README (emphasis mine) :

    IMPORTANT NOTE FOR TERMINAL USERS:

    If you are going to use Solarized in Terminal mode (i.e. not in a GUI version like gvim or macvim), please please please consider setting your terminal emulator's colorscheme to used the Solarized palette. I've included palettes for some popular terminal emulator as well as Xdefaults in the official Solarized download available from [Solarized homepage]. If you use Solarized without these colors, Solarized will need to be told to degrade its colorscheme to a set compatible with the limited 256 terminal palette (whereas by using the terminal's 16 ansi color values, you can set the correct, specific values for the Solarized palette).

    If you do use the custom terminal colors, solarized.vim should work out of the box for you. If you are using a terminal emulator that supports 256 colors and don't want to use the custom Solarized terminal colors, you will need to use the degraded 256 colorscheme. To do so, simply add the following line before the colorschem solarized line:

    let g:solarized_termcolors=256
    

    Again, I recommend just changing your terminal colors to Solarized values either manually or via one of the many terminal schemes available for import.

    What worked for me on Ubuntu 16.04 with the included Terminal application was to simply select Solarized for both "Text and Background Color" (choose light or dark) and "Palette" in Terminal > Preferences > Profiles > (select yours) > Edit > Colors

    Some other answers recommend choosing a 256 color palette but, as mentioned in the documentation, this gives you a degraded (and visibly worse in my opinion) colorscheme.

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