Minimal Vim Setup
Like I mentioned in my previous post, I use vim as my text editor. It’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’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’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’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 = " "
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 <C-h> <C-w>h
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-l> <C-w>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