Skip to content

Instantly share code, notes, and snippets.

@chaitanyakommoju
Forked from denlukasdev/Vim_commands.txt
Created August 4, 2022 19:12
Show Gist options
  • Save chaitanyakommoju/89205e823327ef28136aa2b4591d149f to your computer and use it in GitHub Desktop.
Save chaitanyakommoju/89205e823327ef28136aa2b4591d149f to your computer and use it in GitHub Desktop.
Vim_commands
### Commands ###
[command] [number] [moiton]
:q! - exit
:wq - exit save changes
:set number / :set nonumber - lines numbering
:!command - executes an external command
:command - executes an internal command
u - undo
U - undo all changes for line
ctrl+r - revert undo
. - repeat last change
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
### Navigation ###
<h vj ^k l> - move cursore
0 (zero) - begin of the row
$ - end of the row
w - begin of the word
e - end of the word
ctrl+g - displays your location in the file and the file status.
gg - begin of the file
G - end of the file
[number]G or :[number] - moves to that line number
ctrl+u / ctrl+d - page up/down
ctrl+y / ctrl+e - scroll up/down
ctrl+i / ctrl+o - navigation by cursor locations
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
### Insert ###
i - inserting
a - inserting (cursor moves to right)
I - inserting at row's begin
A - inserting at row's end
o - inserting under row
O - inserting above row
cc - delete row and inserting
r - replace symbol under cursor
R - replacing mode
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
### Delete ###
x - delete under cursor or selected (like del)
X - delete left from cursor (like backspace)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
### Selection / Highlighting ###
v - selection mode
V - rows selection mode
ctrl+v - columns selection mode
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
### Cut ###
d - cut selected
dd - cut the row
d5d - cut 5 rows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
### Copy ###
y - copy selected
yy - copy the row
y5y - copy 5 rows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
### Paste ###
p - paste after cursor (row)
P - paste before cursor (row)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
### Search ###
/word - search after cursor
?word - search before cursor
n - go to next search result
N - go to previous search result
% - find pair bracket
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
### Edit ###
gu / gU - to lower/upper case
<< / >> - move row to left/right
5< / 5> - move 5 rows to left/right
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment