Get the App
SLTechnology News&Howtos  ›  Servers  › 

Detailed explanation of the steps of automatically setting Line number in ubuntu16.04

Shulou Source: shulou.com Published: 2022-06-02 03:01:01 10月06日 Update

The first step is to install the vim command: sudo apt-get install vim

The second step is to change the configuration file etc/vim of vim as follows:

(1) cd / etc/vim

(2) sudo gedit vimrc

Third, insert the following line at the end of the vimrc

Syntax on set tabstop=4 set shiftwidth=4 set autoindent set cindent set cinoptions= {0Magne 1s recorder t0je 2m p 2s, (03s recorder .5s, > 1s recorder 1s recorder 1s set nu set softtabstop=4

The fourth step is that it is over after saving, and then opening a .c file with vim will show the effect of highlighting and different syntax colors.

/ explain the meaning of the above setting / syntax on / / set syntax highlight set tabstop=4 / / set tab width to 4 set softtabstop=4 / / set soft tab width to 4 set shiftwidth=4 / / set space indentation to 4 set autoindent / / set automatic indentation set cindent / / set automatic indentation mode set nu / / display the line number of text on the left side

Add: the method of setting line number by Ubuntu vi

Sudo vi / etc/vim/vimrc

Open the vimrc file, add set nu at the bottom, and save it to add the line number. Set autoindent is an automatic line feed.

Summary

The above is the detailed explanation of the steps of ubuntu16.04 automatic setting line number introduced by the editor to you. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. Thank you very much for your support to the website!

Tags: Line number file different content tab command width syntax highlight tabulation step line meaning effect text method method question space type Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Redmi vpn Apple OPPO Reno