Vim Flashcards
Vim: how to move cursor 1 char left?
h
Vim: how to move cursor 1 char right?
l
Vim: how to move cursor 1 char up?
k
Vim: how to move cursor 1 char down?
j
Vim: how to move cursor to the beginning of the line?
0
Vim: how to move cursor to the end of the line?
$
Vim: how to move cursor to the first non-empty character of the line?
Vim: how to move cursor forward one word (next alphanumeric word)?
w
Vim: how to move cursor forward one word delimited by a whitespace?
W
Vim: how to move cursor forward five words delimited by whitespace?
5W
Vim: how to move cursor backwards one word (previous alphanumeric word)?
b
Vim: how to move cursor backward one word (delimited by whitespace)?
B
Vim: how to move cursor to end of file?
G
Vim: how to move cursor to beginning of file?
gg
Vim: how to move cursor to the previous sentence?
(
Vim: how to move cursor to the next sentence?
)
Vim: how to move cursor to the previous paragraph?
{
Vim: how to move cursor to the next paragraph?
}
Vim: how to move cursor to the previous section?
[[
Vim: how to move cursor to the next section?
]]
Vim: how to move cursor to the end of the previous section?
[]
Vim: how to move cursor to the end of the next section?
][
Vim: how insert text after the cursor?
a
Vim: how to insert text at the end of line?
A
Vim: how to insert text before the cursor?
i
Vim: how to begin a new line above the current line?
O
Vim: how to begin a new line below the current line?
o
Vim: how to insert the content of the file below the cursor?
:r
Vim: how to execute command and insert output below the cursor?
:r !
Vim: how to delete character at cursor and add it to clipboard?
x
Vim: how to delete from cursor to end of word?
dw
Vim: how to delete from cursor to beginning of the line?
d0
Vim: how to delete from cursor to end of line?
d$
Vim: how to delete from cursor to end of sentence?
d)
Vim: how to delete from cursor to beginning of file?
dgg
Vim: how to delete from cursor to end of file?
dG
Vim: how to delete current line?
dd
Vim: how to delete 3 lines starting from current?
3dd
Vim: how to replace character under cursor with ?
r{}
Vim: how to replace characters instead of inserting them?
R
Vim: how to copy current line into storage buffer?
yy
Vim: how to copy current lines into register x?
'’xyy
double quotes
Vim: how to paste current storage buffer after current line?
p
Vim: how to paste current storage buffer before current line?
P
Vim: how to paste from register x after current line?
“xp
double quotes
Vim: how to undo last operation?
u
Vim: how to redo last undo?
ctrl-r
Vim: how to search for “text” forwards?
/text
Vim: how to search for “text” backwards?
?text
Vim: how to move to next instance of search result?
n
Vim: how to move to previous instance of search result?
N
Vim: how to search for “text” and replace first occurance with “hello”?
:%s/text/hello
Vim: how to search for “text” and replace all occurances with “hello”?
:%s/text/hello/g
Vim: how to search for “text” and ask before replacing occurances with “hello”?
:%s/text/hello/gc
Vim: how to set bookmark “x” to current cursor position?
mb
Vim: how to list all bookmarks?
:marks
Vim: how to jump to beginning of line of bookmark at “x”?
‘x
Vim: how to enter visual mode per character?
v
Vim: how to enter visual mode per line?
V
Vim: how to switch case of current visual selection?
~
Vim: how to delete selected text?
d
Vim: how to delete selected text and start insert?
c
Vim: how to copy selected text into clipboard (yank)?
y
Vim: how to indent text to the right (shift right)?
>
Vim: how to indent text to the left (shift left)?
Vim: how to filter through an external command?
!
Vim: how to copy current selection into register x?
“xy
double quotes
Vim: how to open file under current cursor?
gf
Vim: which arguments makes vim write files with encryption (will prompt for key)?
-x
Vim: which argument makes vim start without plugins?
–noplugin
Vim: how to start vim in diff mode (argument)?
-d
Vim: how to scroll down one half of the screen?
ctrl-d
Vim: how to scroll up one half of the screen?
ctrl-u