vim basics Flashcards
How to append text to the EOL (end of line)
A (shift + a)
How to quit without saving?
:q!
How to save edits and quit?
:wq
How to delete one character like using Del button?
x
How to delete word and spaces until the start of the next word (cursor is standing on the beginning) ?
dw
Delete all chars to the end of line
d$
What is a proper format for a delete command with the d operator?
d [number] short list of motions: w - until the start of the next word, e - to the end of the current word, $ - to the end of the line h, j, k, l - right down up left
What happens in case you hit motion key ‘w’?
A w operator will move cursor until the start of the next word.
What happens in case you hit motion key ‘e’?
A e (end) operator will move cursor to the end of the current word.
What happens in case you hit motion key ‘$’?
A $ operator will move cursor to the end of the line.
How to move cursor two words forward?
2w
How to move cursor to the end of the third word forward?
3e
How to move 50 strings down?
50j
What are main navigation keys?
h - left
j - down
k - up
l - right
How to move to the start of the line?
0 (zero)
How to delete two words?
d2w
How to delete the whole line (everything to the left and right of the cursor)?
dd
Kill 2 lines of text
2dd
How to undo (like ctrl+z)?
u
How to undo all changes on a line?
U (shift + u)
Is it possible to undo the undo’s?
ctrl + R
How to put previously deleted text after current position of the cursor?
p
Replace a char
r
Replace a char and put instead of it new character
r
like
rn
will delete previous char and put ‘n’ instead of it