Skip to content

Instantly share code, notes, and snippets.

@chaitanyakommoju
Forked from kidchenko/vim_commands.txt
Created August 4, 2022 19:12
Show Gist options
  • Save chaitanyakommoju/1215aca57c8fa636d39b9bc254dbc1d9 to your computer and use it in GitHub Desktop.
Save chaitanyakommoju/1215aca57c8fa636d39b9bc254dbc1d9 to your computer and use it in GitHub Desktop.
Vim commands
--------------------
Exit Commands
--------------------
:q Quit (a warning is printed if a modified file has not been saved)
:q! Quit (no warning)
:wq Write file to disk and quit the editor (a warning is printed if a modified other files)
:wq! Write file to disk and quit the edit (no warning)
ZZ Save workspace and quit the editor (same as :wq)
--------------------
Moving in the file
--------------------
#CURSOR
h left
k up
j down
l right
#WORD
e end of the word
w next word
b begin of the word
#LINE
0 begin of the line
$ end of the line
:59 move cursor to line 59. Replace 59 by the desired line number.
20| move cursor to column 20.
#FILE
G move the cursor to the end of the file
gg move the cursor to the begining of the file
#SCREEN
L move the cursor to the bottom of the screen
% Move to matching parenthesis
[[ Jump to function start
[{ Jump to block start
Ctrl-b page up
Ctrl-f page down
Ctrl-u 1/2 page up
Ctrl-d 1/2 page down
{ } moves to empty line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment