Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1181873
  • 博文数量: 252
  • 博客积分: 5421
  • 博客等级: 大校
  • 技术积分: 2418
  • 用 户 组: 普通用户
  • 注册时间: 2007-06-17 12:59
文章分类

全部博文(252)

文章存档

2017年(3)

2016年(18)

2015年(31)

2014年(18)

2013年(7)

2012年(8)

2011年(12)

2010年(30)

2009年(32)

2008年(57)

2007年(36)

分类: LINUX

2008-06-02 12:20:16

_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 ***************************
阅读(1498) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~