The VIMRC file is a VIM environment settings file.
The overall vim setting is in the/ETC/VIMRC file.
Modifying the/ETC/VIMRC file is not recommended, and each user can set up vim in the user's root directory and create a new ~/.VIMRC.
My VIMRC configuration is as follows (continuous update):
if v:lang =~ "utf8$" | | v:lang =~ "utf-8$" set fileencodings=ucs-bom,utf-8,latin1endifset Nocompatible " Use Vim defaults (much better!) Set bs=indent,eol,start " allow backspacing over everything in insert Mode "Set ai" always set autoindenting on "Set backup" keep a backup fileset viminfo= ' 20,\ ' read/write a .viminfo file, don ' t Store more " than 50 lines of registersset history=50" keep 50 lines of command line historyset ruler " show the cursor Position all the time " only do this part when compiled with support for autocommandsif has ("Autocmd") augroup redhat autocmd! " in text files, always limit the width of text to 78 characters " autocmd BufRead *.txt set tw=78 " When editing a file, always jump to the last cursor position autocmd bufreadpost * \ if line ("' \" ") > 0 && line ("' \" ") <= line (" $ ") | \ exe " normal! G ' \ "" | \ endif " don ' t write swapfile on most commonly used directories for nfs mounts or usb sticks autocmd bufnewfile,bufreadpre /media/*,/run/media/*,/mnt/* set directory=~/tmp,/var/tmp,/ tmp " start with spec file template autocmd bufnewfile *.spec 0r /usr/shAre/vim/vimfiles/template.spec augroup endendifif has ("Cscope") && Filereadable ("/usr/bin/cscope") set csprg=/usr/bin/cscope set csto =0 set cst set nocsverb " add any Database in current directory if filereadable ("Cscope.out") cs add $PWD/cscope.out " else add database pointed to by environment elseif $CSCOPE _db != "" cs add $CSCOPE _db endif set Csverbendif " switch syntax highlighting on, when the terminal has colors " Also switch on highlighting the last used search pattern.if &t_co > 2 | | has ("gui_running") syntax on set hlsearchendif " filetype plugin onfiletype plugin indent on (more in Python syntax, the keyword is automatically indented) if &term== " Xterm " set t_Co=8 set t_Sb=m set t_sf=mendif " don ' t wake up system with blinking cursor: "&NBSP;HTTP://WWW.LINUXPOWERTOP.ORG/KNOWN.PHPLET&NBSP;&GUICURSOR&NBSP;=&NBSP;&GUICURSOR&NBSP; ", A:blinkon0"
This article is from the creator think blog, so be sure to keep this source http://strongit.blog.51cto.com/10020534/1861586
Vim configuration Information VIMRC