欢迎使用CSDN-markdown编辑器
2016-05-24 19:31
267 查看
我的_vimrc配置文件
set nocompatible source $VIMRUNTIME/vimrc_example.vim source $VIMRUNTIME/mswin.vim behave mswin "this is my DIY "自动缩进设置 set cindent set smartindent set incsearch set autoindent set background=dark "使用黑色背景 colorscheme koehler set nu "显示行号 set go= set shortmess=at set guifont=Inconsolata:h11:cANSI syntax on autocmd InsertLeave * se nocul "浅色高亮当前行 autocmd InsertEnter * se cul "浅色高亮当前行 set ruler "显示标尺 set showcmd set scrolloff=3 "光标移动到buffer顶部和底部时保持3行距离 set novisualbell set foldenable set foldmethod=manual set tags+="C:\Program Files (x86)\CodeBlocks\MinGW\include\tags"; set autochdir set path+="C:\Program Files (x86)\CodeBlocks\MinGW\include" "设置路径 "DIY end! " "以下内容括号自动补全 inoremap ( ()<Esc>i inoremap [ []<Esc>i inoremap { {<CR>}<Esc>O autocmd Syntax html,vim inoremap < <lt>><Esc>i| inoremap > <c-r>=ClosePair('>')<CR> inoremap ) <c-r>=ClosePair(')')<CR> inoremap ] <c-r>=ClosePair(']')<CR> inoremap } <c-r>=CloseBracket()<CR> inoremap " <c-r>=QuoteDelim('"')<CR> inoremap ' <c-r>=QuoteDelim("'")<CR> function ClosePair(char) if getline('.')[col('.') - 1] == a:char return "\<Right>" else return a:char endif endf function CloseBracket() if match(getline(line('.') + 1), '\s*}') < 0 return "\<CR>}" else return "\<Esc>j0f}a" endif endf function QuoteDelim(char) let line = getline('.') let col = col('.') if line[col - 2] == "\\" "Inserting a quoted quotation mark into the string return a:char elseif line[col - 1] == a:char "Escaping out of the string return "\<Right>" else "Starting a string return a:char.a:char."\<Esc>i" endif endf "括号自动补全END! set diffexpr=MyDiff() function MyDiff() let opt = '-a --binary ' if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif let arg1 = v:fname_in if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif let arg2 = v:fname_new if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif let arg3 = v:fname_out if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif let eq = '' if $VIMRUNTIME =~ ' ' if &sh =~ '\<cmd' let cmd = '""' . $VIMRUNTIME . '\diff"' let eq = '"' else let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"' endif else let cmd = $VIMRUNTIME . '\diff' endif silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq endfunction
相关文章推荐
- 图片缓存
- java截取url中的值
- 南京IT公司
- Shell编程
- 对称排序acm283
- 【cocos2d-x 手游研发----怪物智能AI】
- 浅谈Handler机制
- java,你是谁?
- Ubuntu-16.04安装jdk
- Linux环境下软件安装
- python 中time.sleep没有作用
- 视屏暂停的时候添加广告
- 【cocos2d-x 手游研发小技巧 循环无限滚动的登陆背景】
- Activity中 findViewById 获取控件对象正确的代码位置
- 2016"百度之星" - 初赛(Astar Round2A)Sitting in Line
- Shell操作
- django 2
- 浅析双绞线中五类线每根线的功能
- Android Fragment 深入理解
- C++ STL算法系列--copy函数