Minimal Vim Setup
Like I mentioned in my previous post, I use vim as my text editor. It{{content}}#x2019;s light, minimal and fast. Just to illustrate how fast it is, I can open my 110MB irc log file in vim instantly and experience no lag whatsoever.
I only have 5 plugins installed with only two of those being a part
of my workflow. I use Goyo and Limelight for
distraction free typing and reading on vim. I also use fzf
which is a great fuzzy finder for vim. VimCompletesMe is my
preferred autocomplete plugin as it is completely written in
vimscript and is very lean. Lastly, Sneak is a
great minimal alternative to the Easymotion vim plugin.
I don{{content}}#x2019;t use any plugin manager as starting from version 8, vim already has a pretty decent package manager. So, just a simple
git clone https://github.com/repo/vim-plugin ~/.vim/pack/vendor/start/
installs and enables a plugin.
I{{content}}#x2019;ve seen a lot of people use vim plugins that provide functionality
which is already present in vim. A popular plugin called
NerdTree is one such example. Vim already has a
configurable file explorer called netrw builtin. Hence, not
only is NerdTree pointless, it{{content}}#x2019;s also extremely
bloated.
I have a minimal vimrc (40-50 lines) to keep things as vanilla as
possible. The default leader key \ is pretty difficult to
use when paired with other keys, therefore I have it remapped to
space
let mapleader = {{content}}quot; {{content}}quot;
By default vim opens a new vertical split in the left side and a new horizontal split above the current window. This is unintuitive and annoying. This can be changed by adding
set splitbelow splitright
to the vimrc. On the topic of splits, the default keybindings for
changing focus between splits are a lot of keypresses
(ctrl+w followed by ctrl + h/j/k/l). I have
remapped them to ctrl + h/j/k/l
map {{content}}lt;C-h{{content}}gt; {{content}}lt;C-w{{content}}gt;h
map {{content}}lt;C-j{{content}}gt; {{content}}lt;C-w{{content}}gt;j
map {{content}}lt;C-k{{content}}gt; {{content}}lt;C-w{{content}}gt;k
map {{content}}lt;C-l{{content}}gt; {{content}}lt;C-w{{content}}gt;l
Although vim is great, the code is a mess. I might switch to lighter
and cleaner alternatives like vis in the future
Sources:
vimrc: https://github.com/mananapr/dotfiles/blob/master/home/.vimrcGoyo: https://github.com/junegunn/goyo.vimLimelight: https://github.com/junegunn/limelight.vimVimCompletesMe: https://github.com/ajh17/VimCompletesMefzf: https://github.com/junegunn/fzf.vimvis: https://github.com/martanne/vis