O'Reilly logo

Mastering Vim by Ruslan Osipov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Optimizing your workflow

Everyone's workflow is unique, and no two people use Vim in exactly the same way. It's useful to find ways to compliment your style by enhancing and optimizing the way you do things in Vim.

Find yourself using a particular command a lot? Create a custom key binding!

For example, I use the CtrlP plugin quite a lot (both for navigating the file tree and the buffer list), and I have the following custom mappings:

nnoremap <leader>p :CtrlP <cr>nnoremap <leader>t :CtrlPTag <cr>

I also often find myself running the :Ack command (provided by the ack-vim plugin) on a word under cursor, so I have the following in my .vimrc:

nnoremap <leader>a :Ack! <c-r><c-w><cr>

The <c-r> and <c-w> inserts the word under cursor into the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required