Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to set the line number of vim in Linux system

2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article shows you how to set the line number of vim in the Linux system, the content is concise and easy to understand, it will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

How to set the line number of vim in Linux? Vi/vim is a powerful text editor for Linux but does not automatically display line numbers.

We are going to go to the last line mode of the vi or vim editor and type set number

: set number

Press enter and the line number will be displayed.

So how to close the line number?

Just type set nonumber in the last line mode of the vi or vim editor

: set nonumber

Press the enter number and it will be gone.

Then some people will ask, I opened the line number here.

Next time you open the file, the line number will be gone again.

Quite simply, we just need to add our settings to the configuration file of vi or vim.

Open the / etc/vimrc (/ etc/virc) configuration file:

Vim / etc/vimrc

As you can see, it's all about configuring the vim environment. We just need to create a new line at the beginning or end of the line and write

Set number

Then enter wq to save and exit vim (vi) in the last line mode.

When you use vim (vi) again, does it display the line number?

If you don't want the line number, just delete set number from the / etc/vimrc (/ etc/virc) configuration file.

What are the versions of Linux? the versions of Linux are Deepin, UbuntuKylin, Manjaro, LinuxMint, Ubuntu and so on. Among them, Deepin is one of the best-developed Linux distributions in China; UbuntuKylin is a derivative release based on Ubuntu; Manjaro is a Linux release based on Arch; LinuxMint's default Cinnamon desktop is similar to Windows XP's easy-to-use; Ubuntu is the Linux operating system based on desktop applications.

The above is how to set the line number of vim in Linux system. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report