Detailed steps to automatically set the line number in ubuntu16.04

The first step, install vim command: sudo apt-get install vim

The second step, change the vim configuration file etc/vim command to:

(1) cd /etc/vim

(2) sudo gedit vimrc

The third step is to insert the following content in the last line of vimrc

syntax on 
 set tabstop=4set shiftwidth=4set autoindent 
 set cindent 
 set cinoptions={0,1s,t0,n-2,p2s,(03s,=.5s,>1s,=1s,:1s 
 set nu 
 set softtabstop=4

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

/Explain the meaning of the above settings/ 
syntax on //Set syntax highlighting set tabstop=4//Set the tab width to 4 set softtabstop=4//Set the soft tab width to 4 set shiftwidth=4//Set the number of spaces for indentation to 4 set autoindent//Set automatic indentation set cindent//Set to use C/C++Language automatic indentation set nu//Display the line number of the text on the left

Supplement: How to set the line number in Ubuntu vi

sudo vi /etc/vim/vimrc

Open the vimrc file, add set nu at the bottom, save and add the line number, set autoindent is automatic line wrapping

to sum up

The above is a detailed explanation of the steps for ubuntu16.04 to automatically set the line number introduced by the editor. 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 ZaLou.Cn website!

Recommended Posts

Detailed steps to automatically set the line number in ubuntu16.04
Detailed steps to install MySQL to change the default password in Ubuntu
Steps to upgrade Laravel 5.4 to 5.6 in Ubuntu 16.04
ubuntu16.04 method steps to upgrade the kernel
How to set static IP in ubuntu14.04
Detailed steps to install Anaconda on Linux (Ubuntu 18.04)
Detailed steps to install Anaconda on Linux (Ubuntu 18.04)
How to open the ubuntu system in win10
Introduction to the use of Hanlp in ubuntu
How to view detailed network routing table in Ubuntu
Complete steps to configure IP address in Ubuntu 18.04 LTS
Detailed steps to install Sogou input method on Ubuntu 20.04
Complete steps to realize face recognition login in Ubuntu
Detailed steps to configure Ubuntu 16.04 and Apache virtual host
Many attempts to set up soft routing in ubuntu
How to control the ubuntu system in win10 through ssh
Mac uses vnc to remotely log in to the ubuntu16.04 desktop
How to set or modify the time zone on Ubuntu 20.04
How to set or modify the time zone on Ubuntu 20.04
Detailed steps for installing Django under Python 3.6 in Ubuntu 16.04 environment
Detailed steps to set up a Git server on CentOS
How to set or modify the time zone in CentOS 8
ubuntu 12.04 configure the kernel crash to automatically restart and dump
Detailed steps to install and configure k8s cluster in centos 7
Detailed explanation of the installation and use of SSH in the Ubuntu environment
How to install Helm in Ubuntu
How to upgrade CentOS7 to CentOS8 (detailed steps)
How to install mysql in Ubuntu 14.04
How to install mysql in Ubuntu 14.04
Write a shell script in ubuntu to start automatically when booting (recommended)
Solution to ubuntu unable to surf the Internet after plugging in the network cable
Solution to the problem that ubuntu cannot connect to the Internet in the virtual machine
How to make the ubuntu virtual machine in vmware display in full screen
How to add swap partition in Ubuntu
How to easily compile openJDK in Ubuntu
How to set up Gogs on Ubuntu 14.04
The locate file search command in Ubuntu16.04
Set UTF-8 encoding for MySQL5.7 in Ubuntu 16.04
How to install cuda10.1 driver in Ubuntu
How to delete redundant kernels in Ubuntu
How to delete redundant kernels in Ubuntu
Beautify Ubuntu 18.04 to Mac style in 5 minutes
How to install ROS Noetic in Ubuntu20.04
Install Ubuntu 18.04 in the virtual machine VMware
Ubuntu20.04 steps to install cuda10.1 (graphic tutorial)
How to set up R on Ubuntu 14.04
Ubuntu modified the default sh to bash
How to set PostgreSQL startup on Ubuntu 16.04
How to modify software source in Ubuntu 7.10
How to open root account in Ubuntu20.04
Disable the TinkPad touch screen in Ubuntu
Docker those things in the Ubuntu environment
How to modify the hostname on Ubuntu 20.04
How to hide applications in Ubuntu Dash?