Learn VIM and don’t die in the attempt IV char jump

Jhonnata Gil Chaves
4 min readNov 8, 2022

--

All files are store in this repo

Jump for characters

Also we need to move into our file

cd medium-articles-vim/examples/dont_die_attempt_iv

Also opened the file using vim 4_file.txt

Before continue we can see the numbers

:set nu <Enter>

With these the terminal now show us the number for every line, made more easy the comprehension information about the current line

enabling the line number

Now the interface update with number in one part of our file, this numbers are the indexes for every line in the file.

show the numbers

No jump so fast for how to we can jump easily in our lines, lets go!!

Go to end and beginning

Now we can move more fast in the current line, using the $ and 0 with these results

Move to the line 4 first, for move into this line we can use

:4<Enter>
move to the 4th line

Now you see the current line contain a lot of words using a Lorem Impsum that’s a words collide that you can use to fill a huge text field

content in 4th line

Press the $ key, this key send the cursor in the last part of the line content

go to the end of the line

Also another part when we can check the current position is near to the corner of right bottom with a “coordinates” for current cursor position

Now we move to the beginning for the line using the 0key

go to the beginning of the line

So we continue with this sections related to how to we can move fast in vim

Find the occurrences

Now we discovered how to move between beginning to the end of the line, but how to we can move more specifically in the line, so in this part we discover how to move using a character.

In the same line :4 <Enter> we find the first t in the current line

ft
jump into the first t in the line

Now, we identify that we need to move to the 4th occurrence for t from the current position

4ft
jump 4t’s

But I forget that I stay one t ahead, so we need backwards one time

Ftm
backwards one t

We are used normally a number for the commands, but you think works for reverse?

Jump in brackets

One of a bigger part for our path is how to we can move into the brackets, if you try to use the f command doesn’t work, so we need to explore another way for that, for this part we explore the command <Shift>+5 for jump directly into the brackets. When we talk about brackets we covered this {[( and this )]}

We need to move to the line 8 :8 <Enter> we find the first bracket in the current line

<Shift>+5
jump to the bracket

If you repeat the option you start a loop between in open and closes brackets

loop between the brackets

Exit

For finish this little session for jump moves and jump between brackets, you can use a :q! for qquit, but what’s doing the ! admiration symbol, just in case that you modify the file this symbol save your life for involuntary modifications.

Exercise

Use the jump section for move into the next 2Tand do the loop in to the {} brackets also in the []too.

Download from this repo the files and execute this task:

<< Previous section

>> Next section

--

--

Jhonnata Gil Chaves

I’m a System Engineer and Software Developer. I love Linux and your philosophy it’s very nice share all knowledge that every day I learn around tech and make so