VIM Flashcards
What are the three main modes in VIM?
normal,
insert,
last line
normal mode is often also called ‘command’ mode, but is ‘normal’ in the manual
last line or lastline may also be called command-line or ex. But afaik it is “officially” called last line mode
What is the primary way to enter insert mode? Also, what mode must you be in to enter insert mode?
From ‘normal’ mode, press ‘i’
What button should you press to enter last line mode? Also, what mode must you be in to enter this mode?
From ‘normal’ mode, press ‘:’
If you wish to open a document for editing in a VIM session, what mode is the only mode capable of doing this?
This is done with the last line command ‘:e ‘
What is the command to enter insert mode and place the cursor at the end of the current line?
A
If you wish to enter insert mode to change the line from the point of the cursor to the end of the line, which key should you use?
C
If you are in normal mode and wish to delete the character under the cursor without entering insert mode, how would you do this?
x
If you are in normal mode and wish to change the single character under the cursor without entering insert mode, how can this be done?
r and then enter the letter you wish to replace it
To move to the beginning of the line in normal mode, which key should you use?
0 as in ‘zero’
How to move to the end of the line in normal mode?
$
In normal mode, does ‘j’ mean ‘down’ or ‘up’?
It means down. I remember this because j hooks ‘down’ and k points ‘up’
In normal mode, does ‘k’ mean down or up?
It means up! It does not hook ‘down’ like j does
If you wish to enter insert mode after the character that is under your cursor, what key should you press?
a
If, while in normal mode, you wish to create a new line after the cursor and enter insert mode on that line, which key should you press?
o, as in ‘my god’
If, while in normal mode, you wish to create a new line before the cursor and enter insert mode on that line, which key should you press?
O, as in ‘MY GOD!!”