fir3net

VI shortcuts

General Shortcuts

dd
delete a line
x
delete a character
a
append after cursor
A
append after line

Useful for script editing

:![command]
allows you to run a command while still in VI
:!!
repeats previous command
:! [command] %
allows you to run a command, with % = current file name

Motion

h
Move left
j
Move down
k
Move up
l
Move right

Modes

i
insert mode
esc
return the editor to command mode

Quitting

:q!
Exit and ignore changes
:wq! Exit and save changes

 For a full guide on VI please click here

About the Author

RDonato

R Donato

Ricky Donato is the Founder and Chief Editor of Fir3net.com. He currently works as a Network Security engineer and has a keen interest in automation and the cloud.

You can find Ricky on Twitter @f3lix001