Vim Commands Flashcards

1
Q

What 3 ways can you save and exit?

A

ZZ :wq :x

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

Exit without saving

A

:q!

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

Go to beginning of current word

A

b

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

Go to end of current word

A

e

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

Go to start of next word

A

w

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

Move to column 15

A

15|

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

Move to the beginning of the next line

A

+

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

Move to the beginning of the previous line

A

-

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

Half screen up

A

C - u

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

Half screen down

A

C - d

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

Full screen up

A

C - B

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

Full screen down

A

C - f

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

Go to line 32

A

32G 32gg :32

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

Set current line to the top of the screen

A

z then return

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

Delete the next character

A

x

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

Delete the previous character

A

X

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

Delete the entire line

A

dd

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

Delete all the text to the right of the cursor till the end of the line

A

D

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

Insert after the end of the line

A

A

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

Paste after the current cursor position

A

P

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

Paster before the current cursor position

A

p

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

Indent selected block of code

A

>

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

Outdent selected block of code

A

<

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

Undo

A

u

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Redo
C - r
26
Open file
:e
27
Open a menu like list of files in the current directory
:e .
28
Jump to shell
:sh
29
Search for the first occurrence of flower
/flower
30
Find next occurrence after a / search
:n
31
Global find and replace
ggVG :s/find/replace/g
32
Jump to matching delimiter
%
33
Jump to matching keyword
%
34
Next buffer
:b#
35
First buffer
:bf
36
Last buffer
:bl
37
Switch to another buffer by its number
:b5
38
List all the buffers in use
:ls
39
Open another file into a split screen
:split
40
Open multiple files in split
:vi -o
41
Switch between windows
C -w C - w
42
Close current window
C -w q
43
Split current window
C - w s
44
Display info about current file
C - g
45
Move to next start of method
]m
46
Move back to first start of method
[m
47
Change params of method we are in
[m f(
48
Change return value of method we are in
]MO
49
Jump to the start of the *next* class or module definition
]]
50
Jump to the start of the *previous* class or module definition
[[
51
What do you need to add to .vimrc.local to be able to use % to toggle between matching keywords?
runtime macros/matchit.vim
52
When's a great way to use % to toggle between matching keywords?
At the bottom of an rspec file to match all the ends
53
select inside method
vim
54
delete inside method
dim
55
change inside method
cim
56
yank inside method
yim
57
select around method
vam
58
delete around method
dam
59
change around method
cam
60
yank around method
yam
61
select inside class
viM
62
delete inside class
diM
63
change inside class
ciM
64
yank inside class
yiM
65
select around class
vaM
66
delete around class
daM
67
change around class
caM
68
yank around class
yaM
69
select inside ruby block
vir
70
delete inside ruby block
dir
71
change inside ruby block
cir
72
yank inside ruby block
yir
73
select around ruby block
var
74
delete around ruby block
dar
75
change around ruby block
car
76
yank around ruby block
yar