当前位置: 技术问答>linux和unix
帮忙,我用vi时字体全是白色,怎么设置才会使不同内容出现不同颜色啊
来源: 互联网 发布时间:2015-06-17
本文导语: 。。。。 | 用grub吧 | syntax on加在你的vimrc文件里,这样遇到SHELL或者程序就可以有 颜色显示了 [root@localhost macros]# cat vimrc if v:lang =~ "^ko" set fileencodings=euc-kr set guifontset=-*...
。。。。
|
用grub吧
|
syntax on加在你的vimrc文件里,这样遇到SHELL或者程序就可以有
颜色显示了
[root@localhost macros]# cat vimrc
if v:lang =~ "^ko"
set fileencodings=euc-kr
set guifontset=-*-*-medium-r-normal--16-*-*-*-*-*-*-*
elseif v:lang =~ "^ja_JP"
set fileencodings=euc-jp
set guifontset=-misc-fixed-medium-r-normal--14-*-*-*-*-*-*-*
elseif v:lang =~ "^zh_TW"
set fileencodings=big5
set guifontset=-sony-fixed-medium-r-normal--16-150-75-75-c-80-iso8859-1,-taipei-fixed-medium-r-normal--16-150-75-75-c-160-big5-0
elseif v:lang =~ "^zh_CN"
set fileencodings=gb2312
set guifontset=*-r-*
endif
if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
set fileencodings=utf-8,latin1
endif
set nocompatible " Use Vim defaults (much better!)
set ts=4
set bs=2 " allow backspacing over everything in insert mode
"set ai " always set autoindenting on
"set backup " keep a backup file
set viminfo='20,"50 " read/write a .viminfo file, don't store more
" than 50 lines of registers
set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time
" Only do this part when compiled with support for autocommands
if has("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 ("'"")