Skip to content

Instantly share code, notes, and snippets.

@nik-don
Last active July 4, 2022 15:03
Show Gist options
  • Save nik-don/6085b9a7bc9023600b6d41419c8edf98 to your computer and use it in GitHub Desktop.
Save nik-don/6085b9a7bc9023600b6d41419c8edf98 to your computer and use it in GitHub Desktop.
My VIM Cheat Sheet (Basic operations)

vimtutor > good starting place

commands are case sensitive!

i insert mode
esc to go normal mode

These are super useful but not intuitive at first

u to undo last change
A (Shift A) move cursor to end of line dd > delete line where the cursor is

To select Multiple lines

Ctrl + v enter visual block mode

If you want to add something at the first char of multiple lines after entering the visual block

Shift + i Type What you want ESC

Other:

:Explore open Directory
:q quit
:q! force quit (overide without saving)
:w save text
Hold Shift z z Write current file, if modified, and quit (same as ":x").
(https://vi.stackexchange.com/questions/5723/what-are-the-differences-between-wqcr-xcr-and-zz-when-exiting-vim/5726#5726)

I would say the above are basics.. (in my case) and here are the advanced commands. #startingtoenjoyvim

cursor jump
gg jump to the first line of the document
G jump to the end
g_ jump to the last non-blank character of the line
Ctrl + ] jump to the tag under cursor
o append (open) a new line BELOW the current line
O (Shift O) append (open) a new line ABOVE the current line
ea insert (append) at the end of the word
delete
X (Shift X) backspace equivalent
combos
f( AND ci( change inside brackets (delete all of the text inside the brackets and put you into insert mode )
paste
"+p paste from the system clipboard register
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment