Motions
- 0: move the cursor to colum 1 (hard beg-of-line)
- $: move the cursor to end-of-line
- ^: move the cursor to the first non-blank character (soft beg-of-line)
- -: move the cursor to the first non-blank character (soft beg-of-line) of the previous [count] line
- +,: move the cursor the first non-blank character (soft beg-of-line) of the next [count] line
- h: move the cursor to left [count] colum
- j: move the cursor to down [count] line
- k: move the cursor to up [count] line
- l: move the cursor to right [count] colum
- w: move the cursor to the beginning of next [count] word
- b: move the cursor to the beginning of previous [count] word
- e: move the cursor to the end of next [count] word
- ge: move the cursor to the end of previous [count] word
- W: move the cursor to the beginning of next [count] WORD
- B: move the cursor to the beginning of previous [count] WORD
- E: move the cursor to the end of next [count] WORD
- gE: move the cursor to the end of previous [count] WORD
- f* ('*' can be any character): move the cursor to next [count] appearance of the character in current line (e.g. fa fb fc ...)
- F*: move the cursor to previous [count] occurrence of the character in current line (e.g. Fa Fb Fc ...)
- t*: move the cursor to just before the next [count] occurrence of the character in current line
- Learn more...
Text Objects
- i[: select inner [] block, not including [ and ].
sample: 'di]' or 'di[' to delete contents betwen [], 'ci]' or 'ci[' to change contents between [], 'yi]' or 'yi[' to copy contents between []. - i]: select inner [] block, not including [ and ]. refer to 'i['
- i{: select inner {} block, not including { and }. refer to 'i['
- i}: select inner {} block, not including { and }. refer to 'i['
- i<: select inner <> block, not including < and >. refer to 'i['
- i>: select inner <> block, not including < and >. refer to 'i['
- i": select inner quotation marks "", not including ". refer to 'i['
- i': select inner quotation marks '', not including '. refer to 'i['
- a[: select outer [] block, including [ and ]. refer to 'i['
sample: 'da]' or 'da[' to delete contents betwen [], 'ca]' or 'ca[' to change contents between [], 'ya]' or 'ya[' to copy contents between []. - a]: select outer [] block, including [ and ]. refer to 'a['
- a{: select outer {} block, including { and }. refer to 'a['
- Learn more...
Regular commands
- i: enter input mode to insert text before the cursor
- a: enter input mode to append text after the cursor
- gi: enter input mode where insert mode was exited last time
- I: enter input mode before the first non-blank in the line (soft beginning-of-line)
- gI: enter input mode at the column one (hard beginning-of-line)
- A: enter input mode to append text after end of line
- R: enter input mode in overtype mode
- o: insert an new line below the cursor and enter input mode at column 1 of the new line
- O: insert an new line above the cursor and enter input mode at column 1 of the new line
- s: delete [count] character start from that under the cursor and enter input mode there
- S: delete [count] line down from the current line (include current line), and reserve one blank line, then enter input mode at column 1 of this blank line.
- C: remove all characters from the cursor to end-of-line and enter input mode there
- x: delete [count] character start from the one under the cursor, and copy them to the clipboard
- X: delete [count] character before the cursor, and copy them to the clipboard
- ~: toggle case to upper or lower of current character
- r*: (where '*' is any character), replace [count] character that starts from the one under the cursor with the given character
- J: join the current line with the next one, leaving exactly one space charactr between them
- u: undo last action
- Ctrl-r: redo last undone action
- D: remove all characters start from that under the cursor to end-of-line
- Y: copy current line
- p: paste text in the clipboard after the cursor
- P: paste text in the clipboard at the cursor
- Learn more...
Ex Commands
- :w : save current file
- :q : close current file
- :wq : save and close current file
- :bd : close current file