Vim Tips

Updated on August 29, 2016.

Vim tips from different sources.

Reading Practical Vim

Notes from Drew Neil’s book Practical Vim.

Chapter 1 : The Vim Way

Chapter 2 : Normal Mode

Chapter 3 : Insert Mode

Chapter 4 : Visual Mode

Chapter 5 : Commandline mode

Chapter 6 : Manage multiple files

Chapter 7 : Open files and save them to disk

Chapter 8 : Get around faster

Chapter 9 : Navigate between files with jumps

Chapter 10 : Copy and paste

Chapter 11 : Macros

TODO : Read the section about editing macros again.

Chapter 12 : Matching Patterns and Literals

TODO Revisit this chapter once you have had more experience searching.

Chapter 14 : Substitution

Chapter 15 : Global commands

Chapter 16 : Index and navigate source code with ctags

Chapter 17 : Compile code and navigate errors with the quickfix list

setlocal makeprg=NODE_DISABLE_COLORS=1\ nodelint\ %
   let &l:efm='%A'
   let &l:efm.='%f\, '
   let &l:efm.='line %l\, '
   let &l:efm.='character %c:'
   let &l:efm.='%m' . ','
   let &l:efm.='%Z%.%#' . ','
   let &l:efm.='%-G%.%#'

Chapter 18 : Search projectwide with grep, vimgrep, and others

Chapter 19 : Dial ‘X’ for auto-completion

Chapter 20 : Find and fix typos with Vim’s spell checker

Appendix 1 : Customizing Vim to suit your preferences

Here is a way to customize the indentation for different file types:

if has("autocmd")
        filetype on
        autocmd FileType ruby setlocal ts=2 sts=2 sw=2 et
        autocmd FileType javascript setlocal ts=4 sts=4 sw=4 noet

Notes from talk on YouTube: Let Vim Do the Typing

Talk link:

Vim folding tips