1

Vim gives me this error :-

Error detected while processing /home/piggy/.vimrc:
line   23:
E185: Cannot find color scheme 'solarized'
Press ENTER or type command to continue

But I can change to solorized color scheme inside the vim using :colo, and it soes work perfectly.

enter image description here


My .vimrc (I don't know how to copy from vim to clipboard on linux)

1     " Indent automatically depending on filetype
2     filetype indent on
3 
4     " Turn on line numbering. Turn it off with "set nonu" 
5     set number
6 
7     " Set syntax on
8     syntax on
9 
10     " Case insensitive search
11     set ic
12 
13     " Higlhight search
14     set hls
15 
16     " Wrap text instead of being on one line
17     set lbr
18 
19     " Change colorscheme 
20     let g:solarized_termcolors=256
21     set background=dark
22     set t_Co=256
23     colorscheme solarized
24     " show existing tab with 4 spaces width
25     set tabstop=4
26 
27     " when indenting with '>', use 4 spaces width
28     set shiftwidth=4
29 
30     " On pressing tab, insert 4 spaces
31     set expandtab
32 
33     " Setting wildmenu
34     set wildmenu
35 
36 
37     call plug#begin('~/.vim/plugged')
38 
39     Plug 'https://github.com/scrooloose/nerdtree.git'
40     Plug 'https://github.com/Valloric/YouCompleteMe.git'
41     Plug 'https://github.com/altercation/vim-colors-solarized.git'
43     call plug#end()
44 
45     let g:ycm_server_python_interpreter = '/usr/bin/python'
46     let g:ycm_global_ycm_extra_conf = "~/.vim/plugged/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py
grodzik
  • 4,588
  • 19
  • 27

1 Answers1

1

Move lines 19-23 of your .vimrc after calling plug#end() (in the above .vimrc excerpt after line 43).

In general you want to configure plugins after they were loaded, not before that. Vim will complain in different ways if the order is wrong (i.e. first configured and later loaded/added to runtime path by plugin manager)

grodzik
  • 4,588
  • 19
  • 27
  • Also can you help me to know how to copy to clipboard from vim using y. –  Feb 13 '17 at 14:21
  • 1
    It was well described in one of the questions on this site. Here's a link: http://vi.stackexchange.com/questions/84/how-can-i-copy-text-to-the-system-clipboard-from-vim – grodzik Feb 13 '17 at 14:27
  • I know that but where I have to type "*y ? when I press : then write "*y it does not have any effect. When I press "*y without : it just copies the text to vim's buffer not the clipboard. I belive ",* and y stands for some special keys that I have to press like C^V means I pressed control and v not that I have pressed C then ^ then V. –  Feb 13 '17 at 15:21
  • 1
    @A---B Type the command in normal mode (i.e.without :) - but use + instead of * to copy to the clipboard. (There's more in the answer grodzik refers to about the clipboard feature flag) – lazysoundsystem Feb 13 '17 at 16:40