T0RB1T

vim cheat sheet

Jul 8th, 2019
383
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. ESC -> Cancel current key sequence or exit current mode to go to normal mode.
  2. i -> go in insert mode, place cursor at the start of current character.
  3. a -> go in insert mode, place cursor at the end of current character.
  4. shift + i -> go in insert mode, place cursor at start of current line after the indentation whitespace.
  5. shift + a -> go in insert mode, place cursor at the end of the current line.
  6. o -> create a line below the current line and go in insert mode.
  7. shift + o -> create a line above the current line and go in insert mode.
  8.  
  9. / -> search for a text. Example: '/hello'
  10. n -> find (forward). Uses the text you entered after the slash.
  11. shift + n -> find (backward). Uses the text you entered after the slash.
  12.  
  13. f -> search for letter in current line. Example: 'ft'
  14. ; -> find (forward). Uses the letter you entered after f.
  15. , -> find (backward). Uses the letter you entered after f.
  16.  
  17. shift + f -> search for letter in current line backwards.
  18. ; -> find (backward). Uses the letter you entered after f.
  19. , -> find (forward). Uses the letter you entered after f.
  20.  
  21. shift + y -> yank current line.
  22. dd -> cut current line.
  23. p -> paste below.
  24. shift + p -> paste above.
  25.  
  26. 0 -> go to the start of the line.
  27. $ -> go to the end of the line.
  28. gg -> go to the start of the file.
  29. shift + g -> go to the end of the file.
  30.  
  31. w -> go to the start of the next word.
  32. b -> go to the start of the previous word.
  33. e -> go to the end of the next word.
  34. ge -> go to end of the previous word.
  35.  
  36. ciw -> cut current word and go in insert mode.
  37.  
  38. :w -> save current file.
  39. :q -> quit without saving.
  40. :wq -> save and quit.
Advertisement
Add Comment
Please, Sign In to add comment