Vi/Vim Show Line Numbers

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/vi-vim-show-line-numbers/
PINTEREST
PINTEREST
INSTAGRAM

Vi is 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 have very good syntax highlighting and wide programming language, configuration file support. Vi has the ability to auto complete too. But today we will look 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
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

Show Line Numbers
Show Line Numbers

Hide Line Numbers

We can hide existing line numbers with the following command.

Hide Line Numbers
Hide Line Numbers

Make Line Number Configuration Persistent

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

Make Line Number Configuration Persistent
Make Line Number Configuration Persistent
RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/vi-vim-show-line-numbers/
PINTEREST
PINTEREST
INSTAGRAM

LEARN MORE  Linux curl Command Tutorial With Examples

Leave a Reply

Your email address will not be published.