Vi/Vim Show Line Numbers – POFTUT

Vi/Vim Show Line Numbers

Vi is a popular text editor for Linux and BSD environment. It gives a lot of feature to the user. But its learning curve is a bit complex. Actually learning vim is complex but after learning, it is very comfortable to work with text files. Vi is used system administrator, users, developers. Developers uses vim too. Because vim has very good syntax highlighting and wide programming language, configuration file support. Vi has the ability to auto-complete too. But today we will look at how to show line numbers and make this configuration persistent.

Show Line Numbers

We open our test file named my.c like below.

Show Line Numbers

Now we can set line number options. We will write following command in the normal mode. To switch normal mode press ESC . We will use set number configuration command.

Show Line Numbers

Show Line Numbers

Hide Line Numbers

We can hide existing line numbers with the following command. We will use set nonumber configuration command.

Hide Line Numbers

Hide Line Numbers

Make Line Number Display Configuration Persistent

Changing all time the line number settings is a tedious task. It can be made persistent the line number setting by changing user or global vim configuration.

Make No Line Number Display Configuration Persistent

Changing all time the line number settings is a tedious task. It can be made persistent the line number setting by changing user or global vim configuration.

LEARN MORE  Php - Install Php In Linux and Create Development Environment

Leave a Reply

Your email address will not be published. Required fields are marked *

Enjoy this blog? Please spread the word :)