Skip to content

Instantly share code, notes, and snippets.

@auwsom
Last active June 6, 2022 04:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save auwsom/78c837fde60fe36159ee89e4e29ed6f1 to your computer and use it in GitHub Desktop.
Save auwsom/78c837fde60fe36159ee89e4e29ed6f1 to your computer and use it in GitHub Desktop.
vim basics
https://spin.atomicobject.com/2016/04/19/vim-commands-cheat-sheet/
http://i.imgur.com/YLInLlY.png
https://vim.rtorr.com/
:q, :wq, :q!, ZZ # quit, write quit, quit force, write quit
i, Esc, v # insert mode, exit mode, visual mode
dd, dw, x, u, U, ctrl+r # cut line, cut word, delete char, undo, undo line, redo (:redo)
yy, pp, Y, o # copy line, paste line, open line
a, A, # insert at end, or after end
H, M, L, gg, G, 1G, 0, $, ^, {, }, # move to: top, mid, bottom, start/end doc, line 1, start/end line, start non-empty line, paragraph
/, n, N # search, next, opposite
ciw # replace word
r, R # replace char, *replace mode*
f # find
. ; , # repeat command, movement, movement backwards
visual mode, v:
:s///g # search, replace global
:! bash % # run current file
comment shift+i
for commenting: :66,70s/^/#
for uncommenting: :66,70s/^#/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment