• x -> delete character • dd -> delete current line (and copy) • p -> paste • y -> copy character (yank) • yy -> copy current line • hjkl -> mode around (←↓↑→) • :help <command> • :w -> save, :q -> quit, :wq -> save and quit
go to the beginning of next word (word) • b -> go to the beginning of last work (back) • e -> go to the end of next word (end) • u -> undo last change (undo) • cw -> change word • o -> insert new line after the current one • gg -> go to the beginning of the document • $ -> go to the end of the line, 0 -> go to the beginning of the line
until the end of the line • daw -> delete all word (word and whitespace around it) • d2p -> delete two paragraphs • dt) -> delete until the parenthesis (not incluse) • di” -> delete inside quotes • da” -> delete inside quotes and quotes • % -> go to matching bracket • d2/hello -> delete until second occurrence of hello
• A -> append at the end of the line • D -> delete until the end of the line (shortcut for d$) • C -> change until the end of the line • O -> new line before the current line • G -> go to the end of the file • J -> append previous line
for next occurrence • N for previous occurrence • * runs search for word under cursor • f<character> find next occurrence of character in current line • ; next character in same line • , previous character in same line • F<character> find but in reverse • t<character>, like f but sets the cursor before the character
operations on that selection • v -> go into visual mode with character selection • V -> go into visual mode with line selection • <C-v> -> go into visual mode with block selection • Useful for instance for: • J -> join all lines together • < > -> add indentation • = -> autoindent
make you a faster and more efficient developer. It’s available on almost every OS—if you master the techniques in this book, you’ll never need another text editor. In more than 100 Vim tips, you’ll quickly learn the editor’s core functionality and tackle your trickiest editing and writing tasks. It’s Maciej Certified!