Reprinted from: http://blog.csdn.net/chuanj1985/article/details/6873830 in Ubuntu the configuration file for vim is stored in the/etc/vim directory with the configuration file named VIMRC
The configuration file for vim in Fedora is stored in the/etc directory, and the configuration file named VIMRC. Vim in red Hat Linux is stored in the/etc directory with the configuration file named VIMRC
- Set nocompatible "Remove the relevant VI consistency pattern to avoid bugs and limitations in previous versions
- Set nu! The Display line number
- Set GUIFONT=LUXI/MONO/9 "Setting font, font name and font size
- filetype on "Detecting file types
- Set history=1000 "Record the number of rows in history
- Set Background=dark "Background using black
- Syntax on "Syntax high brightness display
- Set Autoindent "Vim uses automatic alignment, that is, applies the alignment format of the current line to the next line (auto indent)
- Set Cindent "(Cindent is automatically indented for C language syntax)
- Set Smartindent "according to the above alignment format, intelligent selection alignment, for similar C language writing useful
- Set tabstop=4 "Sets the TAB key to 4 spaces,
- Set shiftwidth = 4 "Sets the use of 4 spaces when interlaced between rows
- Set ai! The Set auto indent
- Set Showmatch "Sets the matching pattern, similar to when an opening parenthesis is entered, matches the appropriate closing parenthesis
- Set guioptions-=t "Removal of vim in GUI version toolbar
- Set VB t_vb= "When Vim is being edited, an alert is issued if the command is wrong, and the setting removes the alarm
- Set ruler "Displays the status line of the cursor position in the lower-right corner during the editing process
- Set Nohls "By default, look for a match is a high brightness display, this setting turns off highlighting
- Set Incsearch "Query a word in the program, automatically match the position of the word, such as query desk word, when you lose to D, will automatically find the first d word, when input to/de, will automatically find the first word to start with DS, and so on, into When you find a word to match, don't forget to enter
- Set backspace=2 "Setting backspace key available
- After modifying a file, automatic backup, backup file name is the original filename plus "~" suffix
- If has ("VMS")
- Set Nobackup
- Else
- Set backup
- endif
If the discovery function does not work after the setup is complete, check if the vim-enhanced package is installed under the system and the query command is:
$RPM-Q vim-enhanced
Note: If you set the above settings, VIM does not make the corresponding action, then please upgrade your vim to the latest version, generally as long as the terminal input the following command: sudo apt-get install vim
Vim Display line number, syntax highlighting, auto indent settings