Search Flashcards
1
Q
Go start of file
A
gg
2
Q
Go to end of file
A
G
3
Q
Show file info and current line number
A
Ctrl + g
4
Q
Go to line
A
line number followed by G
5
Q
Search command
A
/
6
Q
Search for a phrase in reverse direction
A
?
7
Q
Next search result
A
n
8
Q
Previous search result
A
N
9
Q
Return to start location
A
Ctrl + O
10
Q
Find matching parentheses
A
%
11
Q
Subsitute command syntax
A
s/old/new/g (This will subsitute new for old). The g flag will make the changes globally within the line.
12
Q
Subsitute within a range of line
A
:#,#s/old/new/g
13
Q
Subsitute within whole file
A
:%s/old/new/g
14
Q
Subsitute within whole file and prompt to make change
A
:%s/old/new/gc
15
Q
Find next character match in line
A
fx (subsitute x for whatever character you want go to the next instance of)