I started using vim seriously a few years ago after I graduated from university. At the time, I wanted a consistent experience between my dev environment at home and at work so I decided to give vim a try. It’s been pretty stable for work and my projects, so I wanted to share my configs and workflow for those interested in playing around with vim.
I’m currently using nvim but this setup should work with regular vim as well. I decided not to go down the lua route just to keep my configuration interchangeable between nvim and vim. I may play around with lua in the future but for now I like to keep things simple.
Useful Hotkeys
One of the benefits of using vim is the hotkey system. Here are some of my favorite hotkeys.
Normal mode
g + d
- Jump into the definitionctrl + o
- go back- Useful if you used
g + d
to jump into a new file. You can use this hotkey to go back to the last file.
- Useful if you used
tab
- go forward- If you used
ctrl + o
to go back you can usetab
to go forward.
- If you used
ctrl + e
- Open NERDtree and focus on it\ + f
- Formats the fileshift + k
- Shows the documentation for the hovered code\ + r + n
- Renames the hovered variable/functionctrl + w + v
- Creates a vertical split with the same filectrl + w + s
- Creates a horizontal split with the same fileg + t
- Next tabg + T
- Previous tab
Visual Mode
ctrl + v
- Visual blockshift + i
- Edit multiple lines
My Plugins
I try to avoid bloating my setup so I only have a few plugins installed.
- coc.nvim
- Hosts my language servers in a separate NodeJS process.
- vim-airline
- Pretty status/tabline
- vim-signify
- Shows my git/mercurial diffs
- fzf
- Fuzzy find for text
- nerdtree
- File navigation
The .vimrc
Here’s my vim config with some themeing settings removed. If you’re interested in seeing the full configuration you can find it on my github.
|
|