_vimrc:
"************************* setting begin **************************
"------------ vim self setting ------------
set nocompatible "不兼容vi
set mouse= "linux终端下清空mouse设置,使vim的鼠标失效,终端的鼠标生效。
set mouse=a "windows上使vim的鼠标生效。
set helplang=cn
syntax on
set incsearch " Incremental search
set hlsearch
color elflord "slate industry
hi CursorLine cterm=NONE ctermbg=darkgray ctermfg=white guibg=darkgray guifg=white
set tabstop=4
set shiftwidth=4
"set expandtab
"autocmd FileType python setl expandtab
set autoindent
set fileencodings=utf-8,ucs-bom,gbk
set fileformat=unix
set sessionoptions+=unix,slash
set guitablabel=%N:%t%M
set guitabtooltip=%N:%f
set foldlevel=100
"set foldcolumn=2 "折叠栏宽度
"set guioptions+=b "添加底部滚动条
set nobackup "编辑时不产生备份文件
set noswapfile
set noundofile
"set foldmethod=syntax "按语法文件中的定义折叠代码
filetype plugin indent on "用智能补全
set completeopt=longest,menu "关掉智能补全时的预览窗口
set guifont=Courier_New:h10:cANSI
"disables menubar
set guioptions-=m
"disables toolbar
set guioptions-=T
"statusline
set laststatus=2
set statusline=FILE:\ %<%F%m%r%h\ %w\ \ PWD:\ %<%r%{getcwd()}%h\ \ \ %l,%c%V\ %P
"-----------------------------------------
"------------ plugins setting ------------
"netrw设置
"V垂直分割使之把新窗口和光标放到右方
let g:netrw_altv = 1
"mru.vim设置:
"let MRU_File = 'D:\Program Files\Vim\vim71\plugin\mru.temp'
"ctags,tags文件查找位置,等号后面不能有空格
"set tags=D:\Program\\\ Files\Vim\ctags_files\jdk1.6tags,./tags,tags
autocmd FileType c,cpp setl tags+=/usr/include/tags
"taglist.vim设置:
let Tlist_Ctags_Cmd='D:\Programs\Vim\ctags.exe'
let Tlist_WinWidth = 25
let Tlist_Use_Right_Window = 1
"javabrowser.vim设置:
let JavaBrowser_Ctags_Cmd = 'C:\WINDOWS\ctags.exe'
let JavaBrowser_Display_Prototype = 1
"NERD_tree设置
let NERDTreeWinPos = 'left'
let NERDTreeWinSize = 25
"-----------------------------------------
"------------ map setting ------------
command Uniq :g/^\(.\+\)$\n\1/d
command Rtrim :%s/\s\+$//
command Ltrim :%s/^\s\+//
"ctags操作
command -nargs=* Buildtags !ctags -R --languages=c++,python,php
\ --php-kinds=cidf --fields=+aiKSz --extra=+fq .
map :tab split:exec("tag ".expand(""))
map gs :split:exec("tag ".expand(""))
map gv :vsp:exec("tag ".expand(""))
nmap :Tlist
"F1设为Esc
map!
nmap
vmap
omap
"tab操作
map :tabnew %:p:h
map :tabn
map :tabp
map :tabn
map :tabp
map :tabclose
nmap 88 :q
"window操作
map k
map j
map h
map l
"-----------------------------------------
"------------ function ------------
cmap uniq call Uniq()
function! Uniq()
python << EOF
import vim;
oldl = '';
new = [];
for l in vim.current.buffer:
if l!=oldl:
new.append(l);
oldl=l;
vim.current.buffer[0:] = new;
EOF
endfunction
"-----------------------------------------
"************************** setting end ***************************
阅读(1575) | 评论(0) | 转发(0) |