Add a theme to Neovim
We will first install vim-plug to manage plugins, and will then install the Gruvbox theme. The end result will look like this:
Steps
Generate vim-plug by executing the following command:
$ curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
In ~/.config/nvim, create a new file called init.vim ($ touch init.vim)
Enter the following code in init.vim:
call plug#begin('~/.local/share/nvim/plugged')
Plug 'morhetz/gruvbox'
call plug#end()
colorscheme gruvbox
set background=dark
Start neovim ($ nvim) and, while it is in command mode, type :PlugInstall
Restart neovim to get the theme working
Description
We first install vim-plug with the curl command.
We then create init.vim, the file that holds all of neovim’s configuration (make the necessary directories if they’re missing).
In this file we have to create a section for plugins, and declare in the plug#begin tag in which folder vim-plug can install those plugins. We also add a colorscheme and background information so that neovim knows which theme to load and what the background colour should be.
Finally we start neovim (ignore the ‘can not find color scheme’ error) and use vim-plug’s :Pluginstall command in neovim to install the theme. This time you will not see the error as the theme has now been installed.
Useful Links
https://jdhao.github.io/2018/12/24/centos_nvim_install_use_guide_en/
https://github.com/junegunn/vim-plug
https://github.com/morhetz/gruvbox














