Docsity

Vim Text Editor Shortcuts and Commands, Assignments of Life Sciences

Toggle sidebar
bg1
Movement
h j k l Left, down, up, right
^ Go to the beginning of the line
$ Go to the end of the line
gg Go to the first line
G Go to the last line
:n Go to line n
Replacing Text
r Replace character
cw Change word
cc Change line
c{motion} Change from cursor to {motion}
Copy/Paste
y{motion} Yank {motion}
yy Yank line
p Paste after cursor
P Paste before cursor
Searching
/{pattern} Forward search for {pattern}
?{pattern} Reverse search for {pattern}
n Repeat the last search
N Repeat the last search in the opposite direction
Repeating Commands
{num}{command} Repeat command {num} times
. Repeat previous change
Inserting Text
i Insert at cursor
I Insert at the beginning of the line
a Append after cursor
A Append at the end of the line
o Open a new line below the current line
O Open a new line above the current line
Deleting Text
x Delete character
dd Delete line
dw Delete word
d{motion} Delete {motion}
Undo/Redo
u Undo
Ctrl-r Redo
Save and Quit
:w Write (save)
:wq Write and quit
:q Quit
:q ! Force quit, don’t save changes
:wq! Force write and quit
Help
:help [topic/command] Get help on topic or command.
vimtutor Tutorial
Find and Replace
:s/{old}/{new}/{options} Substitute {new} for {old} on the current line
:%s/{old}/{new}/{options} Substitute {new} for {old} in the entire document
The g option substitutes all occurrences on a line, otherwise just the first occurrence is changed per line.
http://www.LinuxTrainingAcademy.com

Partial preview of the text

Download Vim Text Editor Shortcuts and Commands and more Assignments Life Sciences in PDF only on Docsity!

Movement h j k l Left, down, up, right ^ Go to the beginning of the line $ Go to the end of the line gg Go to the first line G Go to the last line :n Go to line n Replacing Text r Replace character cw Change word cc Change line c{motion} Change from cursor to {motion} Copy/Paste y{motion} Yank {motion} yy Yank line p Paste after cursor P Paste before cursor Searching /{pattern} Forward search for {pattern} ?{pattern} Reverse search for {pattern} n Repeat the last search N Repeat the last search in the opposite direction Repeating Commands {num}{command} Repeat command {num} times

. Repeat previous change Inserting Text i Insert at cursor I Insert at the beginning of the line a Append after cursor A Append at the end of the line o Open a new line below the current line O Open a new line above the current line Deleting Text x Delete character dd Delete line dw Delete word d{motion} Delete {motion} Undo/Redo u Undo Ctrl-r Redo Save and Quit :w Write (save) :wq Write and quit :q Quit :q! Force quit, don’t save changes :wq! Force write and quit Help :help [topic/command] Get help on topic or command. vimtutor Tutorial Find and Replace :s/{old}/{new}/{options} Substitute {new} for {old} on the current line :%s/{old}/{new}/{options} Substitute {new} for {old} in the entire document The g option substitutes all occurrences on a line, otherwise just the first occurrence is changed per line. http://www.LinuxTrainingAcademy.com