Hi @junegunn, I've written the following simple hook to install colorschemes.
I needed to create a symlink for color directory and, using your suggestions, I've written the following:
let g:molokai_create_symlink = 'cd ~/.config/nvim/colors/ && for FILE in `find ../plugins/molokai/ -type f -name "*.vim"`; do ln -s "${FILE}" `basename "${FILE}"`; done'
Plug 'tomasr/molokai', { 'do': g:molokai_create_symlink }
This works, but it should be great to have a function that generalizes my bash script and puts a variable with plugin name where in my example I have "molokai".
Unfortunately I have no experience with VimL, but maybe this snippet can be useful for vim-plug docs.
Thank you for your wonderful plugin manager!
Hmm, I think you're somehow confused. Where did you get the idea that colorschemes need to be installed manually? You don't need such script to use a colorscheme. Maybe you tried to use it before plug#end()?
Ok, so what are the steps for installing a colorscheme with vim-plug?
Putting Plug 'tomasr/molokai' and colorscheme molokai it does not work because molokai.vim is searched in ~/.config/nvim/colors/ directory, and not in ~/.config/nvim/plugins/molokai/colors/molokai.vim, where vim-plug puts it...
Colorschemes are not any different from other types of plugins. You don't need to worry about directories at all. Like I said, have you made sure that colorscheme molokai appears after call plug#end()?
Sorry, I did not understand at what you were referring to, saying "Maybe you tried to use it before plug#end()"...
You are right, putting colorscheme molokai after plug#end() it works without any symlink.
Sorry again for my dumb questions, now it's clear how it works.
No problem. It seems that the requirement is not obvious to some users. I'll see if I can further clarify the documentation.
Most helpful comment
Colorschemes are not any different from other types of plugins. You don't need to worry about directories at all. Like I said, have you made sure that
colorscheme molokaiappears aftercall plug#end()?