My VIM Configuration

shaun singh
4 min readApr 26, 2021

TLDR: you can find my vim configuration here:

Why did I start using vim?

As many of you, I started off using VSCode. However, for a while I had to use a Mac computer on school on which I had no admin privilages and so I started using Vim.

Shortly after, Vim became my go-to text editor for almost everything, even after I switched back to a faster laptop on which I had permissions. The universal keybindings and infinite customizability made other editors feel strangely uncomfortable

Just a few months later, I am almost always exclusively using Neovim, which is essentially vim with some shiny new additions.

Plugin management

Right now I am using vim plug, mainly because of its good balance of features and performance, as well as its ability to lazy load plugins on demand

Plugins

Color themes

I generally prefer using darker themes with blue colors and moderate to high contrast. At the moment I currently am using the Ocean Material theme, but also switch between Nord and a fork of Doom-One depending on how tired my eyes are

material ocean theme

Status Line

I Use lightline.vim for my statusline, since it has a good amount of features and customizability while also retaining decent performance.

My current Statusline

Utilities

I tend to keep my plugins as light as possible, and write code myself. The main plugins I use are

Fzf -> Fast file search.
NERDTree -> Directory tree view
vim-fugitive -> Git integration for vim
vim-gitgutter -> Shows git changes in the gutter
vim-visual-multi -> vscode/sublime-style multiple cursors for vim

Gitgutter, ale, and multi-cursors

Visual Plugins

I have a few plugins just to make vim feel more comfy and beutiful

indentline — Shows dashed lines to keep track of indents
dashbaord-nvim — Shows a doom-emacs style startup menu
goyo.vim — Distraction free iA-writer style view for vim
limelight.vim — Highlights only current paragraph, served with Goyo
vim-devicons — nice icons for vim
vim-scrollstatus — shows a scrollbar in the status-line

Distraction free writing with Goyo + Limelight

Linting

For linting I try to keep it as light as possible, by turning it off by default and only on save. My linting plugin of choice is ale, along with lightline-ale for a little eye candy in my statusline

For Individual linters I use:

proselint — markdown and text files
flake8, yapf, autimport — python files
clang — c++
javac — java files

For spellchecking I use the built in vim spellcheck

Ale-Linting for Python

Language Specific Additions

For writing markdown I like to have

vim-textobj-user + vim-textobj-quote — use curly quotes instead of standard ones
vim-markdown — general plugin for markdown syntax and folding

Other non-plugin additions

GUI

For my GUI I love to use Neovide for its beutiful cursor and its simple no-frills design

I have the SFMono NerdFont set as my default font

Lightline Additions

I use a function to add file icons and the current wordcount to my lightline configuration, as well as what git branch I’m on using vim-fugitive

Wordcount!

Floating windows

I’ve configured FZF and my terminal to utilize Neovim’s Floating Window api to create a cleaner look

FZF :Files in a Floating Window

Key Mappings

The only major changes I have for my keybindings are

C-p — open fzf (sublime text style)
C-h/j/k/l — move between splits/open splits
jk — go back to normal mode
alt-arrows — create multiple cursors

I’ve also unbinded my mouse and arrow keys to force me to use hjkl and key motions

Other small changes

I’ve added the doom logo to display on start, as well as a few new icons and extension changes here and there. I also have standard or relative line numbers depending on the mode I’m in, and have vim set to use the global clipboard so I can paste across macOS.

--

--