How to install colortheme in NeoVim in Mac OS X?

user702300 picture user702300 · Feb 10, 2017 · Viewed 9.4k times · Source

I just installed NeoVim VimR 0.13.1 from https://github.com/qvacua/vimr/releases for Mac OSX. I was able to set default options by creating a file at

~/.config/nvim/init.vim

Now I am having a hard time trying use a color theme. For example I am interested with OceanicNext theme from https://github.com/mhartington/oceanic-next

So I downloaded the zip file, unzipped it then it creates a folder called

oceanic-next-master

So I moved this folder to

~/.config/nvim/oceanic-next-master

Added necessary code to the init.vim file

" For Neovim 0.1.3 and 0.1.4
let $NVIM_TUI_ENABLE_TRUE_COLOR=1

" Or if you have Neovim >= 0.1.5
if (has("termguicolors"))
 set termguicolors
endif

" Theme
syntax enable
colorscheme OceanicNext

But even restarting the VimR, nothing happens. So I tried renaming the folder name from

~/.config/nvim/oceanic-next-master

to

~/.config/nvim/OceanicNext

Still no luck. So tried to copy the actual OceanicNext.vim file to

~/.config/nvim/OceanicNext.vim

Still didn't work restarting it. So I tried running the command directly

colorscheme OceanicNext

But it give me the following error message

Cannot find color scheme 'OceanicNext'

I also tried install other color scheme from https://github.com/frankier/neovim-colors-solarized-truecolor-only but still wasn't able to make it work.

I also have MacVim installed and just copy and pasting the plugins into the ~/.vim worked, but looks like NeoVim is different? What am I doing wrong?

Thank you.

Answer

Dmitry Shvetsov picture Dmitry Shvetsov · Feb 11, 2017

The nvim documentation on the colorscheme command :help colorscheme

:colo[rscheme] {name}

Load color scheme {name}. This searches 'runtimepath' for the file "colors/{name}.vim". The first one that is found is loaded. Also searches all plugins in 'packpath', first below "start" and then under "opt".

I suggest to you yo put color scheme file into ~/.config/nvim/colors folder.

By the way, vim-plug plugin is great for managing vim and neovim plugins and colorschemes. Give it a try.