Keys Flashcards
h, j, k, l, gj
h Left, j down, k Up, l right. gj Down, down line by line even if its wrapped
y, p
Yank copy, Print paste
/
Search
f character, optional ;, F
Go to next character. ; Go to next occurance. F Go to previous character
w W. b B, e
Go to next word. BigW is WORD-_78 which is 1 word. Go to previous word. e Go to end of next word
t character, T
Go to before the chatacter. T backwards go previous character after it
0 ^ $
0 moves to first character of line. ^ first non blank character of line. $ goes to end of line
{, ctrl D. } ctrl U
{ down paragraph, ctrl D half page down.
/ pattern enter. ? pattern enter
Search forward. ? To search backwards. n next match or N previous match. Space .* Means selects all?
gd gf
Go to definition of whatever under Ur cursor. gf go to file in an import
gg. Line gg. G. %
Go to top of file. Line gg go to that line number. G end of file. % jump to matching bracket
d2w, dd. D. dt; d/cu
Delete 2 words. dd delete line. D delete after cursor. dt; delete until ;. At cursor delete to search cu enter.
u. ctrl r
Undo, redo
ggdG
Delete whole document
d f c t.
Delete, find, change, unTil. ffct’ find f, change until ‘.
c, cc, C; ci” cw ciw, ca(
cw Change: delete current word and goes into insert mode start typing. cc complete line. C cursor afterwards. ci” change inner- changes everything inside “”, cursor can be anywhere inside “”. ciw change word anywhere inside that word whereas cw cuts at cursor. ca( delete inside including (. ci( just deletes inner, not around.
.
repeat the command
text object a, i, w, s, p, “
a around, i inner, w word, s sentence, p paragraph, “ quotes. operator a i textObject
y, p, g~, gu, gU, >,
y yank copy, p put paste, g~ switch case (lower to upper case), gu make lowercase, gU make uppercase. > shift right adds indentation. < shift left removes indentation. = format code. copy line, then p to paste it
x, X, s, r, ~
x dl deletes character under cursor. X dh deletes character before cursor. s ch deletes character under cursor and puts into insert mode. r allows you to replace 1 single character for another. ~ switch case for single character
d4j, 5dd, dap
deletes 5 lines. delete all paragraph.
i I a A
i insert before cursor. I insert at beginning of line. a append after cursor. A append at end of line
o, O
open a new line below current line, O open new line above current line.
gi, ge
go back to last place where you made a change. reverse of e
i mode: ctrl h, ctrl w, ctrl u
ctrl h remove last character you typed. ctrl w remove last word. ctrl u remove last line (undo this line).
v V C-V
v character wise visual mode. V line wise visual mode. C-V for block-wise visual mode
yypci”
copy entire line, paste below, change all text inside “ “ and start typing. fh enter cw - find h, clear word and start typing.
/redap?coP
go to re, delete all paragraph, reverse go to co, paste all above.
yiw go to new word viwp
yank inner word (copy word). Go to new word past over word.