In this article you will get to know many ways to go to the end of any file opened using Vim (Vi Improved) which is a open source text editor. You will get to know what vim is and many shortcuts and key combinations in the entire article to navigate to the end of the file and after that, you can decide which is best suitable for you and which will make your workflow fast.
What is Vim?
Vim which stands for Vi Improved is an open source text editor developed by Bram Moolenaar. It is the improved version of the Vi editor which was developed by Bill Joy and thus got its name Vi Improved (Vim). It comes default installed by mostly with every UNIX system. Vim is a highly efficient and fast editor with a very small size, which current version is just 7kb in size and is suitable for complex editing tasks. It supports many programming languages. It is also highly customizable as you can add extra features to it by using many plugins and extensions.
How to Go to the End of File in Vim Editor?
The End of File can be interpreted in 2 ways -
Note: Please check that you are in normal mode , if not the first press 'Esc' key to be in normal mode to run commands
1. Last Line with Cursor at the Beginning
Cursor at start of file's end• Shift + g ➨ If you are in normal mode then press 'Shift + g' , or if you are in Insert mode then press 'Esc + Shift + g'. The 'Esc' key exits you from the insert mode and shift is used to capitalize the letter 'g'.
Shift + g
• G (with Caps Lock on) ➨ If you have your Caps Lock ON, then simply press the 'G' key or if in insert mode then exit by pressing 'Esc' then press G key - 'Esc + G'
Caps Lock ON + G
• :$ ➨ First press Esc to ensure be in normal mode the type ':$' and then hit enter.
:$ + Enter
:$ + Enter
• ]] (Double Square Brackets) ➨ First ensure to be in normal mode the press ']]' (square brackets twice).
]]
2. Last Line with Cursor at the End
Cursor at end of file's end line• Shift + (g + $) ➨ Hold the 'Shift' key and then press 'g' and then '$' . 'Shift + g' will move you to the last line as you have seen in above cases , and the 'Shift + $' will move your cursor to the end of the line.
SHIFT + g + $
• G + Shift + $ (with Caps Lock on) ➨ If your Caps Lock is on the only press 'G' and then press 'Shift' and '$' .
Caps Lock ON + G + SHIFT +$
• Ctrl + End (if supported) ➨ Press 'Control' and 'End' key at the same time, if your keyboard have Ctrl key.
Ctrl + End
• Shift + (g + a) ➨ Hold the 'Shift' key and then press 'g' and then 'a' . 'Shift + g' will move you to the last line as you have seen in above cases , and the ' Shift + a' will move your cursor to the end of the line with enabling the insert mode. Normally 'Shift + a' is used to go in insert mode with moving to the end of the line.
SHIFT + g + a
• G + A (with Caps Lock on) ➨ If your Caps Lock is on the only press 'G' and 'A' .
Caps Lock + G + A
• } (Curly Bracket) ➨ You have to press the Curly Bracket ' } ', to use curly bracket you have to press the 'Shift + ]' ( the key that have both } and ] icon)
}
Vim Go to End of File -FAQs
What is Vim?
Vim stands for Vi Improved is a open source text editor developed by Bram Moolenaar which is the improved version of Vi editor. It is very famous editor, mainly comes installed by default in UNIX systems.
Is Vim available for using on CLI only ?
No, Vim also have a Graphical User Interface know as gvim. You can download it from the Vim's Official site : https://www.vim.org/download.php
Is there any specific shortcut/command which are most used by developers?
Yes, the Shift + G and : + $ are most widely used by the developers all around the world for navigate to the end of the file.
What are some alternatives to vim ?
Some famous alternatives to vim are VS Code, Sublime, Emacs, nano, Atom etc.
Is Vim difficult to learn?
We can say that Vim has a large learning curve due to its vast and unique features and set of unique commands. So yes, it is difficult than other editors and will take time and practice to be proficient in using it.
Conclusion
Now you know many ways and key combinations to reach to the end of your file in Vim editor. You need to choose one for navigating the vim file in order to be productive and for fast working. And remember to be in normal mode always to use keys combinations and shortcuts.
Similar Reads
Vim - Go to End of File
In this article you will get to know many ways to go to the end of any file opened using Vim (Vi Improved) which is a open source text editor. You will get to know what vim is and many shortcuts and key combinations in the entire article to navigate to the end of the file and after that, you can dec
5 min read
The Six Modes of Vim Editor
Vim, short for "Vi Improved," is a highly efficient and powerful text editor that is favored by many developers and system administrators. One of Vim's distinguishing features is its unique approach to editing, which involves six distinct modes. Understanding these modes is crucial for mastering Vim
6 min read
Perl | eof - End of File Function
The eof() function is used to check if the End Of File (EOF) is reached. It returns 1 if EOF is reached or if the FileHandle is not open and undef in all other cases. Syntax: eof(FileHandle) Parameter: FileHandle: used to open the file Returns: 1 if EOF is reached Cases: eof(FileHandle) : Passing Fi
2 min read
How to Create a VIM File in Linux CMD
In Linux, there are many ways to open and create files, but Vim stands out as a powerful and versatile text editor. It comes pre-installed on most Linux systems and allows you to create, edit, and manage files directly from the terminal. In this article, we will explain you, how to create a new file
3 min read
How to Create a VIM File in Linux CMD
In Linux, there are many ways to open and create files, but Vim stands out as a powerful and versatile text editor. It comes pre-installed on most Linux systems and allows you to create, edit, and manage files directly from the terminal. In this article, we will explain you, how to create a new file
3 min read
How to Move End of the Line in Nano?
Moving the cursor to the end of the line in the Nano text editor is a basic yet essential skill for efficient text editing. Whether you're writing code, composing documents, or working with text files, the ability to quickly navigate and position the cursor at the desired location can significantly
3 min read
How to Append Text to End of File in Linux?
On Linux, while working with files in a terminal sometimes we need to append the same data of a command output or file content. Append means simply add the data to the file without erasing existing data. Today we are going to see how can we append the text in the file on the terminal. Using >>
2 min read
Is vi editor free?
Yes ! vi is a free and open-source text editor. Vi editor was developed in 1976 by Bill Joy, vi editor is a widely used text editor in Unix/Linux systems and is known for its efficiency and flexibility. An improved version of Vi editor was released later in 1991, popularly known as VI IMproved (VIM)
5 min read
Perl | Appending to a File
When a file is opened in write mode using “>”, the content of the existing file is deleted and content added using the print statement is written to the file. In this mode, the writing point will be set to the end of the file. So old content of file remains intact and anything that is written to
2 min read
How to Save a File in Vi / Vim Editor & Quit
In this article, we will cover how to save a file in vi editor. First, we look at Linux and Vi editors why we use them, and what their are features then we deep dive into the topic of saving a file and quitting the editor along with the other options, we understand the different commands with an exa
5 min read
Undo and Redo in Vi editor
Vi is a versatile text editor that's available for Unix and Linux systems. It's packed with powerful features, one of which is the ability to undo and redo changes you make to a file. This means if you accidentally delete something or make a mistake, you can easily go back and fix it. Understanding
6 min read
Joining Two Lines in VI Editor
Vi is a powerful command-line text editor used by programmers, system administrators, and writers alike. They offer a vast array of features, including the ability to manipulate text efficiently. One common task you might encounter when working with Vi is joining two lines together. This article wil
3 min read
How to Hide Line Numbers in Vim Editor
In this article, we will cover how to hide line numbers in the Vim editor. First, we look at what Linux and VIM editors and why we use them, what are its features and how can we use them followed by various options to make the Vim editor hide line numbers and how we can change the default settings o
3 min read
How to Install Vim Editor in MacOS?
Vim editor is an open-source software developed by "Bram Moolenaar" in 1991. Vim, short for "Vi IMproved," is a highly customizable and powerful text editor that is most commonly used by developers, system administrators, writers, and anyone who works extensively with text files. Vim is created as a
3 min read
Perl | Writing to a File
A filehandle is a variable that is used to read and write to a file. This filehandle gets associated with the file. In order to write to the file, it is opened in write mode as shown below: open (FH, ‘>’, “filename.txt”); If the file is existing then it truncates the old content of file with the
3 min read
Vim Editor in Linux
If you’re new to the world of Linux, one of the first things you’ll encounter is the command line interface. And if you’re going to be working in the command line, you’ll inevitably come across various text editors. Among them, Vim stands out as a powerful, yet notoriously complex, text editor. In t
7 min read
How to Open a File in Linux
In Linux, a file is a fundamental unit of storage, representing everything from documents and images to system logs and program data. Unlike traditional operating systems, Linux treats almost everything—files, directories, devices, and processes—as a file. Whether you're accessing a simple text docu
6 min read
How to Open a File in Linux
In Linux, a file is a fundamental unit of storage, representing everything from documents and images to system logs and program data. Unlike traditional operating systems, Linux treats almost everything—files, directories, devices, and processes—as a file. Whether you're accessing a simple text docu
6 min read
How to Paste in Vim Editor from Notepad?
Vim is a robust text editor found in many Unix-like systems. Copying text from an external source, such as Notepad, and copying it into Vim can be challenging, especially for inexperienced users. In normal mode, every character entered will be read as a command in Vim. Place the cursor where you wan
4 min read