我的 .vimrc 配置文件
"=========================================================================
" DesCRiption: 合自己使用的vimrc文件,for Linux/Windows, GUI/Console
"
" Last Change: 2010年08月02日 1513分
"
" Version: 1.80
"
"=========================================================================
" cscope 定
"if has("cscope")
" set csto=1
" set cst
" set nocsverb
" if filereadable("cscope.out")
" cs add cscope.out
" endif
" set csverb
" " s: C言符号 g: 定 d: 个函数用的函数 c: 用个函数的函数
" " t: 文本 e: egrep模式 f: 文件 i: include本文件的文件
" nmap ss :cs find s =expand(""):copen
" nmap sg :cs find g =expand("")
" nmap sc :cs find c =expand(""):copen
" nmap st :cs find t =expand(""):copen
" nmap se :cs find e =expand(""):copen
" nmap sf :cs find f =expand(""):copen
" nmap si :cs find i ^=expand("")$:copen
" nmap sd :cs find d =expand(""):copen
"endif
set nocompatible " vi 兼容模式
syntax on " 自法高亮
"colorscheme molokai " 定配色方案
set number " 示行号
"set cursorline " 突出示当前行
set ruler " 打状尺
set shiftwidth=2 " 定 << 和 >> 命令移的度 4
set softtabstop=4 " 使得按退格可以一次掉 4 个空格
set tabstop=8 " 定 tab 度 4
set nobackup " 覆盖文件不
set autochdir " 自切当前目当前文件所在的目
set expandtab " tab 用空格来表示
filetype plugin indent on " 插件
set backupcopy=yes " 置的行覆盖
set ignorecase smartcase " 搜索忽略大小写,但在有一个或以上大写字母仍保持大小写敏感
set nowrapscan " 禁止在搜索到文件端重新搜索
set incsearch " 入搜索内容就示搜索果
set hlsearch " 搜索高亮示被找到的文本
set noerrorbells " 信息
set novisualbell " 使用可代替呼叫
set t_vb= " 置空声的端代
set showmatch " 插入括号,短地跳到匹配的括号
set matchtime=2 " 短跳到匹配括号的
set magic " 置魔
set hidden " 允在有未保存的修改切冲区,此的修改由 vim 保存
"set guioptions-=T " 藏工具
"set guioptions-=m " 藏菜
set smartindent " 新行使用智能自
set backspace=indent,eol,start
" 不定在插入状无法用退格和 Delete 除回符
set cmdheight=1 " 定命令行的行数 1
set laststatus=2 " 示状 (默 1, 无法示状)
set statusline=\ %<%F[%1*%M%*%n%R%H]%=\ %y\ %0(%{&fileformat}\ %{&encoding}\ %c:%l/%L%)\
" 置在状行示的信息
"set foldenable " 始折
"set foldmethod=syntax " 置法折
"set foldcolumn=0 " 置折区域的度
"setlocal foldlevel=1 " 置折数
" set foldclose=all " 置自折
" nnoremap @=((foldclosed(line('.')) < 0) ? 'zc' : 'zo')
" 用空格来折
" return OS type, eg: windows, or linux, mac, et.st..
function! MySys()
if has("win16") || has("win32") || has("win64") || has("win95")
return "windows"
elseif has("unix")
return "linux"
endif
endfunction
" 用目量$VIMFILES
if MySys() == "windows"
let $VIMFILES = $VIM.'/vimfiles'
elseif MySys() == "linux"
let $VIMFILES = $HOME.'/.vim'
endif
" 定doc文档目
let helptags=$VIMFILES.'/doc'
" 置字体 以及中文支持
if has("win32")
set guifont=Inconsolata:h12:cANSI
endif
" 配置多言境
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
" Buffers操作快捷方式!
" nnoremap :bnext
" nnoremap :bprevious
" Tab操作快捷方式!
" nnoremap :tabnext
" nnoremap :tabprev
"于tab的快捷
" map tn :tabnext
" map tp :tabprevious
" map td :tabnew .
" map te :tabedit
" map tc :tabclose
"窗口分割,行切的按需要接次,比如从下方窗口移
"光到上方窗口,需要k,非常麻,在重映射,切的
"候会得非常方便.
" nnoremap h
" nnoremap j
" nnoremap k
" nnoremap l
"一些不的映射法(如果在一个文件中混合了不同言有用)
"nnoremap 1 :set filetype=xhtml
"nnoremap 2 :set filetype=css
"nnoremap 3 :set filetype=javascript
"nnoremap 4 :set filetype=php
" set fileformats=unix,dos,mac
" nmap fd :se fileformat=dos
" nmap fu :se fileformat=unix
" use Ctrl+[l|n|p|cc] to list|next|previous|jump to count the result
" map l :cl
" map n :cn
" map p :cp
" map c :cc
" Tohtml 生有 CSS 法的 html
" syntax/2html.vim,可以用:runtime! syntax/2html.vim
let html_use_css=1
" Python 文件的一般置,比如不要 tab 等
autocmd FileType python set tabstop=4 shiftwidth=4 expandtab
autocmd FileType python map :!python %
" 中状下 Ctrl+c 制
" vmap "+y
"" 打javascript折
"let b:javascript_fold=1
"" 打javascriptdom、html和css的支持
"let javascript_enable_domhtmlcss=1
"" 置字典 ~/.vim/dict/文件的路径
"autocmd filetype javascript set dictionary=$VIMFILES/dict/javascript.dict
"autocmd filetype css set dictionary=$VIMFILES/dict/css.dict
"autocmd filetype php set dictionary=$VIMFILES/dict/php.dict
"-----------------------------------------------------------------
" plugin - bufexplorer.vim Buffers切
" \be 全屏方式看全部打的文件列表
" \bv 左右方式看 \bs 上下方式看
"-----------------------------------------------------------------
"-----------------------------------------------------------------
" plugin - taglist.vim 看函数列表,需要ctags程序
" F4 打藏taglist窗口
"-----------------------------------------------------------------
if MySys() == "windows" " 定windows系中ctags程序的位置
let Tlist_Ctags_Cmd = '"'.$VIMRUNTIME.'/ctags.exe"'
elseif MySys() == "linux" " 定windows系中ctags程序的位置
let Tlist_Ctags_Cmd = '/usr/bin/ctags'
endif
" nnoremap :TlistToggle
let Tlist_Show_One_File = 1 " 不同示多个文件的tag,只示当前文件的
let Tlist_Exit_OnlyWindow = 1 " 如果taglist窗口是最后一个窗口,退出vim
let Tlist_Use_Right_Window = 1 " 在右窗口中示taglist窗口
let Tlist_File_Fold_Auto_Close=1 " 自折当前非文件的方法列表
let Tlist_Auto_Open = 0
let Tlist_Auto_Update = 1
let Tlist_Hightlight_Tag_On_BufEnter = 1
let Tlist_Enable_Fold_Column = 0
let Tlist_Process_File_Always = 1
let Tlist_Display_Prototype = 0
let Tlist_Compact_Format = 1
"-----------------------------------------------------------------
" plugin - mark.vim 各tags不同的色,便于看式的插件。
" \m mark or unmark the word under (or before) the cursor
" \r manually input a regular expression. 用于搜索.
" \n clear this mark (i.e. the mark under the cursor), or clear all highlighted marks .
" \* 当前MarkWord的下一个 \# 当前MarkWord的上一个
" \/ 所有MarkWords的下一个 \? 所有MarkWords的上一个
"-----------------------------------------------------------------
"-----------------------------------------------------------------
" plugin - NERD_tree.vim 以状方式系中的文件和目
" :ERDtree 打NERD_tree :NERDtreeClose NERD_tree
" o 打文件或者目 t 在中打
" T 在后台中打 ! 行此文件
" p 到上目 P 到根目
" K 到第一个点 J 到最后一个点
" u 打上目 m 示文件系菜(添加、除、移操作)
" r 刷新当前目 R 刷新当前根目
"-----------------------------------------------------------------
" F3 NERDTree 切
" map :NERDTreeToggle
" imap :NERDTreeToggle
"-----------------------------------------------------------------
" plugin - NERD_commenter.vim 注代用的,
" [count],cc 光以下count行逐行添加注(7,cc)
" [count],cu 光以下count行逐行取消注(7,cu)
" [count],cm 光以下count行添加注(7,cm)
" ,cA 在行尾插入 /* */,并且入插入模式。 个命令方便写注。
" 注:count参数可,无默中行或当前行
"-----------------------------------------------------------------
let NERDSpaceDelims=1 " 注符与句之留一个空格
let NERDCompactSexyComs=1 " 多行注子更好看
"-----------------------------------------------------------------
" plugin - DoxygenToolkit.vim 由注生成文档,并且能快速生成函数准注
"-----------------------------------------------------------------
let g:DoxygenToolkit_authorName="Asins - asinsimple AT gmail DOT com"
let g:DoxygenToolkit_briefTag_funcName="yes"
" map da :DoxAuthor
" map df :Dox
" map db :DoxBlock
" map dc a /* */
"-----------------------------------------------------------------
" plugin ZenCoding.vim 很酷的插件,HTML代生成
" 插件最新版:http://github.com/mattn/zencoding-vim
" 常用命令可看:http://nootn.com/blog/Tool/23/
"-----------------------------------------------------------------
"-----------------------------------------------------------------
" plugin checksyntax.vim JavaScript常法
" 默快捷方式 F5
"-----------------------------------------------------------------
let g:checksyntax_auto = 0 " 不自
"-----------------------------------------------------------------
" plugin - NeoComplCache.vim 自全插件
"-----------------------------------------------------------------
let g:AutoComplPop_NotEnableAtStartup = 1
let g:NeoComplCache_EnableAtStartup = 1
let g:NeoComplCache_SmartCase = 1
let g:NeoComplCache_TagsAutoUpdate = 1
let g:NeoComplCache_EnableInfo = 1
let g:NeoComplCache_EnableCamelCaseCompletion = 1
let g:NeoComplCache_MinSyntaxLength = 3
let g:NeoComplCache_EnableSkipCompletion = 1
let g:NeoComplCache_SkipInputTime = '0.5'
let g:NeoComplCache_SnippetsDir = $VIMFILES.'/snippets'
" completion.
" inoremap pumvisible() ? "\" : "\"
" snippets expand key
" imap (neocomplcache_snippets_expand)
"smap (neocomplcache_snippets_expand)
"-----------------------------------------------------------------
" plugin - matchit.vim %命令行展使得能在嵌套和句之跳
" % 正向匹配 g% 反向匹配
" [% 定位首 ]% 定位尾
"-----------------------------------------------------------------
"-----------------------------------------------------------------
" plugin - vcscommand.vim %命令行展使得能在嵌套和句之跳
" SVN/git管理工具
"-----------------------------------------------------------------
"-----------------------------------------------------------------
" plugin a.vim
"-----------------------------------------------------------------