- VIM
vimtutor
a # Append text after the cursor
A # End of line in insert mode
i # Insert mode
o # Creates a new line below the cursor and place you in Insert mode
O # Creates a new line above the cursor and place you in Insert mode
R # Insert mode (like Insert key)
:q! # Exit without saving
:wq # Save and exit
:w filename # Save as
j # Down
k # Up
h # Left
l # Right
w # Beginning of the word
e # End of the word
0 # Beginning of the line
$ # End of the line
Ctrl + g # Show where you are in the file
number + G # Go to line
% # Find closing brackets
Ctrl + o # Takes you back to older positions
Ctrl + i # Takes you back to newer positions
Ctrl + e # Move down
Ctrl + y # Move up
# File
gg # Top of the file
Shift + g # Bottom of the file
# Screen
H # Top of the screen
M # Middle of the screen
L # Bottom of the screen
zz # Center the file in the middle of the screen
zt # Put your the file in the top of the screen
zb # Put your the file in the bottom of the screen (not very useful)
Ctrl + e # Move the screen down, the cursor stays still
Ctrl + y # Move the screen up, the cursor stays still
Ctrl + d # Move half of the screen down, cursor stay in the same height
Ctrl + u # Move half of the screen up, cursor stay in the same height
0 # Beginning of the line
$ # End of the line
^ # First non blank character
g_ # End of the line non blank character
% # Matches the open and closing (), [], ...
* # Search for the word that I am current on
f + character # Search in the line
; # Move forward
, # Move backwards
mm # Create a marker with the letter m
`m # Go to marker m
'm # Go to marker m, beginning of the line
v # Visual model
y / # Copy selected text
p # Paste selected text
yw # Copy single word
x # Delete single character
dw # Delete word
d$ # Delete right until the end
d2w # Delete 2 words
diW # Delete big word (entire block of word)
dt + symbol # Delete everything between not including the symbol
df + symbol # Delete everything between including the symbol
p # Paste below
r # Replace character
ce # Replace until the end of the word (e)
c$ # Replace until the end of the line ($)
:s/old/new/g # Substitute globally
:%s/old/new/g # Substitute globally in the line
:%s/old/new/gc # Substitute globally in the line and prompt y/n
:#,#s/old/new/g # Substitute first # line, second # number of lines
u # Undo
U # Undo entire line
Ctrl + r # Redo
/ # Search forward
# Option ---------------------------------------
:set ic # Search word, ignore case sensitive
:set noic # Disable case sensitive
:set hls # Activate highlight
:set nohlsearch # Deactivate highlight
/ign:ore\c # Ignore case for just one search
# Option ---------------------------------------
? # Search backwards
option n # Next
option N # Previous
:! # External commands
q # Stop recording
v # --Visual-- mode
# Select your text (using h, j, k, l)
# :w to save (:'<,'>w)
:r path/file # Will copy the content of the file as paste under your cursor
:r !ls Desktop # Will paste all the filenames under your cursor
Ctrl+w # Switch window focus
:help
:help w
:help c_CTRL-D
:help insert-index
:help user-manual
-
Search character in line
f + letter # Move forward including the letter ; # Move forward , # Move backward t + letter # Move forward not including the letter ; # Move forward , # Move backward F # Search backwards including the letter T # Search backwards not including the letter
cas # Change the whole block of sentence
cw # Change the word from cursor til the end
ciw # Change the current word
cit # Change inner content of a tag
ci" # Change the inside word of ""
cip # Change the inner p tag
c#j # Change from current line + number
c/word + enter # Change word that is not accessible easily
-
cs"' # Change surround " to ' ysiw" # Add surround "
yiw # Copy Word
-
vim-scripts/ReplaceWithRegister
griw # Go replace inner word
-
cp # Copy selection cpiw # Copy word into system clipboard cpi' # Copy inside single quotes to system clipboard cvi' # Paste inside single quotes from system clipboard
-
gcc # Comment line gcap # Comment a paragraph