System Information: # Cat/etc/redhat-Releasecentos Linux Release7.2.1511(Core) # uname-Alinux Localhost.localdomain3.10.0-327.22.2. el7.x86_64 #1SMP Thu June at -: to: OneUtc .x86_64 x86_64 x86_64 gnu/linux# Cat/proc/Versionlinux version3.10.0-327.22.2. el7.x86_64 ([email protected]) (GCC version4.8.3 20140911(Red Hat4.8.3-9) (GCC)) #1SMP Thu June at -: to: OneUtc .[[Email protected]~]# cat/etc/issue
Installation
(Install Vundle First, then manage other plugins via this plugin manager)
CD ~
mkdir. Vim
git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
Vim. VIMRC
If V:lang =~ "utf8$" | | V:lang =~ "utf-8$"
Set Fileencodings=ucs-bom,utf-8,latin1
endif
Set 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 file
Set viminfo= ' 20,\ "read/write A. viminfo file, don ' t store more
"than lines of registers
Set history=50 "Keep lines of command line history
Set ruler "show the cursor position all the time
"Only does this" when the compiled with the support for Autocommands
if have ("Autocmd")
Augroup redhat
AUTOCMD!
"in text files, all limit the width of text to characters
" Autocmd bufread *.txt set tw=78
"when Editin G A file, 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 BUFNEWF ile,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 END
endif
If 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 Csverb
endif
"Switch syntax highlighting on while the terminal has colors
"Also switch on highlighting, the last used search pattern.
If &t_co > 2 | | Has ("gui_running")
Syntax on
Set Hlsearch
endif
FileType plugin on
If &term== "Xterm"
Set T_co=8
Set T_SB=DM
Set T_SF=DM
endif
"Don T wake up system with blinking cursor:
"Http://www.linuxpowertop.org/known.php
Let &guicursor = &guicursor. ", A:blinkon0"
Set go=
The Color desert
The Set Background=light
ColorScheme Molokai
Syntax on
Set number
Set ts=4
Set softtabstop=4
Set Autoindent
Set nocompatible
FileType off
Set Rtp+=~/.vim/bundle/vundle.vim
Call Vundle#begin ()
Plugin ' Gmarik/vundle.vim '
Bundle "Scrooloose/nerdtree"
Bundle ' Valloric/youcompleteme '
Bundle ' Tpope/vim-rails '
Bundle "Tomasr/molokai"
Bundle "Lokaltog/vim-powerline"
Call Vundle#end ()
FileType plugin indent on
Nmap <F5>:nerdtreetoggle<cr>
Vim. VIMRC
: Bundleinstall
Installation Complete
Other commands:
: Bundleupdate #更新: Bundleclean #清除. VIMRC plugin: bundlelist #列出插件: Bundlesearch #查找插件
Vim Plug-in installation