Some things you can do in insert mode...



Some things you can do in insert mode...

0 1


vim-insertmode-presentation


On Github actionshrimp / vim-insertmode-presentation

Some things you can do in insert mode...

VimLondon, 28th May 2013

Dave Aitken (@actionshrimp)

Woooo! Insert mode!!

Getting out of insert mode

Esc, C-[, C-c*

*breaks abbreviations, InsertLeave autocmd

:inoremap <C-c> <Esc>

Text editing

Text width

e.g. :set textwidth=80

goes well with :set colorcolumn=80

gw motion

gwgw/gww

gwap

gggwG

Abbreviations

e.g. :iabbr teh the

Auto-fix common typos: teh -> the

:abbr, :iabbr

Basic Keys

Key A way to remember it C-j hjkl C-h hjkl C-w word C-u uh-oh

Bonus: These also work in the shell!

But beware the curse of C-w...

Registers

C-r <register name>

Useful registers in insert mode:

/, : (although often better to use q: and q/)

= expression register:

  • current date: "=strftime('%c')

Completion

C-n / C-p - next/prev word completion

C-l - line completion, (suprisingly useful, smart about tabs)

Getting help for insert mode

prefix the thing you're looking for with 'i_'

:help i_^w

(this also works for other modes, e.g. v_ for visual)

also... :help Insert-mode

Questions?