" 配置多语言环境,解决中文乱码问题 if has("multi_byte") " UTF-8 编码 set encoding=utf-8 set termencoding=utf-8 set formatoptions+=mM set fencs=utf-8,gbk if v:lang =~? '^/(zh/)/|/(ja/)/|/(ko/)' set ambiwidth=double endif if has("win32") source $VIMRUNTIME/delmenu.vim source $VIMRUNTIME/menu.vim language messages zh_CN.utf-8 endif else echoerr "Sorry, this version of (g)vim was not compiled with +multi_byte" endif set nu! colorscheme desert syntax enable syntax on set expandtab "设置tab set shiftwidth=4 "设置tab的间隔 set tabstop=4 "四个空格表明一个tab set sts=4 set showmatch "在输入括号时光标会短暂地跳到与之相匹配的括号处 set autoindent "设置自动缩进 " set smartindent "设置智能缩进 set nowrap "设置自动换行 set go=-a "设置字体 if has('gui_running') set lines=60 columns=108 linespace=0 if has('gui_win32') set guifont=Microsoft_YaHei_Mono:h10:cANSI:qDRAFT else set guifont=Microsoft_YaHei_Mono:h10:cANSI:qDRAFT endif endif