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

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

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

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!

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

Servers

Wechat

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

12
Report