Using VIM Flashcards
What vim command will substitute all occurances of an old value with a new one?
:%s/old/new/g
What does the :%s/old/new/g command do?
The command will substitute all occurances of an old value with a new one.
What vim command will go to the top of the document?
gg
What does the gg command do?
The gg command will go to the top of the document.
What vim command will go to the end of the document?
G
What does the G command do?
The G command will go to the end of the document.
How do you search forward through a document?
/string
Followed by n
How do you search backwards through a document?
?string
How do you modify a file in vim?
The i and a commands enter input mode
* i - insert
* a - append
What happens when i or a is pressed in command mode?
vim will enter input mode
What vim command is used to delete the current line?
dd
What is the dd command used for?
The dd command is used to delete the current line.
What vim command is used to copy (yank) the current line?
yy
What is the yy command used for?
The yy command is used to copy (yank) the current line.
What vim command is used to past the test currently in the buffer?
p
What does the p command do?
The p command is used to past the test currently in the buffer.
What vim command is used to undo the last operation?
u
What does the u command do?
The u command is used to undo the last operation
What vim command is used to redo the last undone operation?
Ctrl+r
What does the Ctrl+r combination do?
The Ctrl+r command is used to redo the last undone operation.
What is the set number command used for?
The set number command displays each row number.
A shortened version is se nu.
set nonumber removes the numbering (se nonu)
What shell command provides information about vim usage?
The command is executed in the shell session and not in vim.
vimtutor