Fast track to being productive in Vim
Keywords
neovim, vim, beginner, tutorial
When I first started using vim three months ago, I found it quite challenging to get meaningful work done. I now realize that there were a list of things I had to grok in order to be productive in vim. Learning vim can be extremely gratifying, but the core ideas in vim are also probably unlike anything you have seen before. I thought it would be useful to share some steps one could take to maximize productivity with vim after committing to it. I haven’t been using vim for very long so I’m by no means an expert, and I still learn new things about vim every day. That said, this is in my experience the best bang for buck in priority order.
- Spend half an hour (maybe over lunch) using vimtutor.
- Type
vimtutor
in a command line window and follow instructions.
- Type
- Learn to stay in normal mode often.
- If you want to make a change, enter insert mode, edit text and return to normal mode.
- Break old habits while learning new features by disabling functionality you are accustomed to.
- For example, you can learn to navigate using
hjkl
by disabling arrow keys.
- For example, you can learn to navigate using
- Understand how to use macros:
q
: Start a macro[REG]
: Assign a macro to a register, e.g.a
. Starts recording a macro[keystrokes]
: Perform a set of keystrokes, e.g.ciwhelloESC
q
: End recording a macro@[REG]
: Play a macro from cursor current position@@
: Play last played macro
- Learn how to use and navigate buffers (
:ls<CR>
,:buffer N
,C-^
), jumplist (C-O
,C-I
), and taglist (C-]
,C-T
). - Learn about the built-in complete sub-mode: Use
C-X
in insert mode. Craft your lightsaber
— make vim your own using~/.vimrc
.- Don’t be afraid to customize your editor, but also don’t add anything in your .vimrc that you don’t understand.
- Change CAPSLOCK to ESC.
- Watch other people use vim on vimcasts and on YouTube.
- Find plugins to boost your productivity, and use a plugin manager.
Reuse
Citation
BibTeX citation:
@online{krishnamurthy2015,
author = {Krishnamurthy, Dheepak},
title = {Fast Track to Being Productive in {Vim}},
date = {2015-05-02},
url = {https://kdheepak.com/blog/fast-track-to-being-productive-in-vim/},
langid = {en}
}
For attribution, please cite this work as:
D.
Krishnamurthy, “Fast track to being productive in Vim,” May
02, 2015. https://kdheepak.com/blog/fast-track-to-being-productive-in-vim/.