Kevin Exp贸sito
Posted on February 18, 2022
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
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
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'
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
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
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
Let's start by changing the terminal theme to solirized one 馃槑
- Open gnome terminal
- Right click in terminal
- Preferences
- Unnamed
- Colors
- Unselect "use colors from system themes" and select "Solarized Dark". Another cool option would be "Gnome Dark"
Extra - Add custom fonts
Add Mononoki font to Ubuntu
- 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)
- Download
- 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
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:
- Open gnome terminal
- Right click in terminal
- Preferences
- Unnamed
- Select custom font -> mononoki Nerd Font Mono
If you have permissions issues use sudo
馃摳 Screenshots 馃摳
If you have any special config file or keymapping that you can't work without it please share with us!
Posted on February 18, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.