Just add these two lines to the/ETC/VIMRC. Set Autoindent Set Smartindent --------------------------------------------------------
With:
Use under the terminalVimWhen editing, by default, the editing interface is not displayedLine number, syntax high brightness display, smart indent
and other functions. In order to better inVim, you need to manually set up a profile:. vimrc. In the startVim, the. vimrc file under the current user's root directory is automatically read, and the file can contain settings or even scripts,
Therefore, it is generally convenient to create a. vimrc file under the root directory of the current user, which is the command created: $vi ~/.VIMRC When you're finished setting $:x or $wq Save to exit. An example is given below, which lists the settings that are used frequently, and the detailed setup information in the reference material: "Double quotation marks begin the behavior of the comment line, the same "Get rid of nasty about VI consistency patterns, avoid some bugs and limitations of previous versions Set nocompatible The displayLine number Set number "Type of Detection file FileType on "Record the number of rows in history Set history=1000 The background uses black Set Background=dark "Syntax High brightness display Syntax on "The following two lines are useful for formatting when writing code; "The first line,VimUse automatic alignment, that is, the current line of the format to apply to the next line; "The second line, according to the above format, intelligent selection of the way, for similar C language "It's very useful to write. Set Autoindent Set Smartindent The first line sets the TAB key to 4 spaces, the second row sets the 4 spaces when the rows are interleaved Set tabstop=4 Set shiftwidth=4 "Sets the matching pattern, similar to the corresponding closing parenthesis when an opening parenthesis is entered Set Showmatch "RemoveVimToolbar in the GUI version Set guioptions=t "WhenVimWhen making edits, if the command is wrong, a sound will be issued, and the setting is removed from the sound Set VB t_vb= "During editing, the status line of the cursor position is displayed in the lower-right corner Set ruler "By default, the find match is high brightness display, this setting turns off highlighting Set Nohls Query is very convenient, if you want to find the book word, when input to/b, will automatically find the first "A word beginning with B, when entered into the/bo, will automatically find the word that begins with the first Bo, depending on "The second analogy, when searching, uses this setting to quickly find the answer when you find a word to match "When you don't forget to enter Set Incsearch "After modifying a file, the backup file name is the original filename plus the" ~ "suffix. If has ("VMS")//note double quotes to use half-width quotation marks "" Set Nobackup Else Set backup endif If you remove the comment, a complete. VIMRC configuration information is as follows: Set nocompatible Set number FileType on Set history=1000 Set Background=dark Syntax on Set Autoindent Set Smartindent Set tabstop=4 Set shiftwidth=4 Set Showmatch Set guioptions-=t Set VB t_vb= Set ruler Set Nohls Set Incsearch If has ("VMS") Set Nobackup Else Set backup endif |
|
Original Address http://acm.hrbeu.edu.cn/forums/index.php?showtopic=1834 |
|