Skip to content

Instantly share code, notes, and snippets.

@thomas861205
Last active May 15, 2020 09:47
Show Gist options
  • Save thomas861205/9b38d752839dc2b6e4df8db0ecc6d5cb to your computer and use it in GitHub Desktop.
Save thomas861205/9b38d752839dc2b6e4df8db0ecc6d5cb to your computer and use it in GitHub Desktop.
vim notes
Simple vim tutorial
-------------------
o: insert new line below
O: insert new line above
set rnu: set relative line number
ndd: delete n lines
0: head of the line
$: end of the line
(Good with relative line number)
nj: move down n lines
nk: move up n lines
ctrl+f: scroll down one page
ctrl+b: scroll up one page
w: next word
b: previous word
H, M, L: move to Head, Middle, Lowest of the screen
:$ : move to the end of file
f*: jump ON the first found * to the right of the cursor of the line
F*: left
t*: to the right
T*:
daw: delete a word under the cursor
caw: delete a word under the cursor and switch INSERT MODE
d$: delete from cursor to the end of the line
u: undo
ctrl+r: redo
:find <filename> : go to the file
:ls : show current opened files
:b <substring of currently opened file>: switch to that file
:ls <id of the buffer> ctrl+6 : switch buffer
ctrl+6: switch buffer
:b <id of the buffer>: switch buffer
:bd : close buffer
/word: find word, use * and # to jump to other matched words
v1a): visual mode, 1 level of paren, "a block"
ctrl+N : autocomplete (use ctrl+N, ctrl+P to scroll)
shift+. : add tab at front of the line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment