Move around like a Vi person

> vi

Moving around

For the first day in the series, we’re only going to cover the basic moving-around part, pretending you already have a paragraph below:

Code with syntax highlighting

Moving around quickly

If you think typing one key at a time is too slow, we could do the following to speed it up:

Moving around super quick

So show me how to move around super quick like a pro. Before I do that, one more thing, Vi is about the precision, if you really know the direction, you can get there very fast. But if you don’t, you can get lost very fast as well. So fasten your seat belt while playing with the new toys:

G  (shift+g)
go to the end of the file
gg
go to the start of the file
CTRL+f
page down
CTRL+b
page up
w
move a word to the right
b
move a word to the left
0
move to the start of the line
$
move to the end of the line
H
move to the start of the screen
L
move to the end of the screen
M
move to the middle of the screen

Summary

That’s it for today, glad you had some fun reading it. It’s not a lot, but can be a lot to some of us new to Vi. All in all it does change the way we do things, so please give yourself sometime to digest these, especially considering you don’t know exactly what benefits that can bring it to you in the future.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Fang Jin

Fang Jin

Front-end Engineer, book author of “Designing React Hooks the Right Way” sold at Amazon.