You can save a lot of time by using appropriate movement commands in vi or vim text editor. For large file the cursor keys are not the best choice. To move to end of file just type G (press ESC and type capital G):
Sample outputs (jumping from 1st line to line # 82):
You can jump back to beginning of file by typing any one of the following command
You can jump to line number 700 (press ESC type 700G)
Move cursor to end of file in vim
In short press the Esc key and then press Shift + G to move cursor to end of file in vi or vim text editor under Linux and Unix-like systems. However, you can use the following keyboard shortcuts too.
- Esc + Ctrl + End – Jump end of file
- Hit Esc + Ctrl + Home : Jump start of file
- Press Esc + gg : Go to top the file
- Esc + G : Go to bottom of the file
- Esc + G + A : Go to bottom of the file and in append text mode. In other words, jump to last line and start writing code/text.
- Hit Esc + A + $ : Go to bottom of the file and end of line.
In this quick tutorial you learned how to move to last character of the file or jump to end of file. We also explained how to jump to start of file when using vim text editor including various keyboard shortcuts cominbations.