vim 配

set nocompatiblesource $vimruntime/vimrc_example.vimsource $vimruntime/mswin.vimbehave mswinset 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 . eqendfunctionset numberfiletype onset autoindentset smartindentset nocompatibleset rulerset incsearchset tabstop=3set shiftwidth=3map <f12> :!ruby.exe % <cr>map <f7>  :nerdtree <cr>let tlist_use_right_window = 1let tlist_sort_type = 'name'let tlist_auto_open = 1let tlist_show_one_file = 1   "let nerdcominsertmap='<c-c>':set nowrap" 显示tab符 "set listchars=tab:/|/,tirail:.,extends:> "set list "编辑vim配置文件 if has('unix')     set fileformats=unix,dos,mac     nmap <leader>e :tabnew $home/.vimrc<cr>     let $vimfiles = $home.'/.vim'  else    set fileformats=dos,unix,mac     nmap <leader>e :tabnew $vim/_vimrc<cr>     let $vimfiles = $vim.'/vimfiles' endiffiletype plugin indent on   " 开启插件 set hlsearch"set foldmethod=indent " {{{ plugin - mru.vim 记录最近打开的文件 let mru_file = $vimfiles.'/_vim_mru_files' let mru_max_entries = 1000 let mru_add_menu = 0 nmap <leader>f :mru<cr> " }}} set tags=tags;set autochdirfunction closepair(char)	if getline('.')[col('.') - 1] == a:char		return "\<right>"	else		return a:charendifendfunction:inoremap ( ()<esc>i:inoremap ) <c-r>=closepair(')')<cr>:inoremap { {}<esc>i:inoremap } <c-r>=closepair('}')<cr>:inoremap [ []<esc>i:inoremap ] <c-r>=closepair(']')<cr>":inoremap < <><esc>i":inoremap > <c-r>=closepair('>')<cr>:inoremap " ""<esc>i:inoremap ' ''<esc>i:inoremap ;re <%=  %><esc>2hi:inoremap ;r  <%   %><esc>2hi:inoremap ;for for   <cr>end <esc>k2li:inoremap ;< < > <esc>2hi:inoremap ;> </ > <esc>2hi:inoremap ;htb <table  ><cr>    <tr><cr>    <td><cr></td> <cr> <esc> 6hi </tr> <cr> <esc> 7hi  </table> <esc>5khi:inoremap ;hdiv <div  ><cr></div><esc>ki:inoremap ;hsp  <span  ><cr></span><esc>ki:inoremap ;htd  <td  ><cr></td><esc>ki:inoremap ;hth  <th  ><cr></th><esc>ki:inoremap ;htr  <tr  ><cr></tr><esc>ki:inoremap ;hp  <p  ><cr></p><esc>ki:inoremap ;hb  <b  ><cr></b><esc>ki:inoremap ;hh1  <h1  ><cr></h1><esc>ki:inoremap ;hh2  <h2  ><cr></h2><esc>ki:inoremap ;hh3  <h3  ><cr></h3><esc>ki:inoremap ;hh4  <h4  ><cr></h4><esc>ki:inoremap ;hh5  <h5  ><cr></h5><esc>ki:inoremap ;hbr  <br/><cr>:inoremap ;hsrt  <script><cr><cr></script><esc>ki:inoremap ;bff  before_filter  <esc>i:inoremap ;bfs  before_save  <esc>i:inoremap ;afs  after_save  <esc>i:inoremap ;lia  <%= link_to "" ,:action=>"index" %>  <esc>23hi":inoremap ;if  if    end <esc>4hi":inoremap ;each  each do  | |   end <esc>6hi":inoremap ;def def    end <esc>4hi":inoremap for for   end <esc>4hi":inoremap <buffer> ;% <%  %><esc>1hi":inoremap <buffer> ;= <%=  %><esc>2hi":inoremap <buffer> ;e <cr><bs>end":inoremap <buffer> ;d <cr><bs>def" 设置注释vmap <f2> <esc><esc>:call enhancedcommentify('yes','comment',line("'<"),line("'>"))<cr>" 取消注释vmap <f3> <esc><esc>:call enhancedcommentify('yes','decomment',line("'<"),line("'>"))<cr>au bufread,bufnewfile jquery.*.js set ft=javascript syntax=jquery" 把 ctrl-s 映射为 保存,因为这个操作做得太习惯了  imap <c-s> <c-c>:w<cr>map <f6> <esc><esc>:tlistopen<cr>:command rc rcontroller"set foldmethod=syntaxset noerrorbellsset confirmfiletype indent onset nobackupsetlocal noswapfileset bufhidden=hideset whichwrap+=<,>,h,l" 可以在buffer的任何地方使用鼠标(类似office中在工作区双击鼠标定位)set mouse=aset selection=exclusiveset selectmode=mouse,key" 通过使用: commands命令,告诉我们文件的哪一行被改变过set report=0" 高亮显示匹配的括号set showmatch" 匹配括号高亮的时间(单位是十分之一秒)set matchtime=5" 在搜索的时候忽略大小写set ignorecase" 不要闪烁set novisualbell" 总是显示状态行set laststatus=2" 自动格式化set formatoptions=tcrqn" 继承前一行的缩进方式,特别适用于多行注释set autoindent" 为c程序提供自动缩进set smartindent" 使用c样式的缩进set cindent" 不要用空格代替制表符set noexpandtab" 不要换行set nowrap" 在行和段开始处使用制表符set smarttab"解决乱码问题"set encoding=utf-8""set encoding=utf-8"set langmenu=zh_cn.utf-8"language message zh_cn.utf-8set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,latin1 " 如果你要打开的文件编码不在此列,那就添加进去"set termencoding=utf-8set encoding=utf-8 "set fileencodings=utf-8,chinese,latin-1 ""if has("win32") ""set fileencoding=chinese ""else ""set fileencoding=utf-8 ""endif "解决菜单乱码 source $vimruntime/delmenu.vim source $vimruntime/menu.vim "解决consle输出乱码 language messages zh_cn.utf-8"把gvim的菜单和工具栏隐藏掉,按f2可调出,再按隐藏   set guioptions-=m   set guioptions-=t   map <silent> <f4> :if &guioptions =~# 't' <bar>  			\set guioptions-=t <bar>  			\set guioptions-=m <bar>  	  \else <bar>  			\set guioptions =t <bar>  			\set guioptions =m <bar>  	  \endif<cr>  map <f11> <esc>:call libcallnr("gvimfullscreen.dll", "togglefullscreen", 0)<cr> if has("autocmd")filetype plugin indent onautocmd filetype python set omnifunc=pythoncomplete#completeautocmd filetype ruby set omnifunc=rubycomplete#completeautocmd filetype c set omnifunc=ccomplete#completeautocmd filetype ada set omnifunc=adacomplete#completeautocmd filetype php set omnifunc=phpcomplete#completephpautocmd filetype javascript set omnifunc=javascriptcomplete#completejsautocmd filetype html set omnifunc=htmlcomplete#completetagsautocmd filetype erb set omnifunc=htmlcomplete#completetagsautocmd filetype css set omnifunc=csscomplete#completecssautocmd filetype xml set omnifunc=xmlcomplete#completetagsautocmd filetype sql set omnifunc=sqlcomplete#completeendif
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值