Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solarized works after sourcing .vimrc from within vim, but not when starting vim. #190

Open
GameKyuubi opened this issue Aug 26, 2017 · 2 comments

Comments

@GameKyuubi
Copy link

GameKyuubi commented Aug 26, 2017

This is kind of a bizarre problem. I installed solarized with VimPlug, added it to my .vimrc and sourced it, and the colors immediately worked. Closed vim, opened again, and I get the error E185: Cannot find color scheme 'solarized'. Huh. Yet sure enough, after pressing enter to get into vim and doing :source ~/.vimrc the solarized colors appear and work fine.

.vimrc:

syntax on                                                                                                                                                                                                                                                                                                                     
set tabstop=2                                                                                                                                                                                                                                                                                                                 
set shiftwidth=2                                                                                                                                                                                                                                                                                                              
set expandtab                                                                                                                                                                                                                                                                                                                 
set noshowmode                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
set number                                                                                                                                                                                                                                                                                                                    
set foldlevel=2                                                                                                                                                                                                                                                                                                               
set nofoldenable                                                                                                                                                                                                                                                                                                              
set foldmethod=indent                                                                                                                                                                                                                                                                                                         
set foldnestmax=10                                                                                                                                                                                                                                                                                                            
set laststatus=2                                                                                                                                                                                                                                                                                                              
set background=dark                                                                                                                                                                                                                                                                                                           
colorscheme solarized                                                                                                                                                                                                                                                                                                         
                                                                                                                                                                                                                                                                                                                              
filetype plugin on                                                                                                                                                                                                                                                                                                            
set omnifunc=syntaxcomplete#Complete                                                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                                                              
" Specify a directory for plugins (for Neovim: ~/.local/share/nvim/plugged)                                                                                                                                                                                                                                                   
call plug#begin('~/.vim/plugged')                                                                                                                                                                                                                                                                                             
Plug 'altercation/vim-colors-solarized'                                                                                                                                                                                                                                                                                       
Plug 'tpope/vim-commentary'                                                                                                                                                                                                                                                                                                   
Plug 'majutsushi/tagbar'                                                                                                                                                                                                                                                                                                      
Plug 'scrooloose/nerdtree'                                                                                                                                                                                                                                                                                                    
Plug 'christoomey/vim-tmux-navigator'                                                                                                                                                                                                                                                                                         
Plug 'itchyny/lightline.vim'                                                                                                                                                                                                                                                                                                  
Plug 'ap/vim-buftabline'                                                                                                                                                                                                                                                                                                      
Plug 'junegunn/rainbow_parentheses.vim'                                                                                                                                                                                                                                                                                       
Plug 'airblade/vim-gitgutter'                                                                                                                                                                                                                                                                                                 
Plug 'mxw/vim-jsx'                                                                                                                                                                                                                                                                                                            
Plug 'pangloss/vim-javascript'                                                                                                                                                                                                                                                                                                
call plug#end()                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                              
let g:jsx_ext_required = 0                                                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                                                                              
" \ev to edit .vimrc                                                                                                                                                                                                                                                                                                          
nnoremap <leader>ev :vsplit $MYVIMRC<cr>                                                                                                                                                                                                                                                                                      
" \sv to source .vimrc                                                                                                                                                                                                                                                                                                        
nnoremap <leader>sv :source $MYVIMRC<cr>                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                              
" Method navigation workaround for modern syntax                                                                                                                                                                                                                                                                              
map [[ ?{<CR>w99[{                                                                                                                                                                                                                                                                                                            
map ][ /}<CR>b99]}                                                                                                                                                                                                                                                                                                            
map ]] j0[[%/{<CR>                                                                                                                                                                                                                                                                                                            
map [] k$][%?}<CR>                                                                                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                                                                              
nnoremap <C-t> :TagbarToggle<CR>                                                                                                                                                                                                                                                                                              
nnoremap <C-n> :NERDTreeToggle<CR>                                                                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                                                                              
let g:lightline = {                                                                                                                                                                                                                                                                                                           
      \ 'colorscheme': 'solarized',                                                                                                                                                                                                                                                                                           
      \ }                          
@hakilebara
Copy link

There is a workaround in #104 :
try moving colorscheme solarized after call plug#end()

@DavidPesticcio
Copy link

I had the same issue - then I found this 😃 - https://stackoverflow.com/a/34165694/1506858

Your vimrc is supposed to be here:
$HOME/.vimrc
or there, if you use Vim 7.4 or newer:
$HOME/.vim/vimrc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants