vi / vim Editor: Jump to the end of the file and back to top

Unix operating system users mostly spend their time with vi/vim editors where we might to deal with large configuration file / code file. In this situation to reach the end and top you can save lot of time by using appropriate movement commands in vi and vim editors. It will really help you a lot.

To display and hide the line numbers enter the following command:

set number 
set nonumber

To move to the end of the file enter the following command (Press ESC and type capital ‘G’):

G

To jump back to the beginning of the file enter the following command (Press ESC and type simple ‘gg’):

gg

Or

1G

To reach 200th line enter the following command (Press ESC and type):

200G
image
Figure 1 - vi/vim command demo