Action | Key | Tip |
---|---|---|
Move left | h |
|
Move below | j |
|
Move above | k |
|
Move right | l |
Action | Key | Tip |
---|---|---|
Jump to next cursor position | <C-i> |
|
Jump to previous cursor position | <C-o> |
Action | Key | Tip |
---|---|---|
Leader | <Space> |
Action | Key | Tip |
---|---|---|
Move to the beginning of line | 0 |
|
Move to the first non-space character of line | ^ or _ |
|
Move to the EOL | $ |
Action | Key | Tip |
---|---|---|
Forward word | w |
Think of "word" |
Forward word (incl. punctuation) | W |
|
Backwards word | b |
Think of "backwards" |
Backwards word (incl. punctuation) | B |
|
End of word | e |
Think of "end" |
Action | Key | Tip |
---|---|---|
Move to the next specified character | f |
Think of "find" |
Move to the next (backwards) specified character | F |
|
Move to before specified character | t |
Think as "till" |
Move to before (backwards) specified character | T |
|
Repeat (find or till) motions forward | ; |
|
Repeat (find or till) motions backwards | , |
Examples:
f(
moves to the nearest(
forward in the line- if then
;
is pressed, it moves to the next(
in the line
Action | Key | Tip |
---|---|---|
Move to first line | gg |
|
Move to last line | G |
|
Move to line x |
:x |
|
Move to previous paragraph | { |
|
Move to next paragraph | } |
Action | Key | Tip |
---|---|---|
Move forward full screen | <C-f> |
Think of "move forward" |
Move backwards full screen | <C-b> |
Think of "move backwards" |
Move forward half screen | <C-d> |
Think of "move down" |
Move backwards half screen | <C-u> |
Think of "move up" |
Move to the top of the screen | H |
|
Move to the middle of the screen | M |
|
Move to the bottom of the screen | L |
Action | Key | Tip |
---|---|---|
Position cursor on center of the screen | zz |
|
Position cursor on top of the screen | zt |
Think of "top" |
Position cursor on bottom of the screen | zb |
Think of "bottom" |
Action | Key | Tip |
---|---|---|
Jump to previous class/function definition | [[ |
|
Jump to next class/function definition | ]] |
|
Jump to previous diagnostic | [d |
|
Jump to next diagnostic | ]d |
Action | Key | Tip |
---|---|---|
Insert before cursor | i |
Think of "insert" |
Insert at beginning of line | I |
|
Insert after cursor | a |
Think of "append" |
Insert at EOL | A |
|
Add a line below and insert cursor | o |
Think of "open" |
Add a line above and insert cursor | O |
Action | Key | Tip |
---|---|---|
Yank (copy) | y |
Think of "copy" |
Yank line | yy |
|
Delete (cut) | d |
Think of "cut" |
Delete line | dd |
|
Delete char | x |
|
Replace char | r |
|
Change | c |
Think of "delete + insert" |
Change line | cc |
|
Paste after the cursor | p |
|
Paste before the cursor | P |
Action | Key | Tip |
---|---|---|
Undo | u |
Examples:
d3j
: Delete 3 linesci{
: Change inside the{}
5k
: Move 5 lines above6yy
: Yank 6 lines
Action | Key | Tip |
---|---|---|
Enter visual mode | v |
|
Enter visual mode + select current line | V |
Action | Key | Tip |
---|---|---|
Selected text to uppercase | U |
|
Selected text to lowercase | u |
|
Selected text toggle case | ~ |
|
Add tabulation to selected text | > |
|
Substract tabulation from selected text | < |
Examples:
6jVD
: Advance 6 lines, select and delete the whole line<C-v>
+3j
+I#
+<Esc>
: Apply a vertical change, 3 lines with#
at the beginning of line
Action | Key | Tip |
---|---|---|
List buffers | :ls or <leader><leader> |
|
Edit file in new buffer | :e file |
|
Go to next buffer | :bn or <leader>bn |
Think of "buffer next" |
Go to previous buffer | :bp or <leader>bp |
Think of "buffer previous" |
Close buffer | :bd or <leader>bd |
Think of "buffer delete" |
Note: In case the same buffer is present in several windows, it will close all of them.
Action | Key | Tip |
---|---|---|
Open current buffer in horizontal split | <C-w>s |
Think of "window + split" |
Open current buffer in vertical split | <C-w>v |
Think of "window + vertical" |
Close current window | <C-w>q |
Think of "window + quit" |
Close all other windows | <C-w>o |
Think of "window + (quit) others" |
Action | Key | Tip |
---|---|---|
Move cursor to left window | <C-h> |
|
Move cursor to below window | <C-j> |
|
Move cursor to above window | <C-k> |
|
Move cursor to right window | <C-l> |
Action | Key | Tip |
---|---|---|
Open file/link | <leader>gx |
|
Repeat last command | . |
Action | Key | Tip |
---|---|---|
Go to definition | <leader>gd |
|
Go to references | <leader>gr |
|
Go to implementation | <leader>gI |
|
Show hover information | <leader>gg |
|
Type definition | <leader>D |
Jump to the type of the word under cursor (definition of the type, not where it was defined) |
Document symbols | <leader>ds |
Fuzzy find symbols (vars, functions, types...) in current file |
Workspace symbols | <leader>ws |
Fuzzy find symbols (vars, functions, types...) in entire project |
Rename variable | <leader>rn |
|
Code action | <leader>ca |
Cursor must be at an error or suggestion |
Action | Key | Tip |
---|---|---|
Toggle breakpoint | <leader>bb |
|
Remove all breakpoints | <leader>br |
|
Start/continue debug | <leader>dc |
|
Debug step into | <leader>di |
|
Debug step over | <leader>dv |
|
Debug step out | <leader>do |
|
Debug step back | <leader>db |
|
Debug terminate | <leader>dt |
|
Debug restart | <leader>dr |
|
Debug show hover information | <leader>? |
Action | Key | Tip |
---|---|---|
Run nearest test | <leader>tr |
|
Run last test | <leader>tl |
|
Run file tests | <leader>tf |
|
Run all tests | <leader>ta |
Action | Key | Tip |
---|---|---|
Debug nearest test | <leader>tR |
|
Debug last test | <leader>tL |
|
Debug file tests | <leader>tF |
|
Debug all tests | <leader>tA |
Action | Key | Tip |
---|---|---|
Toggle test summary | <leader>ts |
|
Toggle test output window | <leader>to |
|
Stop test | <leader>tS |
|
Attach to test | <leader>tA |
Action | Key | Tip |
---|---|---|
Toggle line blame | <leader>tb |
|
Toggle buffer blame | <leader>tB |