(我的VIM配置文件,记录一下)
LINUX环境(2010-01-14更新):
"基本设置
set nocompatible
set backspace=2
set autoindent
set cindent
"set vb t_vb=
set nobackup
set nowritebackup
set encoding=utf-8
set fileencodings=utf-8,chinese,latin-1
"设置语法高亮显示
colorscheme desert "(可选darkblue, elflord, torte)
syntax on
"显示行号,高亮和命令
set nu
set hls
set showcmd
"设置行宽和自动折行
set textwidth=78
set wrap
"用四个空格代替tab键,便于写代码
set tabstop=4
set expandtab
set shiftwidth=4
set shiftround
"配置自动生成注释的选项
let g:doxygenToolkit_authorName="huabo"
let g:DoxygenToolkit_briefTag_funcName="yes"
"打开时,光标自动定位到上次关闭时的位置
au BufReadPost * if line("'\"") > 0|if line("'\"") <= line("$")|exe("norm '\"")|else|exe "norm $"|endif|endif
"ctags taglist winmanager设置
set tags=/usr/include/tags,/usr/local/include/tags,tags
let Tlist_Exit_OnlyWindow=1
let Tlist_File_Fold_Auto_Close=1
let Tlist_Auto_Update=1
let g:winManagerWindowLayout="FileExplorer|TagList"
let g:defaultExplorer=0
let g:winManagerWidth=20
filetype plugin indent on
set completeopt=longest,menu
"自定义的快捷键设置
map
:Dox
map :WMT
imap :WMT
map :!ctags --c++-kinds=+plx --c-types=+px --fields=+iaS --extra=+q -R .
附图一张
WINDOWS环境:
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin
set guioptions-=m
set guioptions-=T
set guioptions-=r
set guioptions-=L
set nocompatible
set backspace=2
set autoindent
set cindent
set nobackup
set nowritebackup
set gfn=新宋体:h12:cGB2312
set encoding=utf-8
set fileencodings=ucs-bom,utf-8,chinese,latin-1
if has("win32")
set fileencoding=chinese
else
set fileencoding=utf-8
endif
set langmenu=zh_CN.utf-8
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim
language messages zh_cn.utf-8
"以上这段解决文字乱码,菜单乱码等问题。
colorscheme slate
syntax on
set nu
set tabstop=4
set expandtab
set shiftwidth=4
set shiftround
set tags=D:\Program\DevCpp\include\tags,tags
let Tlist_Exit_OnlyWindow=1
let Tlist_File_Fold_Auto_Close=1
let g:winManagerWindowLayout = "FileExplorer|TagList"
let g:defaultExplorer=0
let g:winManagerWidth=20
filetype plugin indent on
set completeopt=longest,menu
map :!ctags --c++-kinds=+plx --c-types=+px --fields=+iaS --extra=+q -R .
阅读(1634) | 评论(0) | 转发(0) |