If you find these tutorials useful, Please consider making a donation.

TheFrugalComputerLinuxLogo.png
TheFrugalComputerGuy.png
Vim-Pic
Vim 2
Vim Basics





Video 3 - Help and Moving Around a File

In this video, we introduce the help features, Vimtutor and :help

We then take a look at why we use hjk and l to move around the screen and how to remember which one is up and which one is down.

It is then shown that you can type a number before hjk and l to move that in that direction that number of times – going to the top or the bottom of the file using a number larger than the number of lines in the file, then k to go to the top or j to go to the bottom.

We see how to turn line numbering on and off with :set nu and :set nonu

A quick way to get to the bottom of the file is G and to get to the top use gg

1% is another way to get to the top of the file and 100% will take you to the bottom and any integer in between will take you that percentage into the file.

r will replace a single character

~ will toggle upper/lower case

Everything shown in this video is in normal mode







Video 4 - Yank and Put, Relative Numbers

In this video, we introduce the help features, Vimtutor and :help

We then take a look at why we use hjk and l to move around the screen and how to remember which one is up and which one is down.

It is then shown that you can type a number before hjk and l to move that in that direction that number of times – going to the top or the bottom of the file using a number larger than the number of lines in the file, then k to go to the top or j to go to the bottom.

We see how to turn line numbering on and off with :set nu and :set nonu

A quick way to get to the bottom of the file is G and to get to the top use gg

1% is another way to get to the top of the file and 100% will take you to the bottom and any integer in between will take you that percentage into the file.

r will replace a single character

~ will toggle upper/lower case

Everything shown in this video is in normal mode







Video 5 - D and Words

Things we look at in this video are:

2D - (from the beginning of the line) cuts text
P - paste the 2 lines deleted
2D - (from the middle of the line) Deletes from the cursor to the end of the line
P - Pastes the text deleted (cut)

2Y - Yanks (copies) the entire 2 lines starting from the line the cursor is on
2D - Delete (cuts) the text from where the cursor is at on that line and the entire next line.

u - undo
D - Deletes (cuts) text from the cursor to the end of the line
i - Puts us into insert mode
escape - puts us back into normal mode
C - Change text (from cursor to the end of the line (and go into insert mode)
A - Append - jump to the end of the line and go into insert mode
i - insert mode (starting before character you are on)
a - insert mode (starting after the character you are on) append after character
gg- go to top of file

dw - delete a word
d2w - delete 2 words
u - undo
dw - delete from cursor to the end of the word (and the space following that word)
w - go to the next word
2w - go over 2 words
b - go back 1 word
2b - go back 2 words
e - jump to the end of the word
2e - jump to the end of the 2nd word
ge - go to the end of the previous word
2g3 - go to the end of the word 2 words back

w - jump to the end of the word
W - jump to the end of the next word, after next whitespace characters (space, end of line)
b - jump to next word
B - jump back one word, before previous white-space character (space, end of line)







Video 6 - Indent and Repeat

We look at the pattern vim uses for its commands and we find out it is [number] verb [number] .

We look at a few examples of how to do things with a single line command like 2d3l (delete 2 times 3 characters). The different examples are to demonstrate the pattern Vim uses for most commands.

We then see that > is for indent, but we can't just press the > key by itself. >> is indent the current line, >2j is indent the current line and the next 2 lines. And 2>2j does not follow the standard Vim pattern.

We can repeat the indent 2 times by pressing . after indent, and then we see that . will repeat any single line command, and that is why the single line command is so important to understand.