Command Mode
i - Insert Mode
a - Insert after the character
I - Insert at the beginning of the line
A - Insert at the end of the line
u - Undo
dd - delete line
x - delete character
s - delete character and auto insert mode
<Ctrl-r> Redo
:w save, :q exit, ! <shell command>, :w!, :q! forced versions
:%s/searchstring/replacestring/g
Micheal's vim configs
- Line numbers
- show white spaces and strip white space()
- Syntax highlight and Solarized Theme
https://github.com/thoughtbot/dotfiles
Along with many other blog posts written in thoughtbot blogs related to vim and efficiency.
- Relative Line Numbers
- Vim Movements
- Disable arrow keys and use h, j, k, l exclusively
- n+(hjkl) for fast movements
- f,F for fast movements in line with , and ; for repeat
- . (dot) for repeated commands
- % for vim toggling location between opening and closing tags, braces, statements
- gg and G,
- zz, zt, zb, <Ctrl-D>, <Ctrl-U> - scroll current window
- # and *
- Vim Selected Commands
- d+(vim movement), c+(vim movement)
- d/c + (i/a) + selection (diw, ciw, da(, da", ca", ...)
- Source Formatting
- > right indent, < left indent, = for default indent
- mix >, < and = with movement commands
- =% proper indent a block of code, gg=G proper indent the whole source file
- Visual Mode, v, Shift+v, Ctrl+v (column select)
- Ctrl+v with Shift+I (to do things like in sublime, multi cursor)
- Multiple Files
- splits (split, vsplit, tabnew)
- ctrl+p
- netrw (Sex, Vex, Sex!, Vex!, e, Ex)
- using % for auto file path completion
- Patterns
- Buffers (:bufdo, :ls, :bd, :b(num), ..)
- Tabs