Basics of Vi Flashcards
How to use the VI editor
How can you open vi editor?
just type vi
How can you see a file with vi in read-only mode?
with “view” command
What are the modes in the VI Editor
Command, Insert, Line mode
What are the keys for moving top, down, left, right in vi?
k -> Up
j -> Down
h -> Left
l -> Right
What’s the use of w and b keys in vi?
w moves one word to the right, b moves one word to the left
How to go to the beginning of a line in vi?
With ^
How to go the end of a line in vi
$
How to start Insert mode in vi?
There are multiples ways: i -> Insert at the cursor position I -> Insert at the beginning of the line a -> Append after the cursor position A -> Append at the end of the line
How to enter Line mode in vi
Use the colon character :
How to exit Vi?
:q
How to exit without saving changes in vi?
:q!
How to exit saving the changes in vi?
:wq!, even better a shorcut is :x
How to save a file in vi?
:w, this one forces the action :w!
How to delete a character in vi?
x
How to delete a word in vi?
dw