"===================================================================
" General settings
" ==================================================================
set nocp
" Tab related
set ts=4
set sw=4
set smarttab
set et
set ambiwidth=double
" Format related
set tw=78
set lbr
set fo+=mB
" Indent related
set cin
set ai
set cino=:0g0t0(susjl
" Editing related
set backspace=indent,eol,start
set whichwrap=b,s,<,>,[,]
set mouse=a
set selectmode=
set mousemodel=popup
set keymodel=
set selection=inclusive
" Misc
set wildmenu
"set spell
" Encoding related
set encoding=utf-8
set langmenu=en_US.UTF-8
language message en_US.UTF-8
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latinl
" File type related
filetype plugin indent on
" Display related
set ru
set sm
set nu
set hls
if (has("gui_running"))
set guioptions+=b
colo torte
set nowrap
else
colo ron
set wrap
endif
syntax on
"单键<F8>控制sfntax on/off,反斜线是Vim script的拆行标志
"按一次<F8>是on的话,再按一次则是off,再按一次又是on.
"原因是有时候颜色太多会妨碍阅读.
map <F8> :if exists("g:syntax_on") <Bar>
/ syntax off <Bar>
/ else <Bar>
/ syntax enable <Bar>
/ endif <CR>
colorscheme desert
" Fonts related
if (has("win32") || has("win95") || has("win16") || has("win64"))
"set guifont=inconsolata:h14
set guifont=DejaVu/ Sans/ Mono:h14
endif
" Toggle Menu and Toolbar
if (has("gui_running"))
set guioptions-=m
set guioptions-=T
map <silent> <F3> : if &guioptions =~# 'T' <bar>
/set guioptions-=T <bar>
/set guioptions-=m <bar>
/else <bar>
/set guioptions+=T <bar>
/set guioptions+=m <bar>
/endif <cr>
endif
" ===================================================================
" Plugin settings
" ===================================================================
" ctags related
" http://ctags.sourceforge.net/
" 生成一个tags文件
"nmap <F9> <Esc>:!ctags -R *<cr>
" Taglist related
" http://www.vim.org/scripts/script.php?script_id=273
"配置taglist的ctags的路径
"let Tlist_Ctags_Cmd = 'pathname'
" 不同时显示多个文件的tag,只显示当前文件的
let Tlist_Show_One_File=1
" 如果taglist窗口是最后一个窗口,则退出vim
let Tlist_Exit_OnlyWindow=1
" 让当前不被编辑的文件的方法列表自动折叠起来
let Tlist_File_Fold_Auto_Close=1
" 把taglist窗口放在屏幕的右侧,缺省在左侧
let Tlist_Use_Right_Window=1
" 显示taglist菜单
let Tlist_Show_Menu=1
" 启动vim自动打开taglist
"let Tlist_Auto_Open=1
map tl : Tlist<cr>
" bufexplorer related
" http://www.vim.org/scripts/script.php?script_id=42
" minibuf related
" http://vim.sourceforge.net/scripts/script.php?script_id=159
" WinManager related
" http://www.vim.org/scripts/script.php?script_id=95
"let g:winManagerWindowLayout = 'FileExplorer|TagList'
let g:winManagerWindowLayout = 'FileExplorer|TagList'
map wm : WMToggle <cr>
" 将插件显示在右侧
" 打开winmanager.vim,在function! <SID>StartWindowsManager()函数中修改:
" 将: wincmd H修改为 wincmd L
" miniBufexpl related
let g:miniBufExplMapWindowNavVim=1
" trinitf related
"http://www.vim.org/scripts/script.php?script_id=2347
" NERDTree related
map nt : NERDTreeToggle<cr>
" lookupfile related
" http://www.vim.org/scripts/script.php?script_id=1581
vimrc
最新推荐文章于 2024-07-23 12:24:53 发布