Skip to content

Latest commit

 

History

History
executable file
·
64 lines (45 loc) · 1.87 KB

File metadata and controls

executable file
·
64 lines (45 loc) · 1.87 KB

GENERAL

  • <Esc> - exit current mode (back to NORMAL) -or- cancel current command
  • number<command> - repeat <command> x number of times

MOVEMENT

k

h j l - basic arrow keys

Scan on current line

  • f_ - find character
  • F_ - reverse find
  • t_ - find till character (stop before character)
  • T_ - reverse find till character (stop after character)
  • ; - repeat previous scan movement
  • , - repeat previous scan movement in reverse

Word-Wise

  • w - jump forwards to beginning of next word
  • W - jump forwards to beginning of next WORD
  • b - jump backwards to beginning of next word
  • B - jump backwards to beginning of next WORD
  • e - jump forwards to end of next word (reverse with ge)
  • E - jump forwards to end of next WORD (reverse with gE)

<Aside: word vs. WORD>

A WORD is just a bigger version of a word. words are separated by whitespace and punctuation. WORDS are only separated by whitespace. Example: test.api.py is a file has 8 words but only 4 WORDS.

Line-Based

  • 0 - jump to beginning of line (column 0)
  • ^ - jump to first ^o^-whitespace character
  • $ - jump to end of line (la$T character)

Other

  • % - jump to matching character of a match pair
    • Default Pairs: () [] {}
    • :h matchpairs for more info

EDITING

Insert

  • i - enter iNSERT mode before cursor
  • I - enter INSERT mode at beginning of line
  • a - enter INSERT mode after cursor
  • A - enter INSERT mode After the line

Deleting and Changing

  • d_<movement>_ - delete up to movement
  • c_<movement>_ - change up to movement
  • cc - change the current line (delete & replace)
  • dd - delete the current line
  • cc - change the current line (delete & replace)
  • D - delete to end of line
  • C - change to end of line