VIM displays line numbers when opening a file

Source: Internet
Author: User

Vim Open file is, the default line number is not prompt.

As for the purpose of displaying the line number, it varies

Linux The next host may have n accounts. There are two types of configurations: Configure only the current account, configure all accounts

Vim configuration file path (Centos 5.5 final):/ETC/VIMRC

If there is no vim profile in the current account directory, it can be CP/ETC/VIMRC to the appropriate directory. After CP, use chmod to change the file user group and user, and MV VIMRC. VIMRC to set the file as a hidden file

One. Change all account Configurations

Change/ETC/VIMRC directly

Vim/etc/vimrc

Add set Nu at the end of the VIMRC file

Wq exit. This way, no matter which account you use to log in, Vim opens and displays line numbers

Two. Configure the environment for the current user

Locate the current user's VIMRC file. If you do not have this file, you can create this file.

Vim ~/.VIMRC

After opening the file, add the last

Set Nu

Wq exit.

Open with Vim again to display the line number.

The above summary is only implemented in text mode. No tests were made in the GUI. The results of the search are as follows: Under the GUI, you need to change the GVIMRC (not tested under the GUI for reference only)

Display line number, for code content and format have insight please leave a message, hey

VIM displays line numbers when opening a file

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.