Vim Display line number, syntax highlighting, auto indent settings

Source: Internet
Author: User
Tags set background

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
  1. Set nocompatible "Remove the relevant VI consistency pattern to avoid bugs and limitations in previous versions
  2. Set nu! The Display line number
  3. Set GUIFONT=LUXI/MONO/9 "Setting font, font name and font size
  4. filetype on "Detecting file types
  5. Set history=1000 "Record the number of rows in history
  6. Set Background=dark "Background using black
  7. Syntax on "Syntax high brightness display
  8. Set Autoindent "Vim uses automatic alignment, that is, applies the alignment format of the current line to the next line (auto indent)
  9. Set Cindent "(Cindent is automatically indented for C language syntax)
  10. Set Smartindent "according to the above alignment format, intelligent selection alignment, for similar C language writing useful
  11. Set tabstop=4 "Sets the TAB key to 4 spaces,
  12. Set shiftwidth = 4 "Sets the use of 4 spaces when interlaced between rows
  13. Set ai! The Set auto indent
  14. Set Showmatch "Sets the matching pattern, similar to when an opening parenthesis is entered, matches the appropriate closing parenthesis
  15. Set guioptions-=t "Removal of vim in GUI version toolbar
  16. Set VB t_vb= "When Vim is being edited, an alert is issued if the command is wrong, and the setting removes the alarm
  17. Set ruler "Displays the status line of the cursor position in the lower-right corner during the editing process
  18. Set Nohls "By default, look for a match is a high brightness display, this setting turns off highlighting
  19. 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
  20. Set backspace=2 "Setting backspace key available
  21. 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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.