Ex Mode Flashcards
1
Q
Specify a range
A
:{num},{num}
2
Q
go to end of file
A
:$
3
Q
go to line
A
:{num}
4
Q
all lines in file
A
%
5
Q
select range between patterns
A
:/{pattern}+1,/{pattern}-1
6
Q
select range including pattern
A
:/{pattern}/,/{pattern}/
7
Q
line where cursor is placed
A
.
8
Q
move a line to another position
A
:{num}m{num} (or move)
9
Q
copy a line to a position
A
:{num}t{num} (or copy, or co)
10
Q
execute a command on each line in the selection in normal mode
A
:{range}normal {command}
11
Q
copy the word under the cursor
A
:Ctrl-rCtrl-w
12
Q
efficient global replace
A
*{old}cw{new}:%s//Ctrl-rCtrl-w/g
13
Q
bring up command line window
A
q:
14
Q
bring up command line window from command mode
A
Ctrl-f
15
Q
run a command in the shell
A
:!{cmd}