forked from amikula/vim_flashcards
-
Notifications
You must be signed in to change notification settings - Fork 0
/
all_cards.txt
239 lines (239 loc) · 21.5 KB
/
all_cards.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
Move cursor down one line j Basic
Move cursor up one line k Basic
Move cursor left one character h Basic
Move cursor right one character l Basic
Return to Normal mode <ESC><br /><span style="font-style:italic;">(escape)</span> Basic
Exit the editor, discarding any changes :q!<ENTER> Basic
Exit the editor, but abort if there are unsaved changes :q<ENTER> Basic
Delete the character under the cursor x Basic
Insert text before the cursor i Basic
Append text at the end of the current line A Basic
Save the current file and exit :wq<ENTER> Basic
Append text after the cursor a Basic
Invert case of current character ~ Beginner
Go down half a screen <C-D> Beginner
Go up half a screen <C-U> Beginner
Go forward a screen <C-F> Beginner
Go back a screen <C-B> Beginner
Go to end of text G Beginner
Go to previous word b Beginner
Go to next word w Beginner
Go to end of (next) word e<br />(goes to end of next word if already at end of word) Beginner
Go to end of previous word ge Beginner
Go to first non-whitespace character of current line ^ Beginner
Go to last character of current line $ Beginner
Go to line <span style="font-style:italic;">n</span> <span style="font-style:italic;">n</span>G <span style="font-style:italic;">n</span>gg Beginner
Go to first line of file 1G gg Beginner
Go to last line of file G Beginner
Insert at beginning of line (after whitespace) I Basic
Undo last command u Beginner
Restore last changed line U Beginner
Redo last undo <C-R> Beginner
Move cursor left to start of next space-separated word B Beginner
Move cursor right to start of next space-separated word W Beginner
Move cursor left to end of next space-separated word gE Beginner
Move cursor right to end of next space-separated word E Beginner
Move cursor to next occurrence of character <span style="font-style:italic;">c</span> f<span style="font-style:italic;">c</span> Beginner
Move cursor to previous occurrence of character <span style="font-style:italic;">c</span> F<span style="font-style:italic;">c</span> Beginner
Move cursor to character before next occurrence of <span style="font-style:italic;">c</span> t<span style="font-style:italic;">c</span> Beginner
Move cursor to character after previous occurrence of <span style="font-style:italic;">c</span> T<span style="font-style:italic;">c</span> Beginner
Delete a word dw Beginner
Delete to the end of the line d$ Beginner
Delete text indicated by motion <span style="font-style:italic;">m</span> d<span style="font-style:italic;">m</span><br /><span style="font-style:italic;">(example: d$ means delete to end of line)</span> Beginner
Delete <span style="font-style:italic;">n</span> words <span style="font-style:italic;">n</span>dw Beginner
Move to the start of the line (before whitespace) 0 Beginner
Delete a line dd Beginner
Undo the last command u<br /><span style="font-style:italic;">(may be used repeatedly to undo multiple commands)</span> Beginner
Redo the last undone command <C-R><br /><span style="font-style:italic;">(Control-R)</span> Beginner
Put previously deleted (or copied) text after the cursor p Beginner
Put previously deleted text before the cursor P Beginner
Replace the character under the cursor with character <span style="font-style:italic;">x</span> r<span style="font-style:italic;">x</span> Beginner
Change to the end of the current word ce Beginner
Change to the end of the current line c$ Beginner
See location in file and file status <C-G><br /><span style="font-style:italic;">(Control-G)</span> Beginner
Search for phrase /<span style="font-style:italic;">phrase</span><ENTER> Beginner
Substitute first occurrence of <span style="font-style:italic;">phrase1</span> with <span style="font-style:italic;">phrase2</span> on the current line :s/<span style="font-style:italic;">phrase1</span>/<span style="font-style:italic;">phrase2</span><ENTER> Beginner
Substitute all occurrences of <span style="font-style:italic;">phrase1</span> with <span style="font-style:italic;">phrase2</span> on the current line :s/<span style="font-style:italic;">phrase1</span>/<span style="font-style:italic;">phrase2</span>/g<ENTER><br /><span style="font-style:italic;">(The /g at the end means "global")</span> Beginner
Substitute all occurrences of <span style="font-style:italic;">phrase1</span> with <span style="font-style:italic;">phrase2</span> in the entire file :%s/<span style="font-style:italic;">phrase1</span>/<span style="font-style:italic;">phrase2</span>/g<br /><span style="font-style:italic;">(% means execute the command for the entire file)</span> Beginner
Execute external command <span style="font-style:italic;">cmd</span> :!<span style="font-style:italic;">cmd</span> Beginner
Save the current file to file named <span style="font-style:italic;">filename</span> :w <span style="font-style:italic;">filename</span> Beginner
Save the visually selected area to file named <span style="font-style:italic;">filename</span> :w <span style="font-style:italic;">filename</span><br /><span style=" font-style:italic;">(vim will automatically add '<,'> to the beginning of your command for the visually selected area)</span> Beginner
Open a new line below the cursor's line and enter Insert mode o Beginner
Open a new line above the cursor's line and enter Insert mode O <span style="font-style:italic;">(capital o)</span> Beginner
Enter Replace mode, to repeatedly replace the character under the cursor and advance R Beginner
Yank (copy) the selected text y Beginner
Yank (copy) the current line yy <span style="font-style:italic;">or</span> Y Beginner
Yank (copy) from cursor through motion <span style="font-style:italic;">m</span> y<span style="font-style:italic;">m</span> Beginner
Put (paste) copied text after the cursor p Beginner
Put (paste) copied text before the cursor P Beginner
Ignore case in searches :set ic <span style="font-style:italic;">(or :set ignorecase)</span> Beginner
Show partial matches while typing search phrase :set is <span style="font-style:italic;">(or :set incsearch)</span> Beginner
Highlight all matching phrases for the last search :set hls <span style="font-style:italic;">(or :set hlsearch)</span> Beginner
Get help on command <span style="font-style:italic;">cmd</span> :help <span style="font-style:italic;">cmd</span> Beginner
Jump to the next window <C-W><C-W> Beginner
Jump to the next window right, left, up, or down <C-W><C-<span style="font-style:italic;">K</span>> <span style="font-style:italic;">(where </span>K<span style="font-style:italic;"> is a cursor movement key h, j, k, l)</span> Beginner
Jump to last modified line '. Intermediate
Jump to exact spot in last modified line `. Intermediate
Retrace your movements in file (backward)<br /> <C-O> Intermediate
Retrace your movements in file (forward) <C-I> Intermediate
Forward find word under cursor * Intermediate
Forward find word under cursor (fuzzy) g* Intermediate
Backward find word under cursor (fuzzy) g# Intermediate
Backward find word under cursor # Intermediate
Open file name under cursor gf Intermediate
Swap next two characters around xp Intermediate
(Re)indent the text on the current line or on the area selected = Intermediate
Append the next <span style="font-style:italic;">n</span> lines to register 'a' "A<span style="font-style:italic;">n</span>yy Intermediate
Go to top of screen H Intermediate
Go to middle of screen M Intermediate
Go to bottom of screen L Intermediate
Mark this line <span style="font-style:italic;">x</span> m<span style="font-style:italic;">x</span> Intermediate
Go to exact position of mark in line marked <span style="font-style:italic;">x</span> `<span style="font-style:italic;">x</span> Intermediate
Go to percentage from top of file <span style="font-style:italic;">n</span>% Intermediate
Match of next brace, bracket, comment, #define % Intermediate
Go to line <span style="font-style:italic;">n</span> from top of window <span style="font-style:italic;">n</span>H Intermediate
Go to line <span style="font-style:italic;">n</span> from bottom of window <span style="font-style:italic;">n</span>L Intermediate
Insert at first column gI Intermediate
Go to line marked <span style="font-style:italic;">x</span> 'x Intermediate
Switch case for movement command <span style="font-style:italic;">m</span> g~<span style="font-style:italic;">m</span> Intermediate
Lowercase text between cursor and movement <span style="font-style:italic;">m</span> gu<span style="font-style:italic;">m</span> Intermediate
Uppercase text between cursor and movement command <span style="font-style:italic;">m</span> gU<span style="font-style:italic;">m</span> Intermediate
Delete range <span style="font-style:italic;">r</span> lines :<span style="font-style:italic;">r</span>d<Enter> Intermediate
Delete range <span style="font-style:italic;">r</span> lines into register <span style="font-style:italic;">x</span> :<span style="font-style:italic;">r</span>d<span style="font-style:italic;">x</span><Enter> Intermediate
Insert character represented by ASCII value <span style="font-style:italic;">n</span> (Insert mode) <C-V><span style="font-style:italic;">n</span> Intermediate
Insert previously inserted text (Insert mode) <C-A> Intermediate
Text completion before cursor (Insert mode) <C-N> Intermediate
Text completion after cursor (Insert mode) <C-P> Intermediate
Delete word before cursor (Insert mode) <C-W> Intermediate
Delete all inserted characters in current line <C-U> Intermediate
Show the content of all registers :reg<Enter> Intermediate
Show the content of register <span style="font-style:italic;">x</span> :reg <span style="font-style:italic;">x</span><Enter> Intermediate
Perform rot13 encoding on movement <span style="font-style:italic;">m</span> g?<span style="font-style:italic;">m</span> Intermediate
Filter lines of movement <span style="font-style:italic;">m</span> through command <span style="font-style:italic;">c</span> !<span style="font-style:italic;">mc</span> Intermediate
Filter <span style="font-style:italic;">n</span> lines through command <span style="font-style:italic;">c</span> <span style="font-style:italic;">n</span>!!<span style="font-style:italic;">c</span> Intermediate
Filter range <span style="font-style:italic;">r</span> lines through command <span style="font-style:italic;">c</span> :r!<span style="font-style:italic;">c</span> Intermediate
In visual mode, exchange cursor position with start/end of highlighting o Intermediate
Start highlighting block <C-V> Intermediate
Start highlighting with previous visual area gv Intermediate
Record typed commands to register <span style="font-style:italic;">x</span> q<span style="font-style:italic;">x</span> Intermediate
Append typed commands to register <span style="font-style:italic;">x</span> q<span style="font-style:italic;">X</span> Intermediate
Stop recording q Intermediate
Move cursor to leftmost position of screen on current line g0 Intermediate
Move cursor to first non-blank character of current line on screen g^ Intermediate
Move cursor to last character of current line on screen g$ Intermediate
Move cursor one screen line up gk Intermediate
Move cursor one screen line down gj Intermediate
Repeat last f/F/t/T movement ; Intermediate
Inverse of last f/F/t/T movement , <span style="font-style:italic;">(comma)</span> Intermediate
Set a mark in the current file m<span style="font-style:italic;">[a-z]</span> Intermediate
Set a mark that can be returned to from any file m<span style="font-style:italic;">[A-Z]</span><br />(capital letters) Intermediate
Jump to tag under cursor <C-]> Intermediate
Return from tag jump <C-T> Intermediate
Jump to tag on top of tag stack (or select if multiple matches) :tj Intermediate
Scroll one line up <C-E> Intermediate
Scroll one line down <C-Y> Intermediate
Scroll current line to top of window zt <span style="font-style:italic;">or</span> z<Enter> Intermediate
Scroll current line to center of window zz <span style="font-style:italic;">or</span> z. Intermediate
Scroll current line to bottom of window zb <span style="font-style:italic;">or</span> z- Intermediate
Scroll one character to the right zh Intermediate
Scroll one character to the left zl Intermediate
Scroll half a screen to the right zH Intermediate
Scroll half a screen to the left zL Intermediate
Write range <span style="font-style:italic;">r</span> to file <span style="font-style:italic;">f</span> :<span style="font-style:italic;">r</span>w <span style="font-style:italic;">f</span> Intermediate
Append range <span style="font-style:italic;">r</span> to file <span style="font-style:italic;">f</span> :<span style="font-style:italic;">r</span>w>><span style="font-style:italic;">f</span> Intermediate
Insert content of file <span style="font-style:italic;">f</span> below cursor :r <span style="font-style:italic;">f</span> Intermediate
Insert output of command <span style="font-style:italic;">c</span> below cursor :r! <span style="font-style:italic;">c</span> Intermediate
Repeat last substitution (:s) command & Intermediate
Go to next modified buffer :bm Intermediate
Open all buffers in new splits :ba <span style="font-style:italic;">or</span> :sba Intermediate
Open all buffers in new vertical splits :vert ba <span style="font-style:italic;">or</span> :vert sba Intermediate
The position of mark <span style="font-style:italic;">x</span> in an <span style="font-style:italic;">ex</span> range '<span style="font-style:italic;">x</span><br /><span style=" font-style:italic;">(example: :'x,'y delete)</span> Intermediate
In an <span style="font-style:italic;">ex</span> range, the next line where <span style="font-style:italic;">pat</span> matches /<span style="font-style:italic;">pat</span>/ Intermediate
In an <span style="font-style:italic;">ex</span> range, the previous line where <span style="font-style:italic;">pat</span> matches ?<span style="font-style:italic;">pat</span>? Intermediate
<span style="font-style:italic;">n</span> lines from the preceding line number in an <span style="font-style:italic;">ex</span> range +<span style="font-style:italic;">n</span> Intermediate
<span style="font-style:italic;">n</span> lines before the preceding line number, in an <span style="font-style:italic;">ex</span> range -<span style="font-style:italic;">n</span> Intermediate
Look up keyword under cursor with <span style="font-weight:600;">man</span> K Intermediate
Forward to start of next method ]m Intermediate
Backward to start of previous method [m Intermediate
Move to global definition of symbol under cursor gD Intermediate
Move to local definition of symbol under cursor gd Intermediate
Open a window for each file in the argument list :all Intermediate
Display the argument list :args Intermediate
List the leaves in the tree of (undoable) changes :undol[ist] Intermediate
Go to previous text state (may cross undo branches) g- Intermediate
Go to next text state (may cross undo branches) g+ Intermediate
Set up automatic wrapping when reaching right margin <span style="font-style:italic;">n</span> :wrapmargin <span style="font-style:italic;">n</span> Intermediate
Turn off automatic wrapping :wrapmargin 0 Intermediate
Turn on line numbers :set number Intermediate
Turn off line numbers :set nonumber Intermediate
List of your movements :ju(mps) Advanced
List of your recent commands :his[tory] Advanced
Lowercase line guu Advanced
Uppercase line gUU Advanced
Display hex, ascii value of character under cursor ga Advanced
Display hex value of utf-8 character under cursor g8 Advanced
Rot13 whole file ggg?G Advanced
Add <span style="font-style:italic;">n</span> to next number on same line as the cursor <span style="font-style:italic;">n</span><C-A> Advanced
In insert mode, insert value of expression (ie 5*5) into text <C-R>=<span style="font-style:italic;">expr</span> Advanced
Subtract <span style="font-style:italic;">n</span> (default 1) from next number on same line as cursor <span style="font-style:italic;">n</span><C-X> Advanced
Execute the macro recorded in register <span style="font-style:italic;">x</span> on all lines of the current file :%normal @<span style="font-style:italic;">x</span> Advanced
Execute the macro recorded in register <span style="font-style:italic;">x</span> on a visually selected set of lines :normal @<span style="font-style:italic;">x</span> Advanced
Show lines in file matching word under cursor [I (capital 'I') Advanced
Move cursor <span style="font-style:italic;">n</span> sentences forward <span style="font-style:italic;">n</span>) Advanced
Move cursor <span style="font-style:italic;">n</span> sentences backward <span style="font-style:italic;">n</span>( Advanced
Move cursor <span style="font-style:italic;">n</span> paragraphs forward <span style="font-style:italic;">n</span>} Advanced
Move cursor <span style="font-style:italic;">n</span> paragraphs backward <span style="font-style:italic;">n</span>{ Advanced
Paste below the current line, adjusting indentation to match current line ]p Advanced
Paste above the current line, adjusting indentation to match current line [p Advanced
Go to center of screen on current line gm Advanced
Column <span style="font-style:italic;">n</span> of current line <span style="font-style:italic;">n</span>| Advanced
Insert previously inserted text and return to command mode (Insert mode) <C-@> Advanced
Insert content of register <span style="font-style:italic;">x</span> (Insert mode) <C-R><span style="font-style:italic;">x</span> Advanced
Insert digraph (œ é ñ etc.) <C-K><span style="font-style:italic;">c1c2</span> Advanced
Put register after cursor position, leaving cursor after new text gp Advanced
Put register before cursor position, leaving cursor after new text gP Advanced
Format lines of movement <span style="font-style:italic;">m</span> as plain text gq<span style="font-style:italic;">m</span> Advanced
Center lines in range <span style="font-style:italic;">r</span> to width <span style="font-style:italic;">n</span> :<span style="font-style:italic;">r</span>ce <span style="font-style:italic;">n</span> Advanced
Left align lines in range <span style="font-style:italic;">r</span> with indent <span style="font-style:italic;">n</span> :<span style="font-style:italic;">r</span>le <span style="font-style:italic;">n</span> Advanced
Right align lines in range <span style="font-style:italic;">r</span> to width <span style="font-style:italic;">n</span> :<span style="font-style:italic;">r</span>ri <span style="font-style:italic;">n</span> Advanced
In visual mode, select a word aw Advanced
In visual mode, select a sentence as Advanced
In visual mode, select a paragraph ap Advanced
In visual mode, select a block delimited by ( ) ab Advanced
In visual mode, select a block delimited by { } aB Advanced
Move cursor down <span style="font-style:italic;">n</span>-1 lines to first non-blank character <span style="font-style:italic;">n</span>_ Advanced
Move backward to start of section [[ Advanced
Move forward to start of next section ]] Advanced
Move backward to previous section end [] Advanced
Move forward to next section end ][ Advanced
Move backward to previous unclosed ( [( Advanced
Move forward to next unclosed ) ]) Advanced
Move backward to previous unclosed { [{ Advanced
Move forward to next unclosed } ]} Advanced
List matching tags (and select) :ts Advanced
Split window and show tag under cursor <C-W>] Advanced
Preview tag under cursor <C-W>{ Advanced
Preview tag <span style="font-style:italic;">t</span> :pt <span style="font-style:italic;">t</span> Advanced
Close tag preview window <C-W>z <span style="font-style:italic;">or </span>:pc Advanced
Visual area expressed as an <span style="font-style:italic;">ex</span> range *<br /><span style="font-style:italic;">(Example: :* delete)</span> Advanced
Create a fold for motion <span style="font-style:italic;">m</span> in manual folding mode zf<span style="font-style:italic;">m</span> Advanced
Create a fold for the visually highlighted text in manual folding mode zf Advanced
Create a fold for <span style="font-style:italic;">n</span> lines in manual folding mode <span style="font-style:italic;">n</span>zF Advanced
Create a fold for the range of lines <span style="font-style:italic;">r</span> in manual folding mode :<span style="font-style:italic;">r</span>fo[ld] Advanced
Delete one folding level at the cursor in manual folding mode zd Advanced
Delete all folds recursively at the cursor in manual folding mode zD Advanced
Eliminate all folds in the window in manual folding mode zE Advanced
Open <span style="font-style:italic;">n</span> levels of folding at the cursor <span style="font-style:italic;">n</span>zo<br /><span style="font-style:italic;">(default 1 level when no count provided)</span> Advanced
Open all folds under the cursor (or visual selection) recursively zO Advanced
Close <span style="font-style:italic;">n</span> levels of folding under the cursor <span style="font-style:italic;">n</span>zc<br /><span style="font-style:italic;">(default 1 level when no count given)</span> Advanced
Close all folds under the cursor (or visual selection) recursively zC Advanced
Toggle <span style="font-style:italic;">n</span> levels of folding (close open folds; open closed folds) <span style="font-style:italic;">n</span>za Advanced
Toggle folding recursively (close open folds and open closed folds) zA Advanced
Open just enough folds to make the line in which the cursor is located not folded zv Advanced
Open all folds zR Advanced
Fold none: All folds will be open zn Advanced
Fold normal: All folds will be as they were before (opposite of fold none) zN Advanced
Move to start of current open fold [z Advanced
Move to end of current open fold ]z Advanced
Move down to start of next fold zj Advanced
Move up to end of previous fold zk Advanced