Colorschemes (in general)
When executing the :colorscheme {name}
command, vim1 searches runtimepath
2 for the file colors/{name}.vim
. This is explained under :help :colorscheme
.
Why We Care
If I wanted to install the molokai
theme by itself, I could conceivably grab the file form GitHub and put it in my vim3 directory under colors
. Then :color molokai
would work just fine. But then my only recourse to update it would be copying the file again whenever I felt like doing so.
Things like vim packages, pathogen, and other plugin managers were born to help with this. They have the explicit goal of allowing an entire repository of code to become a part of the runtime path. Effectively, this means that a repo with colors
, plugin
, and after
can become a mini vim directory, having it's files loaded as within my personal vim directory.
Why We Care (part 2)
flazz/vim-colorschemes
is a repo. It's not one colorscheme, it's a whole bunch. So, either
- Clone it to
$MYVIMDIRECTORY/colors
3 ; or
- Put it in a package; or
- Use a plugin manager of your choice.
The key here is that the colors directory provided by flazz/vim-colorschemes
must be on your runtimepath4. Again, packages, plugin managers, or simply the base colors directory are the options here, each with their merits and difficulties. I recommend packages, but to each his own.
Solving the OPs Problem
I suspect that the OP's main problem is where to put the directory colors
from flazz/vim-colorschemes
.
- "Standard": Put the colors directory in your vim3 directory (such that
vim/colors
is the directory from the repo)
- Benefits: extremely backwards compatible
- Downsides: difficult to add new colorschemes to this directory, as it is now a git repository
- Packages: Put the whole repo in your vim3 directory under
pack/{your_package_name}/opt
- Benefits: keep one plugin repo isolated from another, builtin to vim
- Downsides: vim 8 required (not sure about nvim)
- Plugin manager: Do what they tell you to do (e.g. with Pathogen it would be at
vim/bundle/vim-colorschemes
or similar)
- Benefits: plugin manager does a lot of heavy-lifting for you (Pathogen is different--it was effectively packages before packages were created)
- Downsides: Learn a new tool, more requirements to making your vim config portable
Then make sure color {name}
is in your vimrc/init.vim.
Notes
- For this post,
vim
refers to both Vim and NeoVim
- Vim uses (effectively)
~/.vim, $VIMRUNTIME, ~/.vim/after
(:help rtp
). NeoVim uses the XDG standard, so it's something like ~/.config/nvim
for Unix and ~/AppData/Local/nvim
for Windows
- See #2: This is going to be one of
~/.vim, ~/_vim, ~/.config/nvim, ~/AppData/Local/nvim
depending on your vim and OS.
- Note that this is pretty much explicitly covered in the README
Based on the screenshot in the OP, the AppData
path is the right one for this Q&A. This can be verified with :echo &rtp
.
:help xdg
and the output of:set rtp?
from within Neovim.