OSX-Terminal.app + vim + solarized colorscheme

17,092

Solution 1

If you're trying to use VIM on the console, try changing the Terminal theme to Solarized.

You can follow this blog post on Solarized theme for OSX:

In the Terminal.app you have a few options of color schemes that you can choose from. We are going to install the Solarized Dark and Solarized Light themes for some human eye friendly color combinations

  1. Go to http://ethanschoonover.com/solarized in your browser
  2. Download the the latest version http://ethanschoonover.com/solarized/files/solarized.zip.
  3. Unzip the package and locate the osx-terminal.app-colors-solarized folder within the extracted folder.
  4. Double click on Solarized Dark ansi.terminal and Solarized Light ansi.terminal.

If your system then complains that it is from an unidentified developer, you have to temporarily allow applications from anywhere. To do this go to: System Preferences > Security & Privacy > General > Allow applications downloaded from and select “Anywhere”. Don’t forget to change this back!

  1. Select the theme in the Terminal.app preferences under Settings > Profiles. You can press default to have it default selected.

Solution 2

https://vi.stackexchange.com/a/3707/1145

http://ethanschoonover.com/solarized/vim-colors-solarized

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 use 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.

Share:
17,092

Related videos on Youtube

hoa
Author by

hoa

Updated on September 15, 2022

Comments

  • hoa
    hoa over 1 year

    I know this topic is widely spread over the internet, but I have spent the whole morning searching a solution and nothing helps.

    I want to use vim in the osx-terminal with the solarized colorscheme.

    So i downloaded the solarized.vim file an copied it into /usr/share/vim/colors and wrote

       let g:solarized_termcolors=256
       set background=dark
       colorscheme solarized 
    

    in the .vimrc.

    In the preferences, the terminal is set to xterm-256color, but the color is still messed up.

    What i did, is exactly what you can find here.

    So, what am i doing wrong?

  • hoa
    hoa over 8 years
    thx, but i've tried to avoid this, because i want to have VIM with the solarized colorscheme and the additional terminal/console-windows in an other. Therefore i followed the explantation on the readme: "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"
  • Johannes Filter
    Johannes Filter about 7 years
    If you have the problem about the "unidentified developer", just use a context click (right click) on the item and choose "open" and say "yes".
  • Elan
    Elan over 6 years
    Can I delete all the downloaded files after I've done this?