VIM Flashcards
Execute ls command
:!ls
Open visual mode
v
Visual select word
vw
Open the file “hat.rb”
:e hat.rb
Open new line below
o
Open new line above
O
Go to end of word
e
Go to end of next word
2e
Append after cursor
a
Enter replace mode
R
Yank word
yw
Yank to end of current line
y$
Change search settings to ignore case
:set ic
Change search settings to use case
:set noic
Open file “sun.rb”
:e sun.rb
Get help for “w” command
:help w
Delete character at cursor
x
Insert at beginning of line
I
Append at end of line
A
Delete to end of line
d$
Go to beginning of text on current line
^
Go to end of text on current line
$
Go to beginning of current line
0
Delete two words
d2w
Delete entire line
dd
Undo last change
u
Undo changes on entire line
U
Redo changes
ctrl+R
Start recording macro in “1” register
q1
Stop recording macro
q
Play “1” macro
@1
Replay last macro
@@
Show yank register
:reg
Paste from 0 register
“0p
Copy onto clipboard
“+y
Enclose word with qoutes
cw""<ESC>P
c - cut into register
w - regex match \w
”” - insert two “ characters at current cursor position
<ESC> - VIM shorthand for hitting the escape key. In this context, return to command mode
P - paste current register
</ESC>
Back a word
b