方法一:
打开GIM-->编辑-->启动设定
在弹出的对话框中,进行编辑,并把下面的设定加入到配置中:
" " 不同中文编码显示 " 同时支持GBK和UTF-8编码 " "set fileencoding=gb18030 "set fileencodings=utf-8,gb18030,utf-16,big5 set fileencodings=ucs-bom,utf-8,cp936 set fileencoding=utf-8 set encoding=cp936 "set encoding=utf-8 " " 设置字体 " "set guifont=Lucida_Console:h9:cANSI "set guifont=Droid_Sans_Mono:h11:cANSI set guifont=Courier_New:h11:cANSI "set guifont=Droid_Sans_Fallback:h9:cANSI " " 启动最大化, 设置颜色方案 " " winsize 1024 768 au GUIEnter * simalt ~x colorscheme desert " "自动缩进 " set autoindent " " 设置tab制表符为4个空格 " set ts=4 set expandtab set shiftwidth=4 set cinoptions=>4,e0,n0,f0,{0,}0,^0,:s,=s,l0,gs,hs,ps,ts,+s,c3,C0,(2s,us, \U0,w0,m0,j0,)20,*30 " "set cindent " " " 展开显示文件类型菜单 " let do_syntax_sel_menu = 1 | runtime! synmenu.vim | aunmenu &Syntax.&Show\ filetypes\ in\ menu " " 设置语法 " "if &filetype != 'javacc' " setlocal filetype=javacc "endif "set syntax=javacc "cal SetSyn("cpp") "cal SetSyn("vb") "cal SetSyn("perl") "cal SetSyn("awk") cal SetSyn("sqloracle") " " 备份文件放在指定目录 " set backupdir=C:\tmp " " 没有警告音和视觉警告 " set vb t_vb= " " 禁用swf交换文件 " setlocal noswapfile " " 显示行号 " set number " " 隐藏工具条 " " see :help 'guioptions' " set guioptions-=T "set guioptions-=m " " 状态条,显示字节数,列数,行数,当前行等信息 " set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [ASCII=\%03.3b]\ [HEX=\%02.2B]\ [POS=%04l,%04v][%p%%]\ [LEN=%L] set laststatus=2 " always show the status line " "auto-comments for // and /* */ "setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:// " "disable auto-comments for // "setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,f:// " "disable auto-comments for // and /* */ " "setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/* setlocal comments=""
保存后,退出即可
方法二:
因为上述配置实际上就是在修改gvim 安装目录下的_vimrc文件,所以我们直接修改该文件,效果一样。
PS: 附件中是我常用的 GVIM配置文件,可以直接下载下来后覆盖安装目录下对用的_vimrc文件即可。