Ex Mode Flashcards

1
Q

Specify a range

A

:{num},{num}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

go to end of file

A

:$

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

go to line

A

:{num}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

all lines in file

A

%

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

select range between patterns

A

:/{pattern}+1,/{pattern}-1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

select range including pattern

A

:/{pattern}/,/{pattern}/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

line where cursor is placed

A

.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

move a line to another position

A

:{num}m{num} (or move)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

copy a line to a position

A

:{num}t{num} (or copy, or co)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

execute a command on each line in the selection in normal mode

A

:{range}normal {command}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

copy the word under the cursor

A

:Ctrl-rCtrl-w

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

efficient global replace

A

*{old}cw{new}:%s//Ctrl-rCtrl-w/g

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

bring up command line window

A

q:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

bring up command line window from command mode

A

Ctrl-f

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

run a command in the shell

A

:!{cmd}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

start an interactive shell session

A

:shell

17
Q

send output of command to buffer

A

:read !{cmd}

18
Q

write buffer to command

A

:write !{cmd}

19
Q

filter a range with a command

A

:{range}!{filter} (e.g. :2,$!sort -t’,’ -k2)

20
Q

setup a range for a command

A

!{motion} (e.g. !3j)