Currently, I am trying to create a ~/.vimrc
file that I will be able to integrate into any environment and get all my configs with minimum user interference.
In order to simplify my vim configuration. I decided to install my plugins into the ~/.vim/plugged
directory and the colorschemes into another directory ~/.vim/colors
.
Supposedly, I would run 2 commands in vim to install the plugins :source %
:PlugInstall
and then extract the colorscheme *(.vim)*
from the ~/.vim/color/gruvbox/color
and ~/.vim/color/vim-monokai/color
directories in order to make the config more versatile.
Briefly talking, the problem is that the plugins stop working - eg: :NERDTreeToggle
would result in
:NERDTreeToggle is not an edditor command
if there are two call plug#begin/end
statements in the file but the colorschemes get installed as expected.
call plug#begin('~/.vim/plugged')
Plug 'mbbill/undotree'
Plug 'ycm-core/YouCompleteMe'
Plug 'preservim/nerdtree'
Plug 'lyuts/vim-rtags'
Plug 'vim-utils/vim-man'
" Git Integration:
Plug 'mhinz/vim-signify'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-rhubarb'
Plug 'junegunn/gv.vim'
call plug#end()
call plug#begin('~/.vim/colors')
" Colorscheme:
Plug 'morhetz/gruvbox'
Plug 'sickill/vim-monokai'
call plug#end()
Although I was able to fix the problem simply by putting all repos into one call plug#begin/end
block as indicated below, I am still curious if there exists a different solution to the problem.
call plug#begin('~/.vim/plugged')
Plug 'mbbill/undotree'
Plug 'ycm-core/YouCompleteMe'
Plug 'preservim/nerdtree'
Plug 'lyuts/vim-rtags'
Plug 'vim-utils/vim-man'
" Git Integration:
Plug 'mhinz/vim-signify'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-rhubarb'
Plug 'junegunn/gv.vim'
" Colorscheme:
Plug 'morhetz/gruvbox'
Plug 'sickill/vim-monokai'
call plug#end()
PS: I am using vim-plug as my plugin manager
plug#begin
is what screws things up? You might have some luck asking on their issue tracker; the maintainers are likely to know what's going on here.color
directory to keep things clean and as you saw trying to put them in a different directory doesn't really makes things simpler. Maybe what you want to do is having a separate vimrc to have different configurations, in this case maybe this question could be useful?