In ubuntu, the vim configuration file is stored in the/etc/Vim directory. The configuration file name is vimrc.
In fedora, the vim configuration file is stored in the/etc directory. The configuration file name is vimrc. In Red Hat Linux, the vim configuration file is stored in the/etc directory. The configuration file name is vimrc.
- Set nocompatible "removes VI consistency mode to avoid bugs and limitations in earlier versions
- Set Nu! "Display row number
- Set guifont = Luxi/MONO/9 "Set Font, font name, and font size
- Filetype on "check file type
- Set history = 1000 "records the number of historical rows
- Set background = Dark "background black
- Syntax on "syntax High Brightness Display
- Set autoindent "Vim uses automatic alignment, that is, apply the alignment format of the current row to the next line (Auto indent)
- Set cindent "(cindent is especially designed for automatic indentation of C language syntax)
- Set smartindent "intelligently selects Alignment Based on the alignment format above, which is useful for programming similar to the C Language
- Set tabstop = 4 "set the tab key to 4 spaces,
- Set shiftwidth = 4 "set to use four spaces when lines are staggered
- Set Ai! "Set automatic indent
- Set showmatch "sets the matching mode, similar to that when you enter a left brace, it will match the corresponding right brace.
- Set guioptions-= T "Remove toolbar from Vim's Gui version
- Set VB t_vb = "When Vim is edited, an alarm is triggered if the command is incorrect. This setting removes the alarm.
- Set ruler "shows the status line at the cursor position in the lower right corner during editing
- Set nohls "by default, search for matching is a high-Brightness Display, which closes the highlighted display
- Set incsearch "queries a word in a program and automatically matches the position of the word. For example, if you query a desk word, when you enter/d, the word starting with D is automatically found, when you enter/de, the first word starting with DS is automatically found, and so on. When you find the word to match, do not forget to press Enter.
- Set backspace = 2 "set backspace key available
- After a file is modified, it is automatically backed up. The backup file name is added with "~" to the original file name. Suffix
- If has ("VMS ")
- Set nobackup
- Else
- Set backup
- Endif
If the setting is complete and the function does not work, check whether the vim-enhanced package is installed in the system. The query command is:
$ Rpm-Q vim-enhanced
NOTE: If Vim does not take any action after the preceding settings are configured, upgrade Vim to the latest version. Generally, you only need to enter the following command on the terminal: sudo apt-Get install Vim