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
分享到:
相关推荐
看看 我最喜欢的编辑器 vim 配上插件 开发起来太棒了。好东西大家一起分享一下。
vim+supertab+neocomplcache+doxygentoolkit+ctags搭建linux下c开发的强大VIM-IDE,功能:语法高亮,自动补全,快速查找变量位置,快速添加注释,etc.
使用本文件可以把vim配置成强大的IDE,但是必须使用VIM8.0以上的版本。首先将本文件内容copy到~/.vimrc里,如果没有该文件需要创建;其次git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/...
这是一款vim7.4中修改的护眼配方案文件mycolor.vim,安装方法是:将文件复制到vim安装目录的colors目录内,启动后,就可以切换到这个方案中。 更多的介绍可以参考我的博客:
vim 配 置 文 件 + 常 用 插 件 应 该 是 很 全 的
自己配的vim,很好用,得先下载winmanager,taglist,cscrop,ctags等工具配合来用,可以像vs一样的效果
Vim 是一款功能丰富而强大的文本编辑器,其代码补全、编译及错误跳转等方便编程的功能特别丰富,在程序员中得到非常广泛的使用。Vim 能够大大提高程序员的工作效率。对于 Vim 高手来说,Vim 能以与思考同步的速度...
vim的资源文件,解压后,将其中的.vim文件夹放入到你的/Home目录下,里面一般的vim插件都有了,如还想要其他的可以下载对应的vim插件,放...我自己配的vim的配置文件 http://download.csdn.net/detail/kernlen/7867533
vim 7.3 按装完成php插件 超配配色 将ctags.exe复制到windows目录中
这个vim配置文件实现文本高亮显示,可编译运行C/C++程序,可以一键GDB调试,可以作为一个简易C/C++ IDE编译器,具有函数和变量声明跟踪,方便查看调试代码。
vim 实用技巧 和 配置代码
macOS Sierra系统安装/配置Vim及常见问题记录,如遇到同类问题,可做参考。
linux vim编辑器教程,让你快速掌握linux vim的相关操作指令
vim的配件文档,里面很详细的描述了vim的各种配置。
自己用的配置文件,下载就可以直接用,从国外大神借鉴的
tar -xf vim.tar -C ~ vim /etc/vimrc vim /root/.vimrc set ts=4 设置tab有多少空格 set ai 自动对齐 set nu set mouse=a set shiftwidth=4 shift + . 向左向右缩进 shift + , jklh ,cs 性感的注释 ...
vim简介,某培训机构的配套文档,既可以用于学习,也可以用于工作,涉及到linux管理的各个方面,文档超清晰,掌握以后开源成为linux高手。
vim的快捷键和常用插件都已配好。。 支持cscope ctag,扩展工具栏,支持各类代码跳转查看。可以完全替代sourceinsight 支持自动编译输出窗口 支持代码符号定义快速预览窗口,需要生成完cscope数据库,按Fx键启用...
最新ctags-5.8源码包,用于和vim搭配使用,实现在vim中通过点击函数名迅速查找函数的定义。
史上最NB的VIM配置文件,具体用法请看配文件