Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fail to install vim solarized

Tags:

vim

ubuntu

I am struggling on the installation of solarized plugin on vim, the following are the steps I followed

  1. Use gmarik/Vundle.vim to install the solarized plugin (with the below .vimrc script)
  2. Run vim +PluginInstall +qall to install the plugin
  3. Put the following lines in the .vimrc:

syntax enable
set background=dark
colorscheme solarized

.vimrc script used
vimrc script

But outcome the solarized plugin comes with following results which look and feel are not as expected
bad look and feel

Expecting look
enter image description here
Is there anything I have done wrong? Please advice. Thanks and appreciate everyone for the kind help

Try to add

set t_Co=256 let g:solarized_termcolors=256

Looks better, but still different from the capture shown by the author
enter image description here

like image 237
user2361494 Avatar asked May 25 '14 07:05

user2361494


3 Answers

I had the same problem once. I guess the easiest way to do this is using pathogen. To install pathogen, from console:

    mkdir -p ~/.vim/autoload ~/.vim/bundle; \
curl -LSso ~/.vim/autoload/pathogen.vim \
    https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vim

Then add this to your .vimrc:

execute pathogen#infect()

Now you can install plugins into ~/.vim/bundle which will be automatically loaded to vim. To install solarized theme, simply add vim-colors-solarized plugin:

cd ~/.vim/bundle
git clone git://github.com/altercation/vim-colors-solarized.git

The rest you have, which is setting t_Co to 256 and setting colorscheme to solarized. You may also try:

set t_Co = 256

Finally changing terminal emulator's color scheme to solarized might help. Or if you don't want to do this, add this line in .vimrc before setting your colorscheme to solarized:

let g:solarized_termcolors=256 

I hope it helps :)

like image 70
qiubix Avatar answered Nov 15 '22 00:11

qiubix


I used vim-plug to add solarize. In .vimrc I added...

if empty(glob('~/.vim/autoload/plug.vim'))   silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
        \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim   autocmd VimEnter * PlugInstall --sync | source $MYVIMRC endif call 
plug#begin('~/.vim/plugged')

Plug 'altercation/vim-colors-solarized'

call plug#end()

set background=dark

colorscheme solarized

Then after saving and closing, I run this to install

vim +'PlugInstall --sync' +qa
like image 20
Dmitry Avatar answered Nov 14 '22 22:11

Dmitry


I had the same problem. I never managed to get vim-colors-solarized working but instead the solarized8 plugin worked perfectly for me. I guess the question is no longer relevant after 6 years, but here's my solarized setup.

I have iTerm2 with its solarized dark color theme. My term is set to xterm-256color, I have vim-plug on top of neovim, my init.vim plugin for solarized8 looks like: Plug 'lifepillar/vim-solarized8'

Then I have these lines that set up proper colors:

set termguicolors
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"

set background=dark
colorscheme solarized8
syntax enable

I also have the vim-sensible plugin but I'm not entirely sure if that has any effect for this.

Good luck to anyone who's also trying to get solarized dark working in vim.

like image 34
Mehmet Efe Akça Avatar answered Nov 14 '22 22:11

Mehmet Efe Akça