Configure the tab and empty line color of vim in linux

Source: Internet
Author: User

Centos is located at:/etc/vimrc

1 if v: lang = ~ "Utf8 $" | v: lang = ~ UTF-8 $"
2 set fileencodings = ucs-bom, UTF-8, latin1
3 endif
4 syn on
5 set number
6 set nocompatible "Use Vim defaults (much better !)
7 set bs = indent, eol, start "allow backspacing over everything in insert mode
8 "set ai" always set autoindenting on
9 "set backup" keep a backup file
10 set viminfo = '20, \ "50" read/write a. viminfo file, don't store more
11 "than 50 lines of registers
12 set history = 50 "keep 50 lines of command line history
13 set rsor "show the cursor position all the time
14 set listchars = tab:>-, trail :-
15 highlight WhitespaceEOL ctermbg = red guibg = red

16 match WhitespaceEOL/\ s \ + $/
17 "Only do this part when compiled with support for autocommands
18 if has ("autocmd ")
19 augroup redhat
20 autocmd!
21 "In text files, always limit the width of text to 78 characters
22 autocmd BufRead *. txt set tw = 78
23 "When editing a file, always jump to the last cursor position
24 autocmd BufReadPost *
25 \ if line ("'\" ")> 0 & line ("' \ "") <= line ("$") |
26 \ exe "normal! G' \ "" |
27 \ endif
28 "don't write swapfile on most commonly used directories for NFS mounts or USB sticks
29 autocmd bufnewfile, bufreadpre/Media/*,/mnt/* Set Directory = ~ /Tmp,/var/tmp,/tmp
30 "Start with spec file template
31 autocmd bufnewfile *. spec 0r/usr/share/Vim/vimfiles/template. spec
32 augroup end
33 endif
34
35 if has ("CSAs") & filereadable ("/usr/bin/csable ")
36 set csprg =/usr/bin/cs.pdf
37 set CSTO = 0
38 set CST
39 set nocsverb
40 "add any database in current directory
41 if filereadable ("cscope. Out ")
42 CS add cscope. Out
43 "else add database pointed to by environment
44 elseif $ CSCOPE_DB! = ""
45 cs add $ CSCOPE_DB
46 endif
47 set csverb
48 endif
49
50 "Switch syntax highlighting on, when the terminal has colors
51 "Also switch on highlighting the last used search pattern.
52 if & t_Co> 2 | has ("gui_running ")
53 syntax on
54 set hlsearch
55 endif

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.