Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. ## Useful Vim key bindings
  2.  
  3. ### movement
  4.  
  5. - `0` - beginning of line
  6. - `^` - beginning of non-whitespace
  7. - `$` - end of line
  8. - `9j` - move down 9 lines
  9. - `w` - move forward by word
  10. - `b` - move backward by word
  11. - `gg` - first line
  12. - `G` - last line
  13. - `C-u` - up half page
  14. - `C-d` - down half page
  15. - `f/` - move forward to first "/" character
  16. - `t/` - move forward right before the first "/" character
  17. - `;` - repeat that command again
  18. - `H` - head of the screen
  19. - `M` - middle of the screen
  20. - `L` - last of the screen
  21. - `}` - move forward by paragraph or block
  22. - `{` - move backwards by paragraph or block
  23. - `*` - search for word under the cursor
  24. - `n` - search again forward
  25. - `N` - search again backwards
  26. - `#` - search backwards for word under cursor
  27. - `/` - search forward
  28. - `?` - search backward
  29. - `%` - find matching brace, paren, etc
  30. - `ma` - mark a line in a file with marker "a"
  31. - ``a` - after moving around, go back to the exact position of marker "a"
  32. - `'a` - after moving around, go back to line of marker "a"
  33. - `:marks` - view all the marks
  34. - `''` - go to the last place you were
  35.  
  36. ### editing
  37.  
  38. - `x` - delete char under cursor
  39. - `X` - delete char before cursor
  40. - `A` - add to end of line
  41. - `I` - insert at the beginning of the line
  42. - `dd` - delete line
  43. - `D` - delete from cursor to end of line
  44. - `di'` - delete text inside single quotes
  45. - `yy` - copy line
  46. - `Y` - copy from cursor to end of line
  47. - `cc` - change line
  48. - `C` - change from cursor to end of line
  49. - `cit` - change text inside html tag
  50. - `ci'` - change text inside single quotes
  51. - `ci{` - change text inside curly brackets.
  52. - `ci...` - etc
  53. - `p` - paste after cursor
  54. - `P` - paste before cursor
  55. - `o` - add line below
  56. - `O` - add line above
  57. - `.` = repeat last comment
  58. - `r` - replace character
  59. - `R` - replace. (overwrite) (good for columns of text)
  60. - `J` - join line (cursor can be anywhere on line)
  61.  
  62. ### visual mode
  63.  
  64. - `v` - visual char mode
  65. - `V` - visual line mode
  66. - `C-v` - block visual mode
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement