Reputation: 161
I am struggling on the installation of solarized plugin on vim, the following are the steps I followed
syntax enable
set background=dark
colorscheme solarized
.vimrc script used
But outcome the solarized plugin comes with following results which look and feel are not as expected
Expecting look
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
Upvotes: 6
Views: 4192
Reputation: 1432
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.
Upvotes: 1
Reputation: 4373
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
Upvotes: 1
Reputation: 196886
set term=foo
is useless: the TERM
environment variable should be set by your terminal emulator or, baring that, in your shell's *rc
file.
Supposing you use CLI Vim, you can obtain something that looks like that screenshot if you set your terminal emulator up to use the solarized palette.
Upvotes: 0
Reputation: 4898
Try using the following in your vimrc:
set background=dark
before you activate the colorscheme.
EDIT: have just reread your question and realised you already do this. Apologies!
Upvotes: 0
Reputation: 1332
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 :)
Upvotes: 2