Vim Flashcards

(183 cards)

1
Q

Vim: how to move cursor 1 char left?

A

h

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

Vim: how to move cursor 1 char right?

A

l

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

Vim: how to move cursor 1 char up?

A

k

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

Vim: how to move cursor 1 char down?

A

j

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

Vim: how to move cursor to the beginning of the line?

A

0

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

Vim: how to move cursor to the end of the line?

A

$

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

Vim: how to move cursor to the first non-empty character of the line?

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

Vim: how to move cursor forward one word (next alphanumeric word)?

A

w

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

Vim: how to move cursor forward one word delimited by a whitespace?

A

W

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

Vim: how to move cursor forward five words delimited by whitespace?

A

5W

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

Vim: how to move cursor backwards one word (previous alphanumeric word)?

A

b

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

Vim: how to move cursor backward one word (delimited by whitespace)?

A

B

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

Vim: how to move cursor to end of file?

A

G

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

Vim: how to move cursor to beginning of file?

A

gg

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

Vim: how to move cursor to the previous sentence?

A

(

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

Vim: how to move cursor to the next sentence?

A

)

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

Vim: how to move cursor to the previous paragraph?

A

{

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

Vim: how to move cursor to the next paragraph?

A

}

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

Vim: how to move cursor to the previous section?

A

[[

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

Vim: how to move cursor to the next section?

A

]]

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

Vim: how to move cursor to the end of the previous section?

A

[]

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

Vim: how to move cursor to the end of the next section?

A

][

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

Vim: how insert text after the cursor?

A

a

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

Vim: how to insert text at the end of line?

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Vim: how to insert text before the cursor?
i
26
Vim: how to begin a new line above the current line?
O
27
Vim: how to begin a new line below the current line?
o
28
Vim: how to insert the content of the file below the cursor?
:r
29
Vim: how to execute command and insert output below the cursor?
:r !
30
Vim: how to delete character at cursor and add it to clipboard?
x
31
Vim: how to delete from cursor to end of word?
dw
32
Vim: how to delete from cursor to beginning of the line?
d0
33
Vim: how to delete from cursor to end of line?
d$
34
Vim: how to delete from cursor to end of sentence?
d)
35
Vim: how to delete from cursor to beginning of file?
dgg
36
Vim: how to delete from cursor to end of file?
dG
37
Vim: how to delete current line?
dd
38
Vim: how to delete 3 lines starting from current?
3dd
39
Vim: how to replace character under cursor with ?
r{}
40
Vim: how to replace characters instead of inserting them?
R
41
Vim: how to copy current line into storage buffer?
yy
42
Vim: how to copy current lines into register x?
''xyy | double quotes
43
Vim: how to paste current storage buffer after current line?
p
44
Vim: how to paste current storage buffer before current line?
P
45
Vim: how to paste from register x after current line?
"xp | double quotes
46
Vim: how to undo last operation?
u
47
Vim: how to redo last undo?
ctrl-r
48
Vim: how to search for "text" forwards?
/text
49
Vim: how to search for "text" backwards?
?text
50
Vim: how to move to next instance of search result?
n
51
Vim: how to move to previous instance of search result?
N
52
Vim: how to search for "text" and replace first occurance with "hello"?
:%s/text/hello
53
Vim: how to search for "text" and replace all occurances with "hello"?
:%s/text/hello/g
54
Vim: how to search for "text" and ask before replacing occurances with "hello"?
:%s/text/hello/gc
55
Vim: how to set bookmark "x" to current cursor position?
mb
56
Vim: how to list all bookmarks?
:marks
57
Vim: how to jump to beginning of line of bookmark at "x"?
'x
58
Vim: how to enter visual mode per character?
v
59
Vim: how to enter visual mode per line?
V
60
Vim: how to switch case of current visual selection?
~
61
Vim: how to delete selected text?
d
62
Vim: how to delete selected text and start insert?
c
63
Vim: how to copy selected text into clipboard (yank)?
y
64
Vim: how to indent text to the right (shift right)?
>
65
Vim: how to indent text to the left (shift left)?
66
Vim: how to filter through an external command?
!
67
Vim: how to copy current selection into register x?
"xy | double quotes
68
Vim: how to open file under current cursor?
gf
69
Vim: which arguments makes vim write files with encryption (will prompt for key)?
-x
70
Vim: which argument makes vim start without plugins?
--noplugin
71
Vim: how to start vim in diff mode (argument)?
-d
72
Vim: how to scroll down one half of the screen?
ctrl-d
73
Vim: how to scroll up one half of the screen?
ctrl-u
74
Vim: how to scroll up one screen?
ctrl-b
75
Vim: how to scroll down one line?
ctrl-y
76
Vim: how to scroll up one line?
ctrl-e
77
Vim: how to move cursor to middle of page?
M
78
Vim: how to move cursor to top of page?
H
79
Vim: how to move cursor to bottom of page?
L
80
Vim: how to move cursor to end of word (alphanumeric)?
e
81
Vim: how to move cursor to end of word (whitespace delimited)?
E
82
Vim: how to move cursor to line 30?
:30
83
Vim: how to move cursor to the matching bracket?
1. Place cursor on the bracket ({}[]()) | 2. $ %
84
Vim: how to move cursor to previously modified line?
'.
85
Vim: how to move cursor to next line with a lowercase mark?
]'
86
Vim: how to move cursor to previous line with a lowercase mark?
['
87
Vim: how to insert one character before the cursor?
I (uppercase i)
88
Vim: how to undo all changes to current line?
U
89
Vim: how to delete contents to end of line?
D
90
Vim: how to delete character one before cursor?
X
91
Vim: how to substitute one character under the cursor?
s
92
Vim: how to substitue entire line and begin to inser at beginning of line?
S
93
Vim: how to increment number under cursor?
ctrl-a
94
Vim: how to decrement number under cursor?
ctrl-x
95
Vim: how to repeat last command action?
.
96
Vim: how to open file with tag for word under cursor?
ctrl-]
97
Vim: how to open file with ctag "function_name"?
:tag function_name | :ta function_name
98
Vim: how to go back when opened a file matching a ctag?
ctrl-t
99
Vim: when searching for tags - how to show the list of tags matching the current search?
:ts
100
Vim: how to go to next tag in ctag search?
:tn
101
Vim: how to go to previous tag in ctag search?
:tp
102
Vim: how to go to first ag in ctag search?
:tf
103
Vim: how to go to the last tag in ctag search?
:tl
104
Vim: how to jump to exact position of mark x?
`x
105
Vim: how to list all open tabs?
:tabs
106
Vim: how to record macro at identifier "x"?
1. type qx 2. do the commands 3. end macro with "q"
107
Vim: how to play macro at identifier "x"?
@x
108
Vim: how to do command x times?
:x
109
Vim: how to move cursor to next lowercase mark?
]`
110
Vim: how to move cursor to previous lowercase mark?
[`
111
Vim: how to jump to position where last file has been edited?
`0
112
Vim: how to jump to previous file where it has been edited?
`1
113
Vim: how to jump to beginning of previously yanked text?
`[
114
Vim: how to jump to end of previously yanked text?
`]
115
Vim: how to jump to beginning of previous visual selection?
`
116
Vim: how to jump to end of previous visual selection?
`>
117
Vim: how to delete multiple/single marks?
:delmarks a Example for deleting multiple marks: :delmarks abc
118
Vim: within search results - how to jump to first match (skip if row 1 col 1)?
ggn
119
Vim: within search results - how to jump to real first match?
Gn
120
Vim: how to search forward for occurances of the word below cursor?
*
121
Vim: how to search backward for occurances of the word below cursor?
#
122
Vim: after search - how to replace the searched string with "replace"?
:%s//replace/g Note: After searching the empty search is a placeholder for the previous search string.
123
Vim: how to make vim search while typing?
:set incsearch
124
Vim: how to make vim ignore case when searching?
:set ignorecase
125
Vim: how to search for the third occurance of "pattern"?
3/pattern
126
Vim: when searching for pattern - how to make the cursor being positioned at the end of the occurance?
/pattern/e
127
Vim: how to search for the third occurance of the current word forward?
3*
128
Vim: how to serch for the third occurance of the current word backward?
3#
129
Vim: how to jump to line 50 without a "vim command" (that is the ":")?
50G
130
Vim: how to return to the line where the cursor was before the latest jump?
'' | single quotes
131
Vim: how to return to the cursor position before the latest jump?
``
132
Vim: how to split window vertical?
:vsp
133
Vim: how to split window horizontally?
:sp
134
Vim: how to move to split window below?
ctrl-j | set in .vimrc
135
Vim: how to move to split window above?
ctrl-k | set in .vimrc
136
Vim: how to remap keystrokes in .vimrc?
map C-J C-Wj | put C-J and C-W in crocodile brackets
137
Vim: how to move to splut window to the right?
ctrl-l
138
Vim: how to move to splut window to the left?
ctrl-h
139
Vim: how to jump to next occurance of character "x"?
fx
140
Vim: how to jump before next occurance of character "x"?
tx
141
Vim: how to show register contents?
:req
142
Vim: how to remove highlighting on search results?
:noh
143
Vim: after search - how to jump to the cursor position before search (you could also jump back without search)?
ctrl-o
144
Vim: how to jump forward to next cursor position (after jumping back)?
ctrl-i
145
Vim: how to execute an external command?
:!python ...
146
Vim: how to show content of folder of current file?
:!ls or :!dir
147
Vim: what is the command prefix to execute only on the visual selection
:'
148
Vim: how to save visual selection to file?
:'w FILENAME
149
Vim: how to insert output of external command below cursor?
:r !command
150
Vim: how to display help files?
:help
151
Vim: how to edit another file?
:e filename
152
Vim: how to save file with sudo privileges?
:w !sudo tee %
153
Bash & Vim: how to search for file and open the result in vim?
find . -name whatever.js | xargs vim
154
Vim: Which is the leader key?
\
155
Vim: How to open CtrlP to show and switch file?
(ctrl - p)
156
Vim: How to open the netrw file explorer?
157
Vim/netrw: How to open file in new tab?
3
158
Vim/netrw: How to open file in horizontal split?
1
159
Vim/netrw: How to open file in vertical split?
2
160
Vim/netrw: How to open file in previous window?
4
161
Vim: how to insert jsdoc for function (when cursor is over funtion)?
:JsDoc
162
Vim: how to search for occurance "xxx" in folder y?
:vimgrep /xxx/g y
163
Vim: how to expand visual selection to next region?
164
Vim: how to reduce visual selection to next region?
165
VIm: how to remove extra whitespaces?
:StripWhitespace
166
Vim: how to rescane CtrlP files?
:CtrlPClearCache
167
Vim: how to switch to next tab?
168
Vim: how to switch to previous tab?
169
Vim: how to git add?
a
170
Vim: how to git commit?
c
171
Vim: how to get git status?
s
172
Vim: how to get git log?
l
173
Vim: how to checkout file?
Ctrl + g + checkout
174
Vim: how to show diff?
Ctrl + g + diff
175
Vim: how to git pull?
Ctrl + g + pull
176
Vim: how to git push?
Ctrl + g + push
177
Vim: how to execute any git command?
Ctrl + g + git
178
Vim: how to git merge?
Ctrl + g + merge
179
Vim: how to finish git merge?
Ctrl + g + done
180
Vim: highlight all occurances of word under cursor?
*
181
Vim: Alternative for escape key?
Ctrl + [
182
Vim: how to search for tags (ctrlp)?
Ctrl + L
183
Vim: how to delete until line Z?
dZG