This post is the follow up of vim adventures I.
At this stage you should be able to move around inside a file, search for strings and insert text. You can probably even exit the damn thing without setting the house on fire.
Now you’d like to make Vim pretty, to make it your own. But before going down the rabbit hole of customisation, check out romainl’s list of best practices to get you started: idiomatic-vimrc.
A good font makes all the difference for code readability and general terminal aesthetics. I like Termsyn (ask me if you want the OSX version) because of its crisp appearance on LCD screens and its stocky letters that remain extremely readable in densely packed text. There are plenty of others which are also popular: Tamsyn (osx dfonts), Gohufont, Terminus, Inconsolata, Fira…
When it comes to plugins, there’s an overwhelming number available, so it’s best to ease yourself in with these popular ones to get started:
- The nicest plugin manager I came across: plug
- To display a fancy status bar thingy: lightline
- To make your code pretty: gruvbox
- To combine the two above: lightline-gruvbox
- To display your project’s hierarchy: dirvish
- To look for files (vim command-line-interface only): fzf
- To look for files (both in CLI and GUI): ctrlp
- To align stuff (like a group variables): lion
- To automaticaly rebuild your ctags (for easy navigation): gutentags. You need to install universal ctags or at least exubertant ctags on your system.
- To change the quotes and other surrounding pairs: surround
- To quickly comment out blocks of code: commentary
- To manage your code snipets: snipmate
- To git in vim: fugitive
Some day, when you have reached a milestone of mastery, you might ditch most of your plugins. But for now, take your time and allow the plugins to assist you in hiking the steep learning curve. Chances are, Vim will eventually become the only editor you’ll ever need.
A few more tips for the road
- If after a week or two you still can’t break the habit of using the arrows to move around in a file, you can disable them by pasting the below code into your vimrc
noremap <Up> <NOP> noremap <Down> <NOP> noremap <Left> <NOP> noremap <Right> <NOP>
Ctrl+[instead of Escape (closer to home row)
- Save your little finger, remap caps lock to control (in osx go to settings/keyboard/modifier keys)
- Remember to use
f(move to char in line) and
/(search pattern) to move around
- Start reading Practical Vim by Drew Neil
This post is part II of the Vim Adventures series, I will post part III next week.
If you want to comment feel free to shout me a good oul Tweet @PierreAclement…