vim配置信息 vimrc
vimrc文件是vim的环境设置文件。
整体的vim的设置是在 /etc/vimrc 文件中。
不建议修改/etc/vimrc 文件,每个用户可以在用户根目录中设置vim,新建 ~/.vimrc.
我的vimrc配置如下(持续更新):
ifv:lang=~"utf8$"||v:lang=~"UTF-8$"setfileencodings=ucs-bom,utf-8,latin1endifsetnocompatible"UseVimdefaults(muchbetter!)setbs=indent,eol,start"allowbackspacingovereverythingininsertmode"setai"alwayssetautoindentingon"setbackup"keepabackupfilesetviminfo='20,\"50"read/writea.viminfofile,don'tstoremore"than50linesofregisterssethistory=50"keep50linesofcommandlinehistorysetruler"showthecursorpositionallthetime"Onlydothispartwhencompiledwithsupportforautocommandsifhas("autocmd")augroupredhatautocmd!"Intextfiles,alwayslimitthewidthoftextto78characters"autocmdBufRead*.txtsettw=78"Wheneditingafile,alwaysjumptothelastcursorpositionautocmdBufReadPost*\ifline("'\"")>0&&line("'\"")<=line("$")|\exe"normal!g'\""|\endif"don'twriteswapfileonmostcommonlyuseddirectoriesforNFSmountsorUSBsticksautocmdBufNewFile,BufReadPre/media/*,/run/media/*,/mnt/*setdirectory=~/tmp,/var/tmp,/tmp"startwithspecfiletemplateautocmdBufNewFile*.spec0r/usr/share/vim/vimfiles/template.specaugroupENDendififhas("cscope")&&filereadable("/usr/bin/cscope")setcsprg=/usr/bin/cscopesetcsto=0setcstsetnocsverb"addanydatabaseincurrentdirectoryiffilereadable("cscope.out")csadd$PWD/cscope.out"elseadddatabasepointedtobyenvironmentelseif$CSCOPE_DB!=""csadd$CSCOPE_DBendifsetcsverbendif"Switchsyntaxhighlightingon,whentheterminalhascolors"Alsoswitchonhighlightingthelastusedsearchpattern.if&t_Co>2||has("gui_running")syntaxonsethlsearchendif"filetypepluginonfiletypepluginindenton(更符合python语法,遇关键字会自动缩进)if&term=="xterm"sett_Co=8sett_Sb=msett_Sf=mendif"Don'twakeupsystemwithblinkingcursor:"http://www.linuxpowertop.org/known.phplet&guicursor=&guicursor.",a:blinkon0"
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。