My Nvim setup process

kexposito

Kevin Exp贸sito

Posted on February 18, 2022

My Nvim setup process

Some of us have some special configurations and guides we like to follow for some tools like bspwm, sxhkd, polybar, terminal, etc. And here is mine for Vim, which I want to share with you.

鈿狅笍 Make sure you have git installed, because one of our vim plugins will need that in order to work correctly.

Download Nvim

Go to https://github.com/neovim/neovim/releases and select the latest version from nvim and check Assets and download nvim.appimage.

Installing Nvim

Open a terminal and copy the code below

cd ~/Downloads
chmod u+x nvim.appimage && ./nvim.appimage

sudo mv nvim.appimage /usr/local/bin
sudo chmod +x /usr/local/bin/nvim.appimage
Enter fullscreen mode Exit fullscreen mode

In my case that I want to rename it i will run the following command (you can also declare an alias for it).

sudo mv /usr/local/bin/nvim.appimage /usr/local/bin/vim 
Enter fullscreen mode Exit fullscreen mode

And that's it! we have Nvim installed and ready to go, but lets add some pretty configurations.

Install VimPlug

You can install VimPlug by running:

sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
   https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
Enter fullscreen mode Exit fullscreen mode

and create the following directory:
mkdir ~/.config/nvim/
mkdir ~/.config/nvim/plugged (I will use this folder in our init.config)

If you are having any issue with this please follow the instructions here: https://github.com/junegunn/vim-plug#unix-linux

Init.vim

superpower
You shoud create the following file:
vim ~/.config/nvim/init.vim and fill it with your configuration.
Here is my init.vim, but I strongly suggest to use the things that you like and you feel comfortable with. And just adapt this guide to your preferences.

https://gist.github.com/kexposito/6a22cf04e83402c64b77c1434e63bef5

Installing addons

Now that we copy, or added some Plugs we are ready to
open vim and run :PlugInstall. (In case you already have addons)
I will create a guide for the most used addons by myself so keep tune.

Adding colorscheme to our Nvim

Let's create a color folder.

mkdir ~/.config/nvim/colors
And create a file named railscasts.vim
vim ~/.config/nvim/colors/railscasts.vim
and paste the following code https://gist.github.com/kexposito/16ed1d356d5bdcdc6709573a9e61e9b8
(This railscasts.vim file was taken from https://github.com/cedarcode/cedarvim)

" To use for gvim:
" 1: install this file as ~/.vim/colors/railscasts.vim
" 2: put "colorscheme railscasts" in your .gvimrc
"
" If you are using Ubuntu, you can get the benefit of this in your
" terminals using ordinary vim by taking the following steps:
"
" 1: sudo apt-get install ncurses-term
" 2: put the following in your .vimrc
"     if $COLORTERM == 'gnome-terminal'
"         set term=gnome-256color
"         colorscheme railscasts
"     else
Enter fullscreen mode Exit fullscreen mode

Following the guide proposed in cedarvim, after this make sure to install ncurses-term by running sudo apt-get install ncurses-term.

Configure terminal to have a good looking

cool
Let's start by changing the terminal theme to solirized one 馃槑

  1. Open gnome terminal
  2. Right click in terminal
  3. Preferences
  4. Unnamed
  5. Colors
  6. Unselect "use colors from system themes" and select "Solarized Dark". Another cool option would be "Gnome Dark"

gnome terminal
gnome terminal pref

Extra - Add custom fonts

Add Mononoki font to Ubuntu

  1. Go to https://www.nerdfonts.com/font-downloads and search for "Mononoki Nerd Font" (here is a preview of it https://www.programmingfonts.org/#mononoki)
  2. Download
  3. Open a terminal and run:
mkdir /usr/local/share/fonts/Mononoki
cp ~/Downloads/Mononoki.zip /usr/local/share/fonts/Mononoki
unzip /usr/local/share/fonts/Mononoki/Mononoki.zip
rm /usr/local/share/fonts/Mononoki/Mononoki.zip
sudo fc-cache -fv
Enter fullscreen mode Exit fullscreen mode

Image description

If you had any issue following these steps here is a guide for you too https://www.addictivetips.com/ubuntu-linux-tips/ubuntu-install-fonts-guide/

And now you should be able to select it:

  1. Open gnome terminal
  2. Right click in terminal
  3. Preferences
  4. Unnamed
  5. Select custom font -> mononoki Nerd Font Mono

If you have permissions issues use sudo

馃摳 Screenshots 馃摳

nvim screenshot
nvim screenshot

If you have any special config file or keymapping that you can't work without it please share with us!

馃挅 馃挭 馃檯 馃毄
kexposito
Kevin Exp贸sito

Posted on February 18, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

My Nvim setup process
vim My Nvim setup process

February 18, 2022