Last active
June 6, 2022 04:40
-
-
Save auwsom/78c837fde60fe36159ee89e4e29ed6f1 to your computer and use it in GitHub Desktop.
vim basics
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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