Advertisement
Guest User

Untitled

a guest
Feb 24th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.28 KB | None | 0 0
  1. # Repeat command
  2.  
  3. | Command | Effect |
  4. |---------------------|-------------------------------------|
  5. | `<number><command>` | Repeat `<command>` `<number>` times |
  6.  
  7. # Move the cursor
  8.  
  9. | Command | Cursor movement |
  10. |--------------------|-----------------------|
  11. | `h`, `j`, `k`, `l` | Left, up, down, right |
  12. | `e` | End of word |
  13. | `gg` | Start of file |
  14.  
  15. # Delete text
  16.  
  17. | Command | Effect |
  18. |---------|------------------------------------------------|
  19. | `dd` | Delete current line |
  20. | `dG` | Delete current line and rest of file |
  21.  
  22. # Insert text
  23.  
  24. | Command | Effect |
  25. |----------------|----------------------------------------------------------------------------|
  26. | `a` | Enter insert mode after cursor position |
  27. | `i` | Enter insert mode before cursor position |
  28. | `r<character>` | Delete text under cursor, insert `<character>`, and return to command mode |
  29. | `s` | Delete text under cursor and enter insert mode |
  30. | `c<motion>` | Delete text from cursor to `<motion>` and enter insert mode (e.g. `ciw`) |
  31.  
  32. # Macros
  33.  
  34. | Command | Effect |
  35. |---------|-----------------------------------------------------------------|
  36. | `q<letter><commands>q` | Record macro `<commands>` at register `<letter>` |
  37. | `@<letter>` | Execute macro at register `<letter>` |
  38.  
  39. Like any `vim` command, you can repeat a macro `<number>` times with
  40. `<number>@<letter>`.
  41.  
  42. # Visual block mode
  43.  
  44. | Command | Effect |
  45. |----------|-------------------------|
  46. | `ctrl-v` | Enter visual block mode |
  47.  
  48. In visual block mode, all cursor movements duplicate or extend the cursor.
  49.  
  50. For example, `ctrl-v` `10j` `e` `s` `fixup` `esc` enters visual block mode,
  51. duplicates the cursor over the next 10 lines, extends the cursor to the end of
  52. the current word, deletes the selection and enters insert mode, inserts "fixup"
  53. on each of the 11 selected lines, and returns to command mode.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement