Toggle between Display and Hide line numbers
First we create an empty file and open it with the vim editor,
vim filename.txt
Once the file is created add some text in it, press ‘i’ to enter in editing/insert mode and start writing you content,
To toggle the absolute line numbers use the following commands:
:set number!
Alternatively,
:set nu!
Example:
To toggle the relative line numbers use the following commands,
:set relativenumber!
Alternatively,
:set rnu!
Example:
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 of Vim editor to hide line numbers.
Linux
Linux was developed by Linus Torvalds in 1991 as a hobby project. It is an open-source (source code that can be used by anyone freely) kernel that is most popular and widely used in the industry as well as in personal systems. There are various operating systems based on the Linux kernel, some of the popular Linux distributions are Ubuntu, Cent OS, Red Hat, Debian, and Kali Linux.
VIM Editor
Vi Editor is a widely used text editor in Unix/Linux systems and is known for its efficiency and flexibility. Vi editor was developed in 1976 by Bill Joy and later in 1991, an improved version of Vi editor was released which is known as VI IMproved (VIM).
Contact Us