When reading a long file by vi editor, it would be very nice to get back to the beginning of the file by some short cuts when you really need to do so. Even ctrl+B sometimes is too slow. Does anyone know such a tool?
Short answer: When in vi/vim command mode, use the "$" character to move to the end of the current line.
After opening a file using vi
1) You can press Shift + g to go the end of the file
and
2) Press g twice to go to the beginning of the file
NOTE : - g is case-sensitive (Thanks to @Ben for pointing it out)
using :<line number>
you can navigate to any line, thus :1
takes you to the first line.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With