Reprint: Change the Vim profile under Ubuntu to create a C + + style
Vim's default configuration is not satisfactory and requires its own configuration.
The default configuration file is:/ETC/VIM/VIMRC
We can set up our own configuration file in the home directory
Switch Home Directory#cd ~
Touch a file named. VIMRC (starting with a. Hide file)
#touch. VIMRC
#vi. VIMRC
Enter the following configuration:
Set nocompatible does not use the VI default keyboard layout <----This is important, if not configured, press the arrow key in edit mode to enter characters, very inconvenient >
Set Number Displays line numbers
Set autoindent Auto Align
Set Smartindent Smart Alignment
Set Showmatch bracket matching pattern
Set ruler display status line
Set Incsearch
Set tabstop=4 Tab key is 4 spaces
Set shiftwidth=4
Set softtabstop=4
Set cindent C language format alignment
Set Nobackup do not back up files
Set clipboard+=unnamed shared clipboard with Windows
Syntax on support syntax highlighting
Save the exit on OK!
Change the Vim profile under Ubuntu to create a C + + style