General Flashcards
How do you search for the word under the cursor?
*
Delete to the end of a line
d$
Vim: Append at end of line
A
Delete character under cursor
x
VIM: Delete the word under the cursor
Get on the first letter than ‘dw’
Delete a word under the cursor but leave spaces so to reinsert another word
de
Move to start of line
0
Move two words forward
- Start of 3rd word
- end of 2nd word
- 2w
- 2e
Move to end of line
$
Vim: Delete ‘n’ number of words at same time
dnw
Delete a full line
dd
delete ‘n’ lines
ndd
place a freshly deleted (dd) line in the line under your current location
p
P will place before the cursor
Replace the character under the cursor
r-char
Remove rest of a word from after the cursor
ce
vim: Name of file/ line number
Ctrl g
Vim: Go to End of file
G
Vim: Go to top of file
gg
Navigate to specific line
Line G
Return to where you just came from
Ctrl o
Vim: Locate the paired bracket
% while on the lead
vim: Search and replace first instance in a line
s/old/new
Replace all instances in a line
s/old/new/g
Replace all instances in a file
%s/old/new/g