├── .vim ├── bundle │ └── Vundle.vim │ │ ├── .gitignore │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE-MIT.txt │ │ ├── README.md │ │ ├── README_ZH_CN.md │ │ ├── README_ZH_TW.md │ │ ├── autoload │ │ ├── vundle.vim │ │ └── vundle │ │ │ ├── config.vim │ │ │ ├── installer.vim │ │ │ └── scripts.vim │ │ ├── changelog.md │ │ ├── doc │ │ └── vundle.txt │ │ ├── ftplugin │ │ └── vundlelog.vim │ │ ├── syntax │ │ └── vundlelog.vim │ │ └── test │ │ ├── files │ │ └── test.erl │ │ ├── minirc.vim │ │ └── vimrc └── custom │ ├── ale.vim │ ├── colorizer.vim │ ├── easyalign.vim │ ├── gui.vim │ ├── maps.vim │ ├── nerdtree.vim │ ├── tagbar.vim │ ├── theme.vim │ ├── tmux.vim │ └── vundle.vim ├── .vimrc ├── README.md └── code └── ruby ├── ar.rb ├── item.rb ├── pedido.rb └── teste.rb /.vim/bundle/Vundle.vim/.gitignore: -------------------------------------------------------------------------------- 1 | doc/tags 2 | .netrwhist 3 | -------------------------------------------------------------------------------- /.vim/bundle/Vundle.vim/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Pull Requests 2 | ============= 3 | 4 | 1. Please squash your commits to minimize the log pollution. This is more of a convenience for the maintainer who pulls. If you are unfamiliar, see [here](http://ariejan.net/2011/07/05/git-squash-your-latests-commits-into-one/). 5 | 6 | 2. Clearly describe what you aim to fix or add to Vundle. 7 | 8 | 3. Try to minimize code changes and use existing style/functions. 9 | 10 | Issues 11 | ====== 12 | 13 | ## Check For Answers 14 | 15 | Before submitting an issue, be sure to check the following places for answers. 16 | 17 | 1. Vundle docs at [`:h vundle`](https://github.com/VundleVim/Vundle.vim/blob/master/doc/vundle.txt). 18 | 19 | 2. The [FAQ](https://github.com/VundleVim/Vundle.vim/wiki). 20 | 21 | 3. [Search](https://github.com/VundleVim/Vundle.vim/search) the repository for related issues. 22 | 23 | ## Try To Eliminate Your Vimrc 24 | 25 | In order to make sure it isn't just `.vimrc` replace your own config file with the [minimal vimrc](https://github.com/VundleVim/Vundle.vim/blob/master/test/minirc.vim). Clear out bundles and then try to reproduce. 26 | 27 | If the problem stops, likely there is an issue in your user configuration. You can incrementally add back your user changes to the minimal file testing the bug each time. This will allow you to slowly bisect the issue. You may want to test one plugin at a time. 28 | 29 | If you can still reproduce the problem, try to find the smallest `.vimrc` config file that creates the problem to include later. 30 | 31 | ## Guidelines 32 | 33 | To better respond to issues please follow these general guidelines when explaining the problem. 34 | 35 | 1. Clearly describe what the error is, if relevant attach output/screenshots. 36 | 37 | 2. Describe how developers can reproduce the bug, the steps should be from starting Vim. 38 | 39 | 3. Include your OS, version and architecture. For example, Windows 7 64, Kubuntu 13.04 32, etc... 40 | 41 | 4. If relevant to reproducing the bug, include the smallest subset of your `.vimrc` that causes the issue. Put this in code tags. 42 | 43 | 5. At the end of your issue, please put the output of `vim --version` in code tags. 44 | 45 | ## Example Post 46 | 47 | I am using Vim on Kubuntu 13.04 64 bit and I get the following error... (add further explanation here) 48 | 49 | To reproduce the bug, use the vimrc file below and run `:PluginInstall`... (continue with steps) 50 | 51 | Vimrc: 52 | ``` 53 | set nocompatible 54 | syntax on 55 | filetype off 56 | set rtp+=~/.vim/bundle/Vundle.vim/ 57 | call vundle#rc() 58 | Plugin 'VundleVim/Vundle.vim' 59 | Plugin 'relevant/plugin' 60 | filetype plugin indent on 61 | 62 | .... more user configs here... 63 | ``` 64 | 65 | Vim Version: 66 | ``` 67 | VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 15 2013 10:58:39) 68 | Included patches: 1-5 69 | Modified by pkg-vim-maintainers@lists.alioth.debian.org 70 | Compiled by buildd@ 71 | Huge version with GTK2 GUI. Features included (+) or not (-): 72 | +arabic +file_in_path +mouse_sgr +tag_binary 73 | +autocmd +find_in_path -mouse_sysmouse +tag_old_static 74 | +balloon_eval +float +mouse_urxvt -tag_any_white 75 | +browse +folding +mouse_xterm +tcl 76 | ++builtin_terms -footer +multi_byte +terminfo 77 | +byte_offset +fork() +multi_lang +termresponse 78 | +cindent +gettext -mzscheme +textobjects 79 | +clientserver -hangul_input +netbeans_intg +title 80 | +clipboard +iconv +path_extra +toolbar 81 | +cmdline_compl +insert_expand +perl +user_commands 82 | +cmdline_hist +jumplist +persistent_undo +vertsplit 83 | +cmdline_info +keymap +postscript +virtualedit 84 | +comments +langmap +printer +visual 85 | +conceal +libcall +profile +visualextra 86 | +cryptv +linebreak +python +viminfo 87 | +cscope +lispindent -python3 +vreplace 88 | +cursorbind +listcmds +quickfix +wildignore 89 | +cursorshape +localmap +reltime +wildmenu 90 | +dialog_con_gui +lua +rightleft +windows 91 | +diff +menu +ruby +writebackup 92 | +digraphs +mksession +scrollbind +X11 93 | +dnd +modify_fname +signs -xfontset 94 | -ebcdic +mouse +smartindent +xim 95 | +emacs_tags +mouseshape -sniff +xsmp_interact 96 | +eval +mouse_dec +startuptime +xterm_clipboard 97 | +ex_extra +mouse_gpm +statusline -xterm_save 98 | +extra_search -mouse_jsbterm -sun_workshop 99 | +farsi +mouse_netterm +syntax 100 | system vimrc file: "$VIM/vimrc" 101 | user vimrc file: "$HOME/.vimrc" 102 | 2nd user vimrc file: "~/.vim/vimrc" 103 | user exrc file: "$HOME/.exrc" 104 | system gvimrc file: "$VIM/gvimrc" 105 | user gvimrc file: "$HOME/.gvimrc" 106 | 2nd user gvimrc file: "~/.vim/gvimrc" 107 | system menu file: "$VIMRUNTIME/menu.vim" 108 | fall-back for $VIM: "/usr/share/vim" 109 | Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/harfbuzz -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -I/usr/include/tcl8.5 -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_LARGEFILE64_SOURCE=1 110 | Linking: gcc -L. -Wl,-Bsymbolic-functions -Wl,-z,relro -rdynamic -Wl,-export-dynamic -Wl,-E -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,--as-needed -o vim -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lglib-2.0 -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE -lm -ltinfo -lnsl -lselinux -lacl -lattr -lgpm -ldl -L/usr/lib -llua5.1 -Wl,-E -fstack-protector -L/usr/local/lib -L/usr/lib/perl/5.14/CORE -lperl -ldl -lm -lpthread -lcrypt -L/usr/lib/python2.7/config-x86_64-linux-gnu -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -L/usr/lib/x86_64-linux-gnu -ltcl8.5 -ldl -lpthread -lieee -lm -lruby-1.9.1 -lpthread -lrt -ldl -lcrypt -lm -L/usr/lib 111 | ``` 112 | -------------------------------------------------------------------------------- /.vim/bundle/Vundle.vim/LICENSE-MIT.txt: -------------------------------------------------------------------------------- 1 | Copyright (C) 2010 http://github.com/gmarik 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /.vim/bundle/Vundle.vim/README.md: -------------------------------------------------------------------------------- 1 | ## [Help Maintain Vundle](https://github.com/VundleVim/Vundle.vim/issues/383) 2 | 3 | ## About 4 | 5 | [Vundle] is short for _Vim bundle_ and is a [Vim] plugin manager. 6 | 7 | [Vundle] allows you to... 8 | 9 | * keep track of and [configure] your plugins right in the `.vimrc` 10 | * [install] configured plugins (a.k.a. scripts/bundle) 11 | * [update] configured plugins 12 | * [search] by name all available [Vim scripts] 13 | * [clean] unused plugins up 14 | * run the above actions in a *single keypress* with [interactive mode] 15 | 16 | [Vundle] automatically... 17 | 18 | * manages the [runtime path] of your installed scripts 19 | * regenerates [help tags] after installing and updating 20 | 21 | [Vundle] is undergoing an [interface change], please stay up to date to get latest changes. 22 | 23 | [![Gitter-chat](https://badges.gitter.im/VundleVim/Vundle.vim.svg)](https://gitter.im/VundleVim/Vundle.vim) for discussion and support. 24 | 25 | ![Vundle-installer](http://i.imgur.com/Rueh7Cc.png) 26 | 27 | ## Quick Start 28 | 29 | 1. Introduction: 30 | 31 | Installation requires [Git] and triggers [`git clone`] for each configured repository to `~/.vim/bundle/` by default. 32 | Curl is required for search. 33 | 34 | If you are using Windows, go directly to [Windows setup]. If you run into any issues, please consult the [FAQ]. 35 | See [Tips] for some advanced configurations. 36 | 37 | Using non-POSIX shells, such as the popular Fish shell, requires additional setup. Please check the [FAQ]. 38 | 39 | 2. Set up [Vundle]: 40 | 41 | `$ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim` 42 | 43 | 3. Configure Plugins: 44 | 45 | Put this at the top of your `.vimrc` to use Vundle. Remove plugins you don't need, they are for illustration purposes. 46 | 47 | ```vim 48 | set nocompatible " be iMproved, required 49 | filetype off " required 50 | 51 | " set the runtime path to include Vundle and initialize 52 | set rtp+=~/.vim/bundle/Vundle.vim 53 | call vundle#begin() 54 | " alternatively, pass a path where Vundle should install plugins 55 | "call vundle#begin('~/some/path/here') 56 | 57 | " let Vundle manage Vundle, required 58 | Plugin 'VundleVim/Vundle.vim' 59 | 60 | " The following are examples of different formats supported. 61 | " Keep Plugin commands between vundle#begin/end. 62 | " plugin on GitHub repo 63 | Plugin 'tpope/vim-fugitive' 64 | " plugin from http://vim-scripts.org/vim/scripts.html 65 | Plugin 'L9' 66 | " Git plugin not hosted on GitHub 67 | Plugin 'git://git.wincent.com/command-t.git' 68 | " git repos on your local machine (i.e. when working on your own plugin) 69 | Plugin 'file:///home/gmarik/path/to/plugin' 70 | " The sparkup vim script is in a subdirectory of this repo called vim. 71 | " Pass the path to set the runtimepath properly. 72 | Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} 73 | " Install L9 and avoid a Naming conflict if you've already installed a 74 | " different version somewhere else. 75 | Plugin 'ascenator/L9', {'name': 'newL9'} 76 | 77 | " All of your Plugins must be added before the following line 78 | call vundle#end() " required 79 | filetype plugin indent on " required 80 | " To ignore plugin indent changes, instead use: 81 | "filetype plugin on 82 | " 83 | " Brief help 84 | " :PluginList - lists configured plugins 85 | " :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate 86 | " :PluginSearch foo - searches for foo; append `!` to refresh local cache 87 | " :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal 88 | " 89 | " see :h vundle for more details or wiki for FAQ 90 | " Put your non-Plugin stuff after this line 91 | ``` 92 | 93 | 4. Install Plugins: 94 | 95 | Launch `vim` and run `:PluginInstall` 96 | 97 | To install from command line: `vim +PluginInstall +qall` 98 | 99 | ## Docs 100 | 101 | See the [`:h vundle`](https://github.com/VundleVim/Vundle.vim/blob/master/doc/vundle.txt) Vimdoc for more details. 102 | 103 | ## Changelog 104 | 105 | See the [changelog](https://github.com/VundleVim/Vundle.vim/blob/master/changelog.md). 106 | 107 | ## People Using Vundle 108 | 109 | see [Examples](https://github.com/VundleVim/Vundle.vim/wiki/Examples) 110 | 111 | ## Contributors 112 | 113 | see [Vundle contributors](https://github.com/VundleVim/Vundle.vim/graphs/contributors) 114 | 115 | *Thank you!* 116 | 117 | ## Inspiration & Ideas 118 | 119 | * [pathogen.vim](http://github.com/tpope/vim-pathogen/) 120 | * [Bundler](https://github.com/bundler/bundler) 121 | * [Scott Bronson](http://github.com/bronson) 122 | 123 | ## Also 124 | 125 | * Vundle was developed and tested with [Vim] 7.3 on OS X, Linux and Windows 126 | * Vundle tries to be as [KISS](http://en.wikipedia.org/wiki/KISS_principle) as possible 127 | 128 | ## TODO: 129 | [Vundle] is a work in progress, so any ideas and patches are appreciated. 130 | 131 | * [x] activate newly added bundles on `.vimrc` reload or after `:PluginInstall` 132 | * [x] use preview window for search results 133 | * [x] Vim documentation 134 | * [x] put Vundle in `bundles/` too (will fix Vundle help) 135 | * [x] tests 136 | * [x] improve error handling 137 | * [ ] allow specifying revision/version? 138 | * [ ] handle dependencies 139 | * [ ] show description in search results 140 | * [ ] search by description as well 141 | * [ ] make it rock! 142 | 143 | [Vundle]:http://github.com/VundleVim/Vundle.vim 144 | [Windows setup]:https://github.com/VundleVim/Vundle.vim/wiki/Vundle-for-Windows 145 | [FAQ]:https://github.com/VundleVim/Vundle.vim/wiki 146 | [Tips]:https://github.com/VundleVim/Vundle.vim/wiki/Tips-and-Tricks 147 | [Vim]:http://www.vim.org 148 | [Git]:http://git-scm.com 149 | [`git clone`]:http://gitref.org/creating/#clone 150 | 151 | [Vim scripts]:http://vim-scripts.org/vim/scripts.html 152 | [help tags]:http://vimdoc.sourceforge.net/htmldoc/helphelp.html#:helptags 153 | [runtime path]:http://vimdoc.sourceforge.net/htmldoc/options.html#%27runtimepath%27 154 | 155 | [configure]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L126-L233 156 | [install]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L234-L254 157 | [update]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L255-L265 158 | [search]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L266-L295 159 | [clean]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L303-L318 160 | [interactive mode]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L319-L360 161 | [interface change]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L372-L396 162 | -------------------------------------------------------------------------------- /.vim/bundle/Vundle.vim/README_ZH_CN.md: -------------------------------------------------------------------------------- 1 | ## [帮助维护Vundle](https://github.com/VundleVim/Vundle.vim/issues/383) 2 | 3 | ## 关于 4 | 5 | [Vundle] 是 _Vim bundle_ 的简称,是一个 [Vim] 插件管理器. 6 | 7 | [Vundle] 允许你做... 8 | 9 | * 同时在`.vimrc`中跟踪和[管理](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L126-L233)插件 10 | * [安装](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L234-L254)特定格式的插件(a.k.a. scripts/bundle) 11 | * [更新](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L255-L265)特定格式插件 12 | * 通过插件名称[搜索](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L266-L295)[Vim scripts](http://vim-scripts.org/vim/scripts.html)中的插件 13 | * [清理](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L303-L318)未使用的插件 14 | * 可以通过*单一按键*完成以上操作,详见[interactive mode](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L319-L360) 15 | 16 | [Vundle] 自动完成... 17 | 18 | * 管理已安装插件的[runtime path](http://vimdoc.sourceforge.net/htmldoc/options.html#%27runtimepath%27) 19 | * 安装和更新后,重新生成[帮助标签](http://vimdoc.sourceforge.net/htmldoc/helphelp.html#:helptags) 20 | 21 | [Vundle] 正在经历一个 [interface change], 请通过以下方式获取最新信息. 22 | 23 | 讨论和技术支持:[![Gitter-chat](https://badges.gitter.im/VundleVim/Vundle.vim.svg)](https://gitter.im/VundleVim/Vundle.vim) 24 | 25 | ![Vundle-installer](http://i.imgur.com/Rueh7Cc.png) 26 | 27 | ## 快速开始 28 | 29 | 1. 介绍: 30 | 31 | 安装需要[Git](http://git-scm.com/),触发[`git clone`](http://gitref.org/creating/#clone),默认将每一个指定特定格式插件的仓库复制到`~/.vim/bundle/`. 32 | 搜索需要Curl支持. 33 | 34 | Windows用户请直接访问[Windows setup]. 如果有任何问题, 请参考 [FAQ]. 35 | 查看 [Tips] 获取相关高级配置. 36 | 37 | 使用 non-POSIX shells, 比如比较流行对 Fish shell, 需要额外对步骤. 请查看 [FAQ]. 38 | 39 | 2. 初始安装 [Vundle]: 40 | 41 | `$ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim` 42 | 43 | 3. 配置插件 : 44 | 45 | 请将以下加在 `.vimrc` 方可使用Vundle. 删掉你不需要的插件, 这些只是用做示例. 46 | 47 | ```vim 48 | set nocompatible " 去除VI一致性,必须 49 | filetype off " 必须 50 | 51 | " 设置包括vundle和初始化相关的runtime path 52 | set rtp+=~/.vim/bundle/Vundle.vim 53 | call vundle#begin() 54 | " 另一种选择, 指定一个vundle安装插件的路径 55 | "call vundle#begin('~/some/path/here') 56 | 57 | " 让vundle管理插件版本,必须 58 | Plugin 'VundleVim/Vundle.vim' 59 | 60 | " 以下范例用来支持不同格式的插件安装. 61 | " 请将安装插件的命令放在vundle#begin和vundle#end之间. 62 | " Github上的插件 63 | " 格式为 Plugin '用户名/插件仓库名' 64 | Plugin 'tpope/vim-fugitive' 65 | " 来自 http://vim-scripts.org/vim/scripts.html 的插件 66 | " Plugin '插件名称' 实际上是 Plugin 'vim-scripts/插件仓库名' 只是此处的用户名可以省略 67 | Plugin 'L9' 68 | " 由Git支持但不再github上的插件仓库 Plugin 'git clone 后面的地址' 69 | Plugin 'git://git.wincent.com/command-t.git' 70 | " 本地的Git仓库(例如自己的插件) Plugin 'file:///+本地插件仓库绝对路径' 71 | Plugin 'file:///home/gmarik/path/to/plugin' 72 | " 插件在仓库的子目录中. 73 | " 正确指定路径用以设置runtimepath. 以下范例插件在sparkup/vim目录下 74 | Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} 75 | " 安装L9,如果已经安装过这个插件,可利用以下格式避免命名冲突 76 | Plugin 'ascenator/L9', {'name': 'newL9'} 77 | 78 | " 你的所有插件需要在下面这行之前 79 | call vundle#end() " 必须 80 | filetype plugin indent on " 必须 加载vim自带和插件相应的语法和文件类型相关脚本 81 | " 忽视插件改变缩进,可以使用以下替代: 82 | "filetype plugin on 83 | " 84 | " 简要帮助文档 85 | " :PluginList - 列出所有已配置的插件 86 | " :PluginInstall - 安装插件,追加 `!` 用以更新或使用 :PluginUpdate 87 | " :PluginSearch foo - 搜索 foo ; 追加 `!` 清除本地缓存 88 | " :PluginClean - 清除未使用插件,需要确认; 追加 `!` 自动批准移除未使用插件 89 | " 90 | " 查阅 :h vundle 获取更多细节和wiki以及FAQ 91 | " 将你自己对非插件片段放在这行之后 92 | ``` 93 | 94 | 4. 安装插件: 95 | 96 | 运行 `vim` 再运行 `:PluginInstall` 97 | 98 | 通过命令行直接安装 `vim +PluginInstall +qall` 99 | 100 | ## Docs 101 | 102 | 查阅 [`:h vundle`](https://github.com/VundleVim/Vundle.vim/blob/master/doc/vundle.txt) Vimdoc 以获取更多细节. 103 | 104 | ## 更新日志 105 | 106 | 查阅 [changelog](https://github.com/VundleVim/Vundle.vim/blob/master/changelog.md). 107 | 108 | ## 在使用此插件的用户的VIMRC 109 | 110 | 查阅 [Examples](https://github.com/VundleVim/Vundle.vim/wiki/Examples) 111 | 112 | ## 维护者 113 | 114 | 查阅 [Vundle contributors](https://github.com/VundleVim/Vundle.vim/graphs/contributors) 115 | 116 | *感谢!* 117 | 118 | ## 灵感 & 思路 119 | 120 | * [pathogen.vim](http://github.com/tpope/vim-pathogen/) 121 | * [Bundler](https://github.com/bundler/bundler) 122 | * [Scott Bronson](http://github.com/bronson) 123 | 124 | ## 另外 125 | 126 | * Vundle 已测试环境为: [Vim] 7.3 on OS X, Linux and Windows 127 | * Vundle 尝试尽可能保持至简模式 [KISS](http://en.wikipedia.org/wiki/KISS_principle) 128 | 129 | ## TODO: 130 | [Vundle] 是一个正在进步对项目, 所以很多设计思路和补丁是需要借鉴的. 131 | 132 | * ✓ 在重新载入或者执行`:PluginInstall`之后激活`.vimrc`中新添加的插件 133 | * ✓ 使用预览窗口显示搜索结果 134 | * ✓ Vim documentation 135 | * ✓ 同时将Vundle 放置在 `bundles/` 中 (将修复 Vundle 帮助) 136 | * ✓ 测试 137 | * ✓ 提升错误处理能力 138 | * 支持手动指定版本(待考虑) 139 | * 版本依赖 140 | * 搜索结果中显示描述 141 | * 同时支持通过描述搜索 142 | * 使其更加稳定! 143 | 144 | [Vundle]:http://github.com/VundleVim/Vundle.vim 145 | [Windows setup]:https://github.com/VundleVim/Vundle.vim/wiki/Vundle-for-Windows 146 | [FAQ]:https://github.com/VundleVim/Vundle.vim/wiki 147 | [Tips]:https://github.com/VundleVim/Vundle.vim/wiki/Tips-and-Tricks 148 | [Vim]:http://www.vim.org 149 | [Git]:http://git-scm.com 150 | [`git clone`]:http://gitref.org/creating/#clone 151 | 152 | [Vim scripts]:http://vim-scripts.org/vim/scripts.html 153 | [help tags]:http://vimdoc.sourceforge.net/htmldoc/helphelp.html#:helptags 154 | [runtime path]:http://vimdoc.sourceforge.net/htmldoc/options.html#%27runtimepath%27 155 | 156 | [configure]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L126-L233 157 | [install]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L234-L254 158 | [update]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L255-L265 159 | [search]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L266-L295 160 | [clean]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L303-L318 161 | [interactive mode]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L319-L360 162 | [interface change]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L372-L396 163 | -------------------------------------------------------------------------------- /.vim/bundle/Vundle.vim/README_ZH_TW.md: -------------------------------------------------------------------------------- 1 | ## [幫助維護Vundle](https://github.com/VundleVim/Vundle.vim/issues/383) 2 | 3 | ## 關於 4 | 5 | [Vundle] 是 _Vim bundle_ 的簡稱,是一個 [Vim] 插件管理器. 6 | 7 | [Vundle] 允許你做... 8 | 9 | * 同時在`.vimrc`中跟蹤和[管理](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L126-L233)插件 10 | * [安裝](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L234-L254)特定格式的插件(a.k.a. scripts/bundle) 11 | * [更新](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L255-L265)特定格式插件 12 | * 通過插件名稱[搜索](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L266-L295)[Vim scripts](http://vim-scripts.org/vim/scripts.html)中的插件 13 | * [清理](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L303-L318)未使用的插件 14 | * 可以通過*單一按鍵*完成以上操作,詳見[interactive mode](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L319-L360) 15 | 16 | [Vundle] 自動完成... 17 | 18 | * 管理已安裝插件的[runtime path](http://vimdoc.sourceforge.net/htmldoc/options.html#%27runtimepath%27) 19 | * 安裝和更新後,重新生成[幫助標簽](http://vimdoc.sourceforge.net/htmldoc/helphelp.html#:helptags) 20 | 21 | [Vundle] 正在經歷一個 [interface change], 請通過以下方式獲取最新信息. 22 | 23 | 討論和技術支持:[![Gitter-chat](https://badges.gitter.im/VundleVim/Vundle.vim.svg)](https://gitter.im/VundleVim/Vundle.vim) 24 | 25 | ![Vundle-installer](http://i.imgur.com/Rueh7Cc.png) 26 | 27 | ## 快速開始 28 | 29 | 1. 介紹: 30 | 31 | 安裝需要[Git](http://git-scm.com/),觸發[`git clone`](http://gitref.org/creating/#clone),默認將每一個指定特定格式插件的倉庫復制到`~/.vim/bundle/`. 32 | 搜索需要Curl支持. 33 | 34 | Windows用戶請直接訪問[Windows setup]. 如果有任何問題, 請參考 [FAQ]. 35 | 查看 [Tips] 獲取相關高級配置. 36 | 37 | 使用 non-POSIX shells, 比如比較流行對 Fish shell, 需要額外對步驟. 請查看 [FAQ]. 38 | 39 | 2. 初始安裝 [Vundle]: 40 | 41 | `$ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim` 42 | 43 | 3. 配置插件 : 44 | 45 | 請將以下加在 `.vimrc` 方可使用Vundle. 刪掉你不需要的插件, 這些只是用做示例. 46 | 47 | ```vim 48 | set nocompatible " 去除VI一致性,必須 49 | filetype off " 必須 50 | 51 | " 設置包括vundle和初始化相關的runtime path 52 | set rtp+=~/.vim/bundle/Vundle.vim 53 | call vundle#begin() 54 | " 另一種選擇, 指定一個vundle安裝插件的路徑 55 | "call vundle#begin('~/some/path/here') 56 | 57 | " 讓vundle管理插件版本,必須 58 | Plugin 'VundleVim/Vundle.vim' 59 | 60 | " 以下範例用來支持不同格式的插件安裝. 61 | " 請將安裝插件的命令放在vundle#begin和vundle#end之間. 62 | " Github上的插件 63 | " 格式為 Plugin '用戶名/插件倉庫名' 64 | Plugin 'tpope/vim-fugitive' 65 | " 來自 http://vim-scripts.org/vim/scripts.html 的插件 66 | " Plugin '插件名稱' 實際上是 Plugin 'vim-scripts/插件倉庫名' 只是此處的用戶名可以省略 67 | Plugin 'L9' 68 | " 由Git支持但不再github上的插件倉庫 Plugin 'git clone 後面的地址' 69 | Plugin 'git://git.wincent.com/command-t.git' 70 | " 本地的Git倉庫(例如自己的插件) Plugin 'file:///+本地插件倉庫絕對路徑' 71 | Plugin 'file:///home/gmarik/path/to/plugin' 72 | " 插件在倉庫的子目錄中. 73 | " 正確指定路徑用以設置runtimepath. 以下範例插件在sparkup/vim目錄下 74 | Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} 75 | " 安裝L9,如果已經安裝過這個插件,可利用以下格式避免命名衝突 76 | Plugin 'ascenator/L9', {'name': 'newL9'} 77 | 78 | " 你的所有插件需要在下面這行之前 79 | call vundle#end() " 必須 80 | filetype plugin indent on " 必須 加載vim自帶和插件相應的語法和文件類型相關腳本 81 | " 忽視插件改變縮進,可以使用以下替代: 82 | "filetype plugin on 83 | " 84 | " 簡要幫助文檔 85 | " :PluginList - 列出所有已配置的插件 86 | " :PluginInstall - 安裝插件,追加 `!` 用以更新或使用 :PluginUpdate 87 | " :PluginSearch foo - 搜索 foo ; 追加 `!` 清除本地緩存 88 | " :PluginClean - 清除未使用插件,需要確認; 追加 `!` 自動批准移除未使用插件 89 | " 90 | " 查閱 :h vundle 獲取更多細節和wiki以及FAQ 91 | " 將你自己對非插件片段放在這行之後 92 | ``` 93 | 94 | 4. 安裝插件: 95 | 96 | 運行 `vim` 再運行 `:PluginInstall` 97 | 98 | 通過命令行直接安裝 `vim +PluginInstall +qall` 99 | 100 | ## Docs 101 | 102 | 查閱 [`:h vundle`](https://github.com/VundleVim/Vundle.vim/blob/master/doc/vundle.txt) Vimdoc 以獲取更多細節. 103 | 104 | ## 更新日誌 105 | 106 | 查閱 [changelog](https://github.com/VundleVim/Vundle.vim/blob/master/changelog.md). 107 | 108 | ## 在使用此插件的用戶的VIMRC 109 | 110 | 查閱 [Examples](https://github.com/VundleVim/Vundle.vim/wiki/Examples) 111 | 112 | ## 維護者 113 | 114 | 查閱 [Vundle contributors](https://github.com/VundleVim/Vundle.vim/graphs/contributors) 115 | 116 | *感謝!* 117 | 118 | ## 靈感 & 思路 119 | 120 | * [pathogen.vim](http://github.com/tpope/vim-pathogen/) 121 | * [Bundler](https://github.com/bundler/bundler) 122 | * [Scott Bronson](http://github.com/bronson) 123 | 124 | ## 另外 125 | 126 | * Vundle 已測試環境為: [Vim] 7.3 on OS X, Linux and Windows 127 | * Vundle 嘗試盡可能保持至簡模式 [KISS](http://en.wikipedia.org/wiki/KISS_principle) 128 | 129 | ## TODO: 130 | [Vundle] 是一個正在進步對項目, 所以很多設計思路和補丁是需要借鑒的. 131 | 132 | * ✓ 在重新載入或者執行`:PluginInstall`之後激活`.vimrc`中新添加的插件 133 | * ✓ 使用預覽窗口顯示搜索結果 134 | * ✓ Vim documentation 135 | * ✓ 同時將Vundle 放置在 `bundles/` 中 (將修復 Vundle 幫助) 136 | * ✓ 測試 137 | * ✓ 提升錯誤處理能力 138 | * 支持手動指定版本(待考慮) 139 | * 版本依賴 140 | * 搜索結果中顯示描述 141 | * 同時支持通過描述搜索 142 | * 使其更加穩定! 143 | 144 | [Vundle]:http://github.com/VundleVim/Vundle.vim 145 | [Windows setup]:https://github.com/VundleVim/Vundle.vim/wiki/Vundle-for-Windows 146 | [FAQ]:https://github.com/VundleVim/Vundle.vim/wiki 147 | [Tips]:https://github.com/VundleVim/Vundle.vim/wiki/Tips-and-Tricks 148 | [Vim]:http://www.vim.org 149 | [Git]:http://git-scm.com 150 | [`git clone`]:http://gitref.org/creating/#clone 151 | 152 | [Vim scripts]:http://vim-scripts.org/vim/scripts.html 153 | [help tags]:http://vimdoc.sourceforge.net/htmldoc/helphelp.html#:helptags 154 | [runtime path]:http://vimdoc.sourceforge.net/htmldoc/options.html#%27runtimepath%27 155 | 156 | [configure]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L126-L233 157 | [install]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L234-L254 158 | [update]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L255-L265 159 | [search]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L266-L295 160 | [clean]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L303-L318 161 | [interactive mode]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L319-L360 162 | [interface change]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L372-L396 163 | -------------------------------------------------------------------------------- /.vim/bundle/Vundle.vim/autoload/vundle.vim: -------------------------------------------------------------------------------- 1 | " Vundle is a shortcut for Vim Bundle and Is a simple plugin manager for Vim 2 | " Author: gmarik 3 | " HomePage: http://github.com/VundleVim/Vundle.vim 4 | " Readme: http://github.com/VundleVim/Vundle.vim/blob/master/README.md 5 | " Version: 0.10.2 6 | 7 | " Plugin Commands 8 | com! -nargs=+ -bar Plugin 9 | \ call vundle#config#bundle() 10 | 11 | com! -nargs=* -bang -complete=custom,vundle#scripts#complete PluginInstall 12 | \ call vundle#installer#new('!' == '', ) 13 | 14 | com! -nargs=? -bang -complete=custom,vundle#scripts#complete PluginSearch 15 | \ call vundle#scripts#all('!' == '', ) 16 | 17 | com! -nargs=0 -bang PluginList 18 | \ call vundle#installer#list('!' == '') 19 | 20 | com! -nargs=? -bang PluginClean 21 | \ call vundle#installer#clean('!' == '') 22 | 23 | com! -nargs=0 PluginDocs 24 | \ call vundle#installer#helptags(g:vundle#bundles) 25 | 26 | " Aliases 27 | com! -nargs=* -complete=custom,vundle#scripts#complete PluginUpdate PluginInstall! 28 | 29 | " Vundle Aliases 30 | com! -nargs=? -bang -complete=custom,vundle#scripts#complete VundleInstall PluginInstall 31 | com! -nargs=? -bang -complete=custom,vundle#scripts#complete VundleSearch PluginSearch 32 | com! -nargs=? -bang VundleClean PluginClean 33 | com! -nargs=0 VundleDocs PluginDocs 34 | com! VundleUpdate PluginInstall! 35 | com! -nargs=* -complete=custom,vundle#scripts#complete VundleUpdate PluginInstall! 36 | 37 | " Deprecated Commands 38 | com! -nargs=+ Bundle call vundle#config#bundle() 39 | com! -nargs=? -bang -complete=custom,vundle#scripts#complete BundleInstall PluginInstall 40 | com! -nargs=? -bang -complete=custom,vundle#scripts#complete BundleSearch PluginSearch 41 | com! -nargs=0 -bang BundleList PluginList 42 | com! -nargs=? -bang BundleClean PluginClean 43 | com! -nargs=0 BundleDocs PluginDocs 44 | com! BundleUpdate PluginInstall! 45 | 46 | " Set up the signs used in the installer window. (See :help signs) 47 | if (has('signs')) 48 | sign define Vu_error text=! texthl=Error 49 | sign define Vu_active text=> texthl=Comment 50 | sign define Vu_todate text=. texthl=Comment 51 | sign define Vu_new text=+ texthl=Comment 52 | sign define Vu_updated text=* texthl=Comment 53 | sign define Vu_deleted text=- texthl=Comment 54 | sign define Vu_helptags text=* texthl=Comment 55 | sign define Vu_pinned text== texthl=Comment 56 | endif 57 | 58 | " Set up Vundle. This function has to be called from the users vimrc file. 59 | " This will force Vim to source this file as a side effect which wil define 60 | " the :Plugin command. After calling this function the user can use the 61 | " :Plugin command in the vimrc. It is not possible to do this automatically 62 | " because when loading the vimrc file no plugins where loaded yet. 63 | func! vundle#rc(...) abort 64 | if a:0 > 0 65 | let g:vundle#bundle_dir = expand(a:1, 1) 66 | endif 67 | call vundle#config#init() 68 | endf 69 | 70 | " Alternative to vundle#rc, offers speed up by modifying rtp only when end() 71 | " called later. 72 | func! vundle#begin(...) abort 73 | let g:vundle#lazy_load = 1 74 | call call('vundle#rc', a:000) 75 | endf 76 | 77 | " Finishes putting plugins on the rtp. 78 | func! vundle#end(...) abort 79 | unlet g:vundle#lazy_load 80 | call vundle#config#activate_bundles() 81 | endf 82 | 83 | " Initialize some global variables used by Vundle. 84 | let vundle#bundle_dir = expand('$HOME/.vim/bundle', 1) 85 | let vundle#bundles = [] 86 | let vundle#lazy_load = 0 87 | let vundle#log = [] 88 | let vundle#updated_bundles = [] 89 | 90 | " vim: set expandtab sts=2 ts=2 sw=2 tw=78 norl: 91 | -------------------------------------------------------------------------------- /.vim/bundle/Vundle.vim/autoload/vundle/config.vim: -------------------------------------------------------------------------------- 1 | " --------------------------------------------------------------------------- 2 | " Add a plugin to the runtimepath. 3 | " 4 | " arg -- a string specifying the plugin 5 | " ... -- a dictionary of options for the plugin 6 | " return -- the return value from vundle#config#init_bundle() 7 | " --------------------------------------------------------------------------- 8 | func! vundle#config#bundle(arg, ...) 9 | let bundle = vundle#config#init_bundle(a:arg, a:000) 10 | if !s:check_bundle_name(bundle) 11 | return 12 | endif 13 | if exists('g:vundle#lazy_load') && g:vundle#lazy_load 14 | call add(g:vundle#bundles, bundle) 15 | else 16 | call s:rtp_rm_a() 17 | call add(g:vundle#bundles, bundle) 18 | call s:rtp_add_a() 19 | call s:rtp_add_defaults() 20 | endif 21 | return bundle 22 | endf 23 | 24 | 25 | " --------------------------------------------------------------------------- 26 | " When lazy bundle load is used (begin/end functions), add all configured 27 | " bundles to runtimepath and reorder appropriately. 28 | " --------------------------------------------------------------------------- 29 | func! vundle#config#activate_bundles() 30 | call s:rtp_add_a() 31 | call s:rtp_add_defaults() 32 | endf 33 | 34 | 35 | " --------------------------------------------------------------------------- 36 | " Initialize Vundle. 37 | " 38 | " Start a new bundles list and make sure the runtimepath does not contain 39 | " directories from a previous call. In theory, this should only be called 40 | " once. 41 | " --------------------------------------------------------------------------- 42 | func! vundle#config#init() 43 | if !exists('g:vundle#bundles') | let g:vundle#bundles = [] | endif 44 | call s:rtp_rm_a() 45 | let g:vundle#bundles = [] 46 | let s:bundle_names = {} 47 | endf 48 | 49 | 50 | " --------------------------------------------------------------------------- 51 | " Add a list of bundles to the runtimepath and source them. 52 | " 53 | " bundles -- a list of bundle objects 54 | " --------------------------------------------------------------------------- 55 | func! vundle#config#require(bundles) abort 56 | for b in a:bundles 57 | call s:rtp_add(b.rtpath) 58 | call s:rtp_add(g:vundle#bundle_dir) 59 | " TODO: it has to be relative rtpath, not bundle.name 60 | exec 'runtime! '.b.name.'/plugin/*.vim' 61 | exec 'runtime! '.b.name.'/after/*.vim' 62 | call s:rtp_rm(g:vundle#bundle_dir) 63 | endfor 64 | call s:rtp_add_defaults() 65 | endf 66 | 67 | 68 | " --------------------------------------------------------------------------- 69 | " Create a bundle object from a bundle specification. 70 | " 71 | " name -- the bundle specification as a string 72 | " opts -- the options dictionary from then bundle definition 73 | " return -- an initialized bundle object 74 | " --------------------------------------------------------------------------- 75 | func! vundle#config#init_bundle(name, opts) 76 | if a:name != substitute(a:name, '^\s*\(.\{-}\)\s*$', '\1', '') 77 | echo "Spurious leading and/or trailing whitespace found in plugin spec '" . a:name . "'" 78 | endif 79 | let opts = extend(s:parse_options(a:opts), s:parse_name(substitute(a:name,"['".'"]\+','','g')), 'keep') 80 | let b = extend(opts, copy(s:bundle)) 81 | let b.rtpath = s:rtpath(opts) 82 | return b 83 | endf 84 | 85 | 86 | " --------------------------------------------------------------------------- 87 | " Check if the current bundle name has already been used in this running 88 | " instance and show an error to that effect. 89 | " 90 | " bundle -- a bundle object whose name is to be checked 91 | " return -- 0 if the bundle's name has been seen before, 1 otherwise 92 | " --------------------------------------------------------------------------- 93 | funct! s:check_bundle_name(bundle) 94 | if has_key(s:bundle_names, a:bundle.name) 95 | echoerr 'Vundle error: Name collision for Plugin ' . a:bundle.name_spec . 96 | \ '. Plugin ' . s:bundle_names[a:bundle.name] . 97 | \ ' previously used the name "' . a:bundle.name . '"' . 98 | \ '. Skipping Plugin ' . a:bundle.name_spec . '.' 99 | return 0 100 | elseif a:bundle.name !~ '\v^[A-Za-z0-9_-]%(\.?[A-Za-z0-9_-])*$' 101 | echoerr 'Invalid plugin name: ' . a:bundle.name 102 | return 0 103 | endif 104 | let s:bundle_names[a:bundle.name] = a:bundle.name_spec 105 | return 1 106 | endf 107 | 108 | 109 | " --------------------------------------------------------------------------- 110 | " Parse the options which can be supplied with the bundle specification. 111 | " Corresponding documentation: vundle-plugins-configure 112 | " 113 | " opts -- a dictionary with the user supplied options for the bundle 114 | " return -- a dictionary with the user supplied options for the bundle, this 115 | " will be merged with a s:bundle object into one dictionary. 116 | " --------------------------------------------------------------------------- 117 | func! s:parse_options(opts) 118 | " TODO: improve this 119 | if len(a:opts) != 1 | return {} | endif 120 | 121 | if type(a:opts[0]) == type({}) 122 | return a:opts[0] 123 | else 124 | return {'rev': a:opts[0]} 125 | endif 126 | endf 127 | 128 | 129 | " --------------------------------------------------------------------------- 130 | " Parse the plugin specification. Corresponding documentation: 131 | " vundle-plugins-uris 132 | " 133 | " arg -- the string supplied to identify the plugin 134 | " return -- a dictionary with the folder name (key 'name') and the uri (key 135 | " 'uri') for cloning the plugin and the original argument (key 136 | " 'name_spec') 137 | " --------------------------------------------------------------------------- 138 | func! s:parse_name(arg) 139 | let arg = a:arg 140 | let git_proto = exists('g:vundle_default_git_proto') ? g:vundle_default_git_proto : 'https' 141 | 142 | if arg =~? '^\s*\(gh\|github\):\S\+' 143 | \ || arg =~? '^[a-z0-9][a-z0-9-]*/[^/]\+$' 144 | let uri = git_proto.'://github.com/'.split(arg, ':')[-1] 145 | if uri !~? '\.git$' 146 | let uri .= '.git' 147 | endif 148 | let name = substitute(split(uri,'\/')[-1], '\.git\s*$','','i') 149 | elseif arg =~? '^\s*\(git@\|git://\)\S\+' 150 | \ || arg =~? '\(file\|https\?\)://' 151 | \ || arg =~? '\.git\s*$' 152 | let uri = arg 153 | let name = split( substitute(uri,'/\?\.git\s*$','','i') ,'\/')[-1] 154 | else 155 | let name = arg 156 | let uri = git_proto.'://github.com/vim-scripts/'.name.'.git' 157 | endif 158 | return {'name': name, 'uri': uri, 'name_spec': arg } 159 | endf 160 | 161 | 162 | " --------------------------------------------------------------------------- 163 | " Modify the runtimepath, after all bundles have been added, so that the 164 | " directories that were in the default runtimepath appear first in the list 165 | " (with their 'after' directories last). 166 | " --------------------------------------------------------------------------- 167 | func! s:rtp_add_defaults() 168 | let current = &rtp 169 | set rtp&vim 170 | let default = &rtp 171 | let &rtp = current 172 | let default_rtp_items = split(default, ',') 173 | if !empty(default_rtp_items) 174 | let first_item = fnameescape(default_rtp_items[0]) 175 | exec 'set rtp-=' . first_item 176 | exec 'set rtp^=' . first_item 177 | endif 178 | endf 179 | 180 | 181 | " --------------------------------------------------------------------------- 182 | " Remove all paths for the plugins which are managed by Vundle from the 183 | " runtimepath. 184 | " --------------------------------------------------------------------------- 185 | func! s:rtp_rm_a() 186 | let paths = map(copy(g:vundle#bundles), 'v:val.rtpath') 187 | let prepends = join(paths, ',') 188 | let appends = join(paths, '/after,').'/after' 189 | exec 'set rtp-='.fnameescape(prepends) 190 | exec 'set rtp-='.fnameescape(appends) 191 | endf 192 | 193 | 194 | " --------------------------------------------------------------------------- 195 | " Add all paths for the plugins which are managed by Vundle to the 196 | " runtimepath. 197 | " --------------------------------------------------------------------------- 198 | func! s:rtp_add_a() 199 | let paths = map(copy(g:vundle#bundles), 'v:val.rtpath') 200 | let prepends = join(paths, ',') 201 | let appends = join(paths, '/after,').'/after' 202 | exec 'set rtp^='.fnameescape(prepends) 203 | exec 'set rtp+='.fnameescape(appends) 204 | endf 205 | 206 | 207 | " --------------------------------------------------------------------------- 208 | " Remove a directory and the corresponding 'after' directory from runtimepath. 209 | " 210 | " dir -- the directory name to be removed as a string. The corresponding 211 | " 'after' directory will also be removed. 212 | " --------------------------------------------------------------------------- 213 | func! s:rtp_rm(dir) abort 214 | exec 'set rtp-='.fnameescape(expand(a:dir, 1)) 215 | exec 'set rtp-='.fnameescape(expand(a:dir.'/after', 1)) 216 | endf 217 | 218 | 219 | " --------------------------------------------------------------------------- 220 | " Add a directory and the corresponding 'after' directory to runtimepath. 221 | " 222 | " dir -- the directory name to be added as a string. The corresponding 223 | " 'after' directory will also be added. 224 | " --------------------------------------------------------------------------- 225 | func! s:rtp_add(dir) abort 226 | exec 'set rtp^='.fnameescape(expand(a:dir, 1)) 227 | exec 'set rtp+='.fnameescape(expand(a:dir.'/after', 1)) 228 | endf 229 | 230 | 231 | " --------------------------------------------------------------------------- 232 | " Expand and simplify a path. 233 | " 234 | " path -- the path to expand as a string 235 | " return -- the expanded and simplified path 236 | " --------------------------------------------------------------------------- 237 | func! s:expand_path(path) abort 238 | return simplify(expand(a:path, 1)) 239 | endf 240 | 241 | 242 | " --------------------------------------------------------------------------- 243 | " Find the actual path inside a bundle directory to be added to the 244 | " runtimepath. It might be provided by the user with the 'rtp' option. 245 | " Corresponding documentation: vundle-plugins-configure 246 | " 247 | " opts -- a bundle dict 248 | " return -- expanded path to the corresponding plugin directory 249 | " --------------------------------------------------------------------------- 250 | func! s:rtpath(opts) 251 | return has_key(a:opts, 'rtp') ? s:expand_path(a:opts.path().'/'.a:opts.rtp) : a:opts.path() 252 | endf 253 | 254 | 255 | " --------------------------------------------------------------------------- 256 | " a bundle 'object' 257 | " --------------------------------------------------------------------------- 258 | let s:bundle = {} 259 | 260 | 261 | " --------------------------------------------------------------------------- 262 | " Return the absolute path to the directory inside the bundle directory 263 | " (prefix) where thr bundle will be cloned. 264 | " 265 | " return -- the target location to clone this bundle to 266 | " --------------------------------------------------------------------------- 267 | func! s:bundle.path() 268 | return s:expand_path(g:vundle#bundle_dir.'/') . self.name 269 | endf 270 | 271 | 272 | " --------------------------------------------------------------------------- 273 | " Determine if the bundle has the pinned attribute set in the config 274 | " 275 | " return -- 1 if the bundle is pinned, 0 otherwise 276 | " --------------------------------------------------------------------------- 277 | func! s:bundle.is_pinned() 278 | return get(self, 'pinned') 279 | endf 280 | 281 | " vim: set expandtab sts=2 ts=2 sw=2 tw=78 norl: 282 | -------------------------------------------------------------------------------- /.vim/bundle/Vundle.vim/autoload/vundle/installer.vim: -------------------------------------------------------------------------------- 1 | " --------------------------------------------------------------------------- 2 | " Try to clone all new bundles given (or all bundles in g:vundle#bundles by 3 | " default) to g:vundle#bundle_dir. If a:bang is 1 it will also update all 4 | " plugins (git pull). 5 | " 6 | " bang -- 1 or 0 7 | " ... -- any number of bundle specifications (separate arguments) 8 | " --------------------------------------------------------------------------- 9 | func! vundle#installer#new(bang, ...) abort 10 | " No specific plugins are specified. Operate on all plugins. 11 | if a:0 == 0 12 | let bundles = g:vundle#bundles 13 | " Specific plugins are specified for update. Update them. 14 | elseif (a:bang) 15 | let bundles = filter(copy(g:vundle#bundles), 'index(a:000, v:val.name) > -1') 16 | " Specific plugins are specified for installation. Install them. 17 | else 18 | let bundles = map(copy(a:000), 'vundle#config#bundle(v:val, {})') 19 | endif 20 | 21 | if empty(bundles) 22 | echoerr 'No bundles were selected for operation' 23 | return 24 | endif 25 | 26 | let names = vundle#scripts#bundle_names(map(copy(bundles), 'v:val.name_spec')) 27 | call vundle#scripts#view('Installer',['" Installing plugins to '.expand(g:vundle#bundle_dir, 1)], names + ['Helptags']) 28 | 29 | " This calls 'add' as a normal mode command. This is a buffer local mapping 30 | " defined in vundle#scripts#view(). The mapping will call a buffer local 31 | " command InstallPlugin which in turn will call vundle#installer#run() with 32 | " vundle#installer#install(). 33 | call s:process(a:bang, (a:bang ? 'add!' : 'add')) 34 | 35 | call vundle#config#require(bundles) 36 | endf 37 | 38 | 39 | " --------------------------------------------------------------------------- 40 | " Iterate over all lines in a Vundle window and execute the given command for 41 | " every line. Used by the installation and cleaning functions. 42 | " 43 | " bang -- not used (FIXME) 44 | " cmd -- the (normal mode) command to execute for every line as a string 45 | " --------------------------------------------------------------------------- 46 | func! s:process(bang, cmd) 47 | let msg = '' 48 | 49 | redraw 50 | sleep 1m 51 | 52 | let lines = (getline('.','$')[0:-2]) 53 | 54 | for line in lines 55 | redraw 56 | 57 | exec ':norm '.a:cmd 58 | 59 | if 'error' == s:last_status 60 | let msg = 'With errors; press l to view log' 61 | endif 62 | 63 | if 'updated' == s:last_status && empty(msg) 64 | let msg = 'Plugins updated; press u to view changelog' 65 | endif 66 | 67 | " goto next one 68 | exec ':+1' 69 | 70 | setl nomodified 71 | endfor 72 | 73 | redraw 74 | echo 'Done! '.msg 75 | endf 76 | 77 | 78 | " --------------------------------------------------------------------------- 79 | " Call another function in the different Vundle windows. 80 | " 81 | " func_name -- the function to call 82 | " name -- the bundle name to call func_name for (string) 83 | " ... -- the argument to be used when calling func_name (only the first 84 | " optional argument will be used) 85 | " return -- the status returned by the call to func_name 86 | " --------------------------------------------------------------------------- 87 | func! vundle#installer#run(func_name, name, ...) abort 88 | let n = a:name 89 | 90 | echo 'Processing '.n 91 | call s:sign('active') 92 | 93 | sleep 1m 94 | 95 | let status = call(a:func_name, a:1) 96 | 97 | call s:sign(status) 98 | 99 | redraw 100 | 101 | if 'new' == status 102 | echo n.' installed' 103 | elseif 'updated' == status 104 | echo n.' updated' 105 | elseif 'todate' == status 106 | echo n.' already installed' 107 | elseif 'deleted' == status 108 | echo n.' deleted' 109 | elseif 'helptags' == status 110 | echo n.' regenerated' 111 | elseif 'pinned' == status 112 | echo n.' pinned' 113 | elseif 'error' == status 114 | echohl Error 115 | echo 'Error processing '.n 116 | echohl None 117 | sleep 1 118 | else 119 | throw 'whoops, unknown status:'.status 120 | endif 121 | 122 | let s:last_status = status 123 | 124 | return status 125 | endf 126 | 127 | 128 | " --------------------------------------------------------------------------- 129 | " Put a sign on the current line, indicating the status of the installation 130 | " step. 131 | " 132 | " status -- string describing the status 133 | " --------------------------------------------------------------------------- 134 | func! s:sign(status) 135 | if (!has('signs')) 136 | return 137 | endif 138 | 139 | exe ":sign place ".line('.')." line=".line('.')." name=Vu_". a:status ." buffer=" . bufnr("%") 140 | endf 141 | 142 | 143 | " --------------------------------------------------------------------------- 144 | " Install a plugin, then add it to the runtimepath and source it. 145 | " 146 | " bang -- 1 or 0, passed directly to vundle#installer#install() 147 | " name -- the name of a bundle (string) 148 | " return -- the return value from vundle#installer#install() 149 | " --------------------------------------------------------------------------- 150 | func! vundle#installer#install_and_require(bang, name) abort 151 | let result = vundle#installer#install(a:bang, a:name) 152 | let b = vundle#config#bundle(a:name, {}) 153 | call vundle#installer#helptags([b]) 154 | call vundle#config#require([b]) 155 | return result 156 | endf 157 | 158 | 159 | " --------------------------------------------------------------------------- 160 | " Install or update a bundle given by its name. 161 | " 162 | " bang -- 1 or 0, passed directly to s:sync() 163 | " name -- the name of a bundle (string) 164 | " return -- the return value from s:sync() 165 | " --------------------------------------------------------------------------- 166 | func! vundle#installer#install(bang, name) abort 167 | if !isdirectory(g:vundle#bundle_dir) | call mkdir(g:vundle#bundle_dir, 'p') | endif 168 | 169 | let n = substitute(a:name,"['".'"]\+','','g') 170 | let matched = filter(copy(g:vundle#bundles), 'v:val.name_spec == n') 171 | 172 | if len(matched) > 0 173 | let b = matched[0] 174 | else 175 | let b = vundle#config#init_bundle(a:name, {}) 176 | endif 177 | 178 | return s:sync(a:bang, b) 179 | endf 180 | 181 | 182 | " --------------------------------------------------------------------------- 183 | " Call :helptags for all bundles in g:vundle#bundles. 184 | " 185 | " return -- 'error' if an error occurred, else return 'helptags' 186 | " --------------------------------------------------------------------------- 187 | func! vundle#installer#docs() abort 188 | let error_count = vundle#installer#helptags(g:vundle#bundles) 189 | if error_count > 0 190 | return 'error' 191 | endif 192 | return 'helptags' 193 | endf 194 | 195 | 196 | " --------------------------------------------------------------------------- 197 | " Call :helptags for a list of bundles. 198 | " 199 | " bundles -- a list of bundle dictionaries for which :helptags should be 200 | " called. 201 | " return -- the number of directories where :helptags failed 202 | " --------------------------------------------------------------------------- 203 | func! vundle#installer#helptags(bundles) abort 204 | let bundle_dirs = map(copy(a:bundles),'v:val.rtpath') 205 | let help_dirs = filter(bundle_dirs, 's:has_doc(v:val)') 206 | 207 | call s:log('') 208 | call s:log('Helptags:') 209 | 210 | let statuses = map(copy(help_dirs), 's:helptags(v:val)') 211 | let errors = filter(statuses, 'v:val == 0') 212 | 213 | call s:log('Helptags: '.len(help_dirs).' plugins processed') 214 | 215 | return len(errors) 216 | endf 217 | 218 | 219 | " --------------------------------------------------------------------------- 220 | " List all installed plugins. 221 | " Corresponding documentation: vundle-plugins-list 222 | " 223 | " bang -- not used 224 | " --------------------------------------------------------------------------- 225 | func! vundle#installer#list(bang) abort 226 | let bundles = vundle#scripts#bundle_names(map(copy(g:vundle#bundles), 'v:val.name_spec')) 227 | call vundle#scripts#view('list', ['" My Plugins'], bundles) 228 | redraw 229 | echo len(g:vundle#bundles).' plugins configured' 230 | endf 231 | 232 | 233 | " --------------------------------------------------------------------------- 234 | " List and remove all directories in the bundle directory which are not 235 | " activated (added to the bundle list). 236 | " 237 | " bang -- 0 if the user should be asked to confirm every deletion, 1 if they 238 | " should be removed unconditionally 239 | " --------------------------------------------------------------------------- 240 | func! vundle#installer#clean(bang) abort 241 | let bundle_dirs = map(copy(g:vundle#bundles), 'v:val.path()') 242 | let all_dirs = (v:version > 702 || (v:version == 702 && has("patch51"))) 243 | \ ? split(globpath(g:vundle#bundle_dir, '*', 1), "\n") 244 | \ : split(globpath(g:vundle#bundle_dir, '*'), "\n") 245 | let x_dirs = filter(all_dirs, '0 > index(bundle_dirs, v:val)') 246 | 247 | if empty(x_dirs) 248 | let headers = ['" All clean!'] 249 | let names = [] 250 | else 251 | let headers = ['" Removing Plugins:'] 252 | let names = vundle#scripts#bundle_names(map(copy(x_dirs), 'fnamemodify(v:val, ":t")')) 253 | end 254 | 255 | call vundle#scripts#view('clean', headers, names) 256 | redraw 257 | 258 | if (a:bang || empty(names)) 259 | call s:process(a:bang, 'D') 260 | else 261 | call inputsave() 262 | let response = input('Continue? [Y/n]: ') 263 | call inputrestore() 264 | if (response =~? 'y' || response == '') 265 | call s:process(a:bang, 'D') 266 | endif 267 | endif 268 | endf 269 | 270 | 271 | " --------------------------------------------------------------------------- 272 | " Delete to directory for a plugin. 273 | " 274 | " bang -- not used 275 | " dir_name -- the bundle directory to be deleted (as a string) 276 | " return -- 'error' if an error occurred, 'deleted' if the plugin folder was 277 | " successfully deleted 278 | " --------------------------------------------------------------------------- 279 | func! vundle#installer#delete(bang, dir_name) abort 280 | 281 | let cmd = ((has('win32') || has('win64')) && empty(matchstr(&shell, 'sh'))) ? 282 | \ 'rmdir /S /Q' : 283 | \ 'rm -rf' 284 | 285 | let bundle = vundle#config#init_bundle(a:dir_name, {}) 286 | let cmd .= ' '.vundle#installer#shellesc(bundle.path()) 287 | 288 | let out = s:system(cmd) 289 | 290 | call s:log('') 291 | call s:log('Plugin '.a:dir_name) 292 | call s:log(cmd, '$ ') 293 | call s:log(out, '> ') 294 | 295 | if 0 != v:shell_error 296 | return 'error' 297 | else 298 | return 'deleted' 299 | endif 300 | endf 301 | 302 | 303 | " --------------------------------------------------------------------------- 304 | " Check if a bundled plugin has any documentation. 305 | " 306 | " rtp -- a path (string) where the plugin is installed 307 | " return -- 1 if some documentation was found, 0 otherwise 308 | " --------------------------------------------------------------------------- 309 | func! s:has_doc(rtp) abort 310 | return isdirectory(a:rtp.'/doc') 311 | \ && (!filereadable(a:rtp.'/doc/tags') || filewritable(a:rtp.'/doc/tags')) 312 | \ && (v:version > 702 || (v:version == 702 && has("patch51"))) 313 | \ ? !(empty(glob(a:rtp.'/doc/*.txt', 1)) && empty(glob(a:rtp.'/doc/*.??x', 1))) 314 | \ : !(empty(glob(a:rtp.'/doc/*.txt')) && empty(glob(a:rtp.'/doc/*.??x'))) 315 | endf 316 | 317 | 318 | " --------------------------------------------------------------------------- 319 | " Update the helptags for a plugin. 320 | " 321 | " rtp -- the path to the plugin's root directory (string) 322 | " return -- 1 if :helptags succeeded, 0 otherwise 323 | " --------------------------------------------------------------------------- 324 | func! s:helptags(rtp) abort 325 | " it is important to keep trailing slash here 326 | let doc_path = resolve(a:rtp . '/doc/') 327 | call s:log(':helptags '.doc_path) 328 | try 329 | execute 'helptags ' . doc_path 330 | catch 331 | call s:log("> Error running :helptags ".doc_path) 332 | return 0 333 | endtry 334 | return 1 335 | endf 336 | 337 | 338 | " --------------------------------------------------------------------------- 339 | " Get the URL for the remote called 'origin' on the repository that 340 | " corresponds to a given bundle. 341 | " 342 | " bundle -- a bundle object to check the repository for 343 | " return -- the URL for the origin remote (string) 344 | " --------------------------------------------------------------------------- 345 | func! s:get_current_origin_url(bundle) abort 346 | let cmd = 'cd '.vundle#installer#shellesc(a:bundle.path()).' && git config --get remote.origin.url' 347 | let cmd = vundle#installer#shellesc_cd(cmd) 348 | let out = s:strip(s:system(cmd)) 349 | return out 350 | endf 351 | 352 | 353 | " --------------------------------------------------------------------------- 354 | " Get a short sha of the HEAD of the repository for a given bundle 355 | " 356 | " bundle -- a bundle object 357 | " return -- A 15 character log sha for the current HEAD 358 | " --------------------------------------------------------------------------- 359 | func! s:get_current_sha(bundle) 360 | let cmd = 'cd '.vundle#installer#shellesc(a:bundle.path()).' && git rev-parse HEAD' 361 | let cmd = vundle#installer#shellesc_cd(cmd) 362 | let out = s:system(cmd)[0:15] 363 | return out 364 | endf 365 | 366 | 367 | " --------------------------------------------------------------------------- 368 | " Create the appropriate sync command to run according to the current state of 369 | " the local repository (clone, pull, reset, etc). 370 | " 371 | " In the case of a pull (update), also return the current sha, so that we can 372 | " later check that there has been an upgrade. 373 | " 374 | " bang -- 0 if only new plugins should be installed, 1 if existing plugins 375 | " should be updated 376 | " bundle -- a bundle object to create the sync command for 377 | " return -- A list containing the command to run and the sha for the current 378 | " HEAD 379 | " --------------------------------------------------------------------------- 380 | func! s:make_sync_command(bang, bundle) abort 381 | let git_dir = expand(a:bundle.path().'/.git/', 1) 382 | if isdirectory(git_dir) || filereadable(expand(a:bundle.path().'/.git', 1)) 383 | 384 | let current_origin_url = s:get_current_origin_url(a:bundle) 385 | if current_origin_url != a:bundle.uri 386 | call s:log('Plugin URI change detected for Plugin ' . a:bundle.name) 387 | call s:log('> Plugin ' . a:bundle.name . ' old URI: ' . current_origin_url) 388 | call s:log('> Plugin ' . a:bundle.name . ' new URI: ' . a:bundle.uri) 389 | " Directory names match but the origin remotes are not the same 390 | let cmd_parts = [ 391 | \ 'cd '.vundle#installer#shellesc(a:bundle.path()) , 392 | \ 'git remote set-url origin ' . vundle#installer#shellesc(a:bundle.uri), 393 | \ 'git fetch', 394 | \ 'git reset --hard origin/HEAD', 395 | \ 'git submodule update --init --recursive', 396 | \ ] 397 | let cmd = join(cmd_parts, ' && ') 398 | let cmd = vundle#installer#shellesc_cd(cmd) 399 | let initial_sha = '' 400 | return [cmd, initial_sha] 401 | endif 402 | 403 | if !(a:bang) 404 | " The repo exists, and no !, so leave as it is. 405 | return ['', ''] 406 | endif 407 | 408 | let cmd_parts = [ 409 | \ 'cd '.vundle#installer#shellesc(a:bundle.path()), 410 | \ 'git pull', 411 | \ 'git submodule update --init --recursive', 412 | \ ] 413 | let cmd = join(cmd_parts, ' && ') 414 | let cmd = vundle#installer#shellesc_cd(cmd) 415 | 416 | let initial_sha = s:get_current_sha(a:bundle) 417 | else 418 | let cmd = 'git clone --recursive '.vundle#installer#shellesc(a:bundle.uri).' '.vundle#installer#shellesc(a:bundle.path()) 419 | let initial_sha = '' 420 | endif 421 | return [cmd, initial_sha] 422 | endf 423 | 424 | 425 | " --------------------------------------------------------------------------- 426 | " Install or update a given bundle object with git. 427 | " 428 | " bang -- 0 if only new plugins should be installed, 1 if existing plugins 429 | " should be updated 430 | " bundle -- a bundle object (dictionary) 431 | " return -- a string indicating the status of the bundle installation: 432 | " - todate : Nothing was updated or the repository was up to date 433 | " - new : The plugin was newly installed 434 | " - updated : Some changes where pulled via git 435 | " - error : An error occurred in the shell command 436 | " - pinned : The bundle is marked as pinned 437 | " --------------------------------------------------------------------------- 438 | func! s:sync(bang, bundle) abort 439 | " Do not sync if this bundle is pinned 440 | if a:bundle.is_pinned() 441 | return 'pinned' 442 | endif 443 | 444 | let [ cmd, initial_sha ] = s:make_sync_command(a:bang, a:bundle) 445 | if empty(cmd) 446 | return 'todate' 447 | endif 448 | 449 | let out = s:system(cmd) 450 | call s:log('') 451 | call s:log('Plugin '.a:bundle.name_spec) 452 | call s:log(cmd, '$ ') 453 | call s:log(out, '> ') 454 | 455 | if 0 != v:shell_error 456 | return 'error' 457 | end 458 | 459 | if empty(initial_sha) 460 | return 'new' 461 | endif 462 | 463 | let updated_sha = s:get_current_sha(a:bundle) 464 | 465 | if initial_sha == updated_sha 466 | return 'todate' 467 | endif 468 | 469 | call add(g:vundle#updated_bundles, [initial_sha, updated_sha, a:bundle]) 470 | return 'updated' 471 | endf 472 | 473 | 474 | " --------------------------------------------------------------------------- 475 | " Escape special characters in a string to be able to use it as a shell 476 | " command with system(). 477 | " 478 | " cmd -- the string holding the shell command 479 | " return -- a string with the relevant characters escaped 480 | " --------------------------------------------------------------------------- 481 | func! vundle#installer#shellesc(cmd) abort 482 | if ((has('win32') || has('win64')) && empty(matchstr(&shell, 'sh'))) 483 | return '"' . substitute(a:cmd, '"', '\\"', 'g') . '"' 484 | endif 485 | return shellescape(a:cmd) 486 | endf 487 | 488 | 489 | " --------------------------------------------------------------------------- 490 | " Fix a cd shell command to be used on Windows. 491 | " 492 | " cmd -- the command to be fixed (string) 493 | " return -- the fixed command (string) 494 | " --------------------------------------------------------------------------- 495 | func! vundle#installer#shellesc_cd(cmd) abort 496 | if ((has('win32') || has('win64')) && empty(matchstr(&shell, 'sh'))) 497 | let cmd = substitute(a:cmd, '^cd ','cd /d ','') " add /d switch to change drives 498 | return cmd 499 | else 500 | return a:cmd 501 | endif 502 | endf 503 | 504 | 505 | " --------------------------------------------------------------------------- 506 | " Make a system call. This can be used to change the way system calls 507 | " are made during developing, without searching the whole code base for 508 | " actual system() calls. 509 | " 510 | " cmd -- the command passed to system() (string) 511 | " return -- the return value from system() 512 | " --------------------------------------------------------------------------- 513 | func! s:system(cmd) abort 514 | return system(a:cmd) 515 | endf 516 | 517 | 518 | " --------------------------------------------------------------------------- 519 | " Add a log message to Vundle's internal logging variable. 520 | " 521 | " str -- the log message (string) 522 | " prefix -- optional prefix for multi-line entries (string) 523 | " return -- a:str 524 | " --------------------------------------------------------------------------- 525 | func! s:log(str, ...) abort 526 | let prefix = a:0 > 0 ? a:1 : '' 527 | let fmt = '%Y-%m-%d %H:%M:%S' 528 | let lines = split(a:str, '\n', 1) 529 | let time = strftime(fmt) 530 | for line in lines 531 | call add(g:vundle#log, '['. time .'] '. prefix . line) 532 | endfor 533 | return a:str 534 | endf 535 | 536 | 537 | " --------------------------------------------------------------------------- 538 | " Remove leading and trailing whitespace from a string 539 | " 540 | " str -- The string to rid of trailing and leading spaces 541 | " return -- A string stripped of side spaces 542 | " --------------------------------------------------------------------------- 543 | func! s:strip(str) 544 | return substitute(a:str, '\%^\_s*\(.\{-}\)\_s*\%$', '\1', '') 545 | endf 546 | 547 | " vim: set expandtab sts=2 ts=2 sw=2 tw=78 norl: 548 | -------------------------------------------------------------------------------- /.vim/bundle/Vundle.vim/autoload/vundle/scripts.vim: -------------------------------------------------------------------------------- 1 | " --------------------------------------------------------------------------- 2 | " Search the database from vim-script.org for a matching plugin. If no 3 | " argument is given, list all plugins. This function is used by the :Plugins 4 | " and :PluginSearch commands. 5 | " 6 | " bang -- if 1 refresh the script name cache, if 0 don't 7 | " ... -- a plugin name to search for 8 | " --------------------------------------------------------------------------- 9 | func! vundle#scripts#all(bang, ...) 10 | let b:match = '' 11 | let info = ['"Keymap: i - Install plugin; c - Cleanup; s - Search; R - Reload list'] 12 | let matches = s:load_scripts(a:bang) 13 | if !empty(a:1) 14 | let matches = filter(matches, 'v:val =~? "'.escape(a:1,'"').'"') 15 | let info += ['"Search results for: '.a:1] 16 | " TODO: highlight matches 17 | let b:match = a:1 18 | endif 19 | call vundle#scripts#view('search',info, vundle#scripts#bundle_names(reverse(matches))) 20 | redraw 21 | echo len(matches).' plugins found' 22 | endf 23 | 24 | 25 | " --------------------------------------------------------------------------- 26 | " Repeat the search for bundles. 27 | " --------------------------------------------------------------------------- 28 | func! vundle#scripts#reload() abort 29 | silent exec ':PluginSearch! '.(exists('b:match') ? b:match : '') 30 | redraw 31 | endf 32 | 33 | 34 | " --------------------------------------------------------------------------- 35 | " Complete names for bundles in the command line. 36 | " 37 | " a, c, d -- see :h command-completion-custom 38 | " return -- all valid plugin names from vim-scripts.org as completion 39 | " candidates, or all installed plugin names when running an 'Update 40 | " variant'. see also :h command-completion-custom 41 | " --------------------------------------------------------------------------- 42 | func! vundle#scripts#complete(a,c,d) 43 | if match(a:c, '\v^%(Plugin|Vundle)%(Install!|Update)') == 0 44 | " Only installed plugins if updating 45 | return join(map(copy(g:vundle#bundles), 'v:val.name'), "\n") 46 | else 47 | " Or all known plugins otherwise 48 | return join(s:load_scripts(0),"\n") 49 | endif 50 | endf 51 | 52 | 53 | " --------------------------------------------------------------------------- 54 | " View the logfile after an update or installation. 55 | " --------------------------------------------------------------------------- 56 | func! s:view_log() 57 | if !exists('s:log_file') 58 | let s:log_file = tempname() 59 | endif 60 | 61 | if bufloaded(s:log_file) 62 | execute 'silent bdelete' s:log_file 63 | endif 64 | call writefile(g:vundle#log, s:log_file) 65 | execute 'silent pedit ' . s:log_file 66 | set bufhidden=wipe 67 | setl buftype=nofile 68 | setl noswapfile 69 | setl ro noma 70 | 71 | wincmd P | wincmd H 72 | endf 73 | 74 | 75 | " --------------------------------------------------------------------------- 76 | " Parse the output from git log after an update to create a change log for the 77 | " user. 78 | " --------------------------------------------------------------------------- 79 | func! s:create_changelog() abort 80 | let changelog = ['Updated Plugins:'] 81 | for bundle_data in g:vundle#updated_bundles 82 | let initial_sha = bundle_data[0] 83 | let updated_sha = bundle_data[1] 84 | let bundle = bundle_data[2] 85 | 86 | let cmd = 'cd '.vundle#installer#shellesc(bundle.path()). 87 | \ ' && git log --pretty=format:"%s %an, %ar" --graph '. 88 | \ initial_sha.'..'.updated_sha 89 | 90 | let cmd = vundle#installer#shellesc_cd(cmd) 91 | 92 | let updates = system(cmd) 93 | 94 | call add(changelog, '') 95 | call add(changelog, 'Updated Plugin: '.bundle.name) 96 | 97 | if bundle.uri =~ "https://github.com" 98 | call add(changelog, 'Compare at: '.bundle.uri[0:-5].'/compare/'.initial_sha.'...'.updated_sha) 99 | endif 100 | 101 | for update in split(updates, '\n') 102 | let update = substitute(update, '\s\+$', '', '') 103 | call add(changelog, ' '.update) 104 | endfor 105 | endfor 106 | return changelog 107 | endf 108 | 109 | 110 | " --------------------------------------------------------------------------- 111 | " View the change log after an update or installation. 112 | " --------------------------------------------------------------------------- 113 | func! s:view_changelog() 114 | if !exists('s:changelog_file') 115 | let s:changelog_file = tempname() 116 | endif 117 | 118 | if bufloaded(s:changelog_file) 119 | execute 'silent bdelete' s:changelog_file 120 | endif 121 | call writefile(s:create_changelog(), s:changelog_file) 122 | execute 'silent pedit' s:changelog_file 123 | set bufhidden=wipe 124 | setl buftype=nofile 125 | setl noswapfile 126 | setl ro noma 127 | setfiletype vundlelog 128 | 129 | wincmd P | wincmd H 130 | endf 131 | 132 | 133 | " --------------------------------------------------------------------------- 134 | " Create a list of 'Plugin ...' lines from a list of bundle names. 135 | " 136 | " names -- a list of names (strings) of plugins 137 | " return -- a list of 'Plugin ...' lines suitable to be written to a buffer 138 | " --------------------------------------------------------------------------- 139 | func! vundle#scripts#bundle_names(names) 140 | return map(copy(a:names), ' printf("Plugin ' ."'%s'".'", v:val) ') 141 | endf 142 | 143 | 144 | " --------------------------------------------------------------------------- 145 | " Open a buffer to display information to the user. Several special commands 146 | " are defined in the new buffer. 147 | " 148 | " title -- a title for the new buffer 149 | " headers -- a list of header lines to be displayed at the top of the buffer 150 | " results -- the main information to be displayed in the buffer (list of 151 | " strings) 152 | " --------------------------------------------------------------------------- 153 | func! vundle#scripts#view(title, headers, results) 154 | if exists('s:view') && bufloaded(s:view) 155 | exec s:view.'bd!' 156 | endif 157 | 158 | exec 'silent pedit [Vundle] '.a:title 159 | 160 | wincmd P | wincmd H 161 | 162 | let s:view = bufnr('%') 163 | " 164 | " make buffer modifiable 165 | " to append without errors 166 | set modifiable 167 | 168 | call append(0, a:headers + a:results) 169 | 170 | setl buftype=nofile 171 | setl noswapfile 172 | set bufhidden=wipe 173 | 174 | setl cursorline 175 | setl nonu ro noma 176 | if (exists('&relativenumber')) | setl norelativenumber | endif 177 | 178 | setl ft=vundle 179 | setl syntax=vim 180 | syn keyword vimCommand Plugin 181 | syn keyword vimCommand Bundle 182 | syn keyword vimCommand Helptags 183 | 184 | com! -buffer -bang -nargs=1 DeletePlugin 185 | \ call vundle#installer#run('vundle#installer#delete', split(,',')[0], ['!' == '', ]) 186 | 187 | com! -buffer -bang -nargs=? InstallAndRequirePlugin 188 | \ call vundle#installer#run('vundle#installer#install_and_require', split(,',')[0], ['!' == '', ]) 189 | 190 | com! -buffer -bang -nargs=? InstallPlugin 191 | \ call vundle#installer#run('vundle#installer#install', split(,',')[0], ['!' == '', ]) 192 | 193 | com! -buffer -bang -nargs=0 InstallHelptags 194 | \ call vundle#installer#run('vundle#installer#docs', 'helptags', []) 195 | 196 | com! -buffer -nargs=0 VundleLog call s:view_log() 197 | 198 | com! -buffer -nargs=0 VundleChangelog call s:view_changelog() 199 | 200 | nnoremap q :silent bd! 201 | nnoremap D :exec 'Delete'.getline('.') 202 | 203 | nnoremap add :exec 'Install'.getline('.') 204 | nnoremap add! :exec 'Install'.substitute(getline('.'), '^Plugin ', 'Plugin! ', '') 205 | 206 | nnoremap i :exec 'InstallAndRequire'.getline('.') 207 | nnoremap I :exec 'InstallAndRequire'.substitute(getline('.'), '^Plugin ', 'Plugin! ', '') 208 | 209 | nnoremap l :VundleLog 210 | nnoremap u :VundleChangelog 211 | nnoremap h :h vundle 212 | nnoremap ? :h vundle 213 | 214 | nnoremap c :PluginClean 215 | nnoremap C :PluginClean! 216 | 217 | nnoremap s :PluginSearch 218 | nnoremap R :call vundle#scripts#reload() 219 | 220 | " goto first line after headers 221 | exec ':'.(len(a:headers) + 1) 222 | endf 223 | 224 | 225 | " --------------------------------------------------------------------------- 226 | " Load the plugin database from vim-scripts.org . 227 | " 228 | " to -- the filename (string) to save the database to 229 | " return -- 0 on success, 1 if an error occurred 230 | " --------------------------------------------------------------------------- 231 | func! s:fetch_scripts(to) 232 | let scripts_dir = fnamemodify(expand(a:to, 1), ":h") 233 | if !isdirectory(scripts_dir) 234 | call mkdir(scripts_dir, "p") 235 | endif 236 | 237 | let l:vim_scripts_json = 'http://vim-scripts.org/api/scripts.json' 238 | if executable("curl") 239 | let cmd = 'curl --fail -s -o '.vundle#installer#shellesc(a:to).' '.l:vim_scripts_json 240 | elseif executable("wget") 241 | let temp = vundle#installer#shellesc(tempname()) 242 | let cmd = 'wget -q -O '.temp.' '.l:vim_scripts_json. ' && mv -f '.temp.' '.vundle#installer#shellesc(a:to) 243 | if (has('win32') || has('win64')) 244 | let cmd = substitute(cmd, 'mv -f ', 'move /Y ', '') " change force flag 245 | let cmd = vundle#installer#shellesc(cmd) 246 | end 247 | else 248 | echoerr 'Error curl or wget is not available!' 249 | return 1 250 | endif 251 | 252 | call system(cmd) 253 | 254 | if (0 != v:shell_error) 255 | echoerr 'Error fetching scripts!' 256 | return v:shell_error 257 | endif 258 | return 0 259 | endf 260 | 261 | 262 | " --------------------------------------------------------------------------- 263 | " Load the plugin database and return a list of all plugins. 264 | " 265 | " bang -- if 1 download the redatabase, else only download if it is not 266 | " readable on disk (i.e. does not exist) 267 | " return -- a list of strings, these are the names (valid bundle 268 | " specifications) of all plugins from vim-scripts.org 269 | " --------------------------------------------------------------------------- 270 | func! s:load_scripts(bang) 271 | let f = expand(g:vundle#bundle_dir.'/.vundle/script-names.vim-scripts.org.json', 1) 272 | if a:bang || !filereadable(f) 273 | if 0 != s:fetch_scripts(f) 274 | return [] 275 | end 276 | endif 277 | return eval(readfile(f, 'b')[0]) 278 | endf 279 | 280 | " vim: set expandtab sts=2 ts=2 sw=2 tw=78 norl: 281 | -------------------------------------------------------------------------------- /.vim/bundle/Vundle.vim/changelog.md: -------------------------------------------------------------------------------- 1 | Change Log 2 | ========== 3 | F = Feature, B = Bug Fix, D = Doc Change 4 | 5 | ### Version 0.10.2 6 | 7 | - B: #430 Put user script directories before system directories in rtp 8 | - B: #455 Rename functions that start with `g:` + lowercase letter (Vim patch 7.4.264) 9 | 10 | ### Version 0.10.1 11 | - B: #451 Escape spaces when handling rtp directories 12 | 13 | ### Version 0.10 14 | - F: #415 Support plugin pinning (for non-git repos & preventing updates) 15 | - F: #440 Detect plugin name collisions 16 | - F: #418 Deferred rtp manipulation (speeds up start) 17 | - B: #418 Leave default rtp directories (i.e. ~/.vim) where they should be 18 | - B: #429 Fix newline character in log 19 | - B: #440 Detect changed remotes & update repos 20 | - D: #435 Image update in README.md 21 | - D: #419 Add function documentation 22 | - D: #436 Rename vundle to Vundle.vim, add modelines, quickstart update 23 | -------------------------------------------------------------------------------- /.vim/bundle/Vundle.vim/doc/vundle.txt: -------------------------------------------------------------------------------- 1 | *vundle.txt* Vundle, a plug-in manager for Vim. *vundle* 2 | 3 | VUNDLE MANUAL 4 | 5 | 1. About Vundle |vundle-about| 6 | 2. Quick Start |vundle-quickstart| 7 | 3. Plugins |vundle-plugins| 8 | 3.1. Configuring Plugins |vundle-plugins-configure| 9 | 3.2. Supported URIs |vundle-plugins-uris| 10 | 3.3. Installing Plugins |vundle-plugins-install| 11 | 3.4. Updating Plugins |vundle-plugins-update| 12 | 3.5. Searching Plugins |vundle-plugins-search| 13 | 3.6. Listing Plugins |vundle-plugins-list| 14 | 3.7. Cleaning Up |vundle-plugins-cleanup| 15 | 4. Interactive Mode |vundle-interactive| 16 | 5. Key Mappings |vundle-keymappings| 17 | 6. Options |vundle-options| 18 | 7. Plugin Interface Change |vundle-interface-change| 19 | 20 | ============================================================================= 21 | 1. ABOUT VUNDLE ~ 22 | *vundle-about* 23 | 24 | Vundle is short for Vim bundle and is a Vim plugin manager. 25 | 26 | Vundle allows you to... 27 | 28 | - keep track of and configure your scripts right in the `.vimrc` 29 | - install configured scripts (a.k.a. bundle) 30 | - update configured scripts 31 | - search by name all available Vim scripts 32 | - clean unused scripts up 33 | - run the above actions in a single keypress with interactive mode 34 | 35 | Vundle automatically... 36 | 37 | - manages the runtime path of your installed scripts 38 | - regenerates help tags after installing and updating 39 | 40 | Vundle's search uses http://vim-scripts.org to provide a list of all 41 | available Vim scripts. 42 | 43 | Vundle is undergoing an interface change, see |vundle-interface-change| for 44 | more information. 45 | 46 | ============================================================================= 47 | 2. QUICK START ~ 48 | *vundle-quickstart* 49 | 50 | 1. Introduction: 51 | 52 | Installation requires `Git` and triggers git clone for each configured 53 | repository to `~/.vim/bundle/` by default. Curl is required for search. 54 | 55 | *vundle-windows* 56 | If you are using Windows, see instructions on the Wiki 57 | https://github.com/VundleVim/Vundle.vim/wiki/Vundle-for-Windows. 58 | 59 | *vundle-faq* 60 | If you run into any issues, please consult the FAQ at 61 | https://github.com/VundleVim/Vundle.vim/wiki 62 | 63 | 2. Setup Vundle: 64 | > 65 | git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim 66 | < 67 | 3. Configure bundles: 68 | 69 | Put this at the top of your `.vimrc` to use Vundle. Remove bundles you 70 | don't need, they are for illustration purposes. 71 | > 72 | set nocompatible " be iMproved, required 73 | filetype off " required 74 | 75 | " set the runtime path to include Vundle and initialize 76 | set rtp+=~/.vim/bundle/Vundle.vim 77 | call vundle#begin() 78 | " alternatively, pass a path where Vundle should install plugins 79 | "call vundle#begin('~/some/path/here') 80 | 81 | " let Vundle manage Vundle, required 82 | Plugin 'VundleVim/Vundle.vim' 83 | 84 | " The following are examples of different formats supported. 85 | " Keep Plugin commands between vundle#begin/end. 86 | " plugin on GitHub repo 87 | Plugin 'tpope/vim-fugitive' 88 | " plugin from http://vim-scripts.org/vim/scripts.html 89 | Plugin 'L9' 90 | " Git plugin not hosted on GitHub 91 | Plugin 'git://git.wincent.com/command-t.git' 92 | " git repos on your local machine (i.e. when working on your own plugin) 93 | Plugin 'file:///home/gmarik/path/to/plugin' 94 | " The sparkup vim script is in a subdirectory of this repo called vim. 95 | " Pass the path to set the runtimepath properly. 96 | Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} 97 | " Avoid a name conflict with L9 98 | Plugin 'user/L9', {'name': 'newL9'} 99 | 100 | " All of your Plugins must be added before the following line 101 | call vundle#end() " required 102 | filetype plugin indent on " required 103 | " To ignore plugin indent changes, instead use: 104 | "filetype plugin on 105 | " 106 | " Brief help 107 | " :PluginList - list configured plugins 108 | " :PluginInstall(!) - install (update) plugins 109 | " :PluginSearch(!) foo - search (or refresh cache first) for foo 110 | " :PluginClean(!) - confirm (or auto-approve) removal of unused plugins 111 | " 112 | " see :h vundle for more details or wiki for FAQ 113 | " Put your non-Plugin stuff after this line 114 | 115 | 4. Install configured bundles: 116 | 117 | Launch vim and run 118 | > 119 | :PluginInstall 120 | < 121 | To install from command line: 122 | > 123 | vim +PluginInstall +qall 124 | 125 | ============================================================================= 126 | 3. PLUGINS ~ 127 | *vundle-plugins* 128 | 129 | 3.1 CONFIGURING PLUGINS ~ 130 | *vundle-plugins-configure* *:Plugin* 131 | 132 | Vundle tracks what plugins you want configured by the `Plugin` commands in your 133 | `.vimrc`. Each `Plugin` command tells Vundle to activate the script on startup 134 | adding it to your |runtimepath|. Commenting out or removing the line will 135 | disable the `Plugin`. 136 | 137 | Each `Plugin` command takes a URI pointing to the script. No comments should 138 | follow on the same line as the command. Example: 139 | > 140 | Plugin 'git_URI' 141 | 142 | The `Plugin` command can optionally take a second argument after the URI. It 143 | has to be a dictionary, separated from the URI by a comma. Each key-value pair 144 | in the dictionary is a configuration option. 145 | 146 | The following per-script configuration options are available. 147 | 148 | The 'rtp' option 149 | ---------------- 150 | 151 | Specifies a directory inside the repository (relative path from the root of 152 | the repository) where the vim plugin resides. It determines the path that will 153 | be added to the |runtimepath|. 154 | 155 | For example: 156 | > 157 | Plugin 'git_URI', {'rtp': 'some/subdir/'} 158 | 159 | This can be used with git repositories that put the vim plugin inside a 160 | subdirectory. 161 | 162 | The 'name' option 163 | ----------------- 164 | 165 | The name of the directory that will hold the local clone of the configured 166 | script. 167 | 168 | For example: 169 | > 170 | Plugin 'git_URI', {'name': 'newPluginName'} 171 | 172 | This can be used to prevent name collisions between plugins that Vundle would 173 | otherwise try to clone into the same directory. It also provides an additional 174 | level of customisation. 175 | 176 | The 'pinned' option 177 | ------------------- 178 | 179 | A flag that, when set to a value of 1, tells Vundle not to perform any git 180 | operations on the plugin, while still adding the existing plugin under the 181 | `bundles` directories to the |runtimepath|. 182 | 183 | For example: 184 | > 185 | Plugin 'mylocalplugin', {'pinned': 1} 186 | 187 | This allows the users to include, with Vundle, plugins tracked with version 188 | control systems other than git, but the user is responsible for cloning and 189 | keeping up to date. It also allows the users to stay in the current version of 190 | a plugin that might have previously been updated by Vundle. 191 | 192 | Please note that the URI will be treated the same as for any other plugins, so 193 | only the last part of it will be added to the |runtimepath|. The user is 194 | advised to use this flag only with single word URIs to avoid confusion. 195 | 196 | 3.2 SUPPORTED URIS ~ 197 | *vundle-plugins-uris* 198 | 199 | `Vundle` integrates very well with both GitHub and vim-scripts.org 200 | (http://vim-scripts.org/vim/scripts.html) allowing short URIs. It also allows 201 | the use of any URI `git` recognizes. In all of the following cases (except 202 | local) the 'https' protocol is used, see Vundle's options to override this. 203 | 204 | More information on `git`'s protocols can be found at: 205 | http://git-scm.com/book/ch4-1.html 206 | 207 | GitHub 208 | ------ 209 | GitHub is used when a user/repo is passed to `Plugin`. 210 | > 211 | Plugin 'VundleVim/Vundle.vim' => https://github.com/VundleVim/Vundle.vim 212 | 213 | Vim Scripts 214 | ----------- 215 | Any single word without a slash '/' is assumed to be from Vim Scripts. 216 | > 217 | Plugin 'ctrlp.vim' => https://github.com/vim-scripts/ctrlp.vim 218 | 219 | Other Git URIs 220 | -------------- 221 | No modification is performed on valid URIs that point outside the above 222 | URLs. 223 | > 224 | Plugin 'git://git.wincent.com/command-t.git' 225 | 226 | Local Plugins 227 | ------------- 228 | The git protocol supports local installation using the 'file://' protocol. 229 | This is handy when developing plugins locally. Follow the protocol with an 230 | absolute path to the script directory. 231 | > 232 | Plugin 'file:///path/from/root/to/plugin' 233 | 234 | 3.3 INSTALLING PLUGINS ~ 235 | *vundle-plugins-install* *:PluginInstall* 236 | > 237 | :PluginInstall 238 | 239 | Will install all plugins configured in your `.vimrc`. Newly installed 240 | plugins will be automatically enabled. Some plugins may require extra steps 241 | such as compilation or external programs, refer to their documentation. 242 | 243 | PluginInstall allows installation of plugins by name: 244 | > 245 | :PluginInstall unite.vim 246 | 247 | Installs and activates unite.vim. 248 | 249 | PluginInstall also allows installation of several plugins separated by space. 250 | > 251 | :PluginInstall tpope/vim-surround tpope/vim-fugitive 252 | 253 | Installs both tpope/vim-surround and tpope/vim-fugitive from GitHub. 254 | 255 | You can use Tab to auto-complete known script names. 256 | Note that the installation just described isn't permanent. To 257 | finish, you must put `Plugin 'unite.vim'` at the appropriate place in your 258 | `.vimrc` to tell Vundle to load the plugin at startup. 259 | 260 | After installing plugins press 'l' (lowercase 'L') to see the log of commands 261 | if any errors occurred. 262 | 263 | 3.4 UPDATING PLUGINS ~ 264 | *vundle-plugins-update* *:PluginUpdate* *:PluginInstall!* 265 | > 266 | :PluginInstall! " NOTE: bang(!) 267 | or > 268 | :PluginUpdate 269 | 270 | Installs or updates the configured plugins. Press 'u' after updates complete 271 | to see the change log of all updated bundles. Press 'l' (lowercase 'L') to 272 | see the log of commands if any errors occurred. 273 | 274 | To update specific plugins, write their names separated by space: 275 | > 276 | :PluginInstall! vim-surround vim-fugitive 277 | or > 278 | :PluginUpdate vim-surround vim-fugitive 279 | 280 | 3.5 SEARCHING PLUGINS ~ 281 | *vundle-plugins-search* *:PluginSearch* 282 | > 283 | :PluginSearch 284 | 285 | Search requires that `curl` be available on the system. The command searches 286 | Vim Scripts (http://vim-scripts.org/vim/scripts.html) for matching 287 | plugins. Results display in a new split window. For example: 288 | > 289 | PluginSearch foo 290 | 291 | displays: 292 | > 293 | "Search results for: foo 294 | Plugin 'MarkdownFootnotes' 295 | Plugin 'VimFootnotes' 296 | Plugin 'foo.vim' 297 | < 298 | *:PluginSearch!* 299 | Alternatively, you can refresh the script list before searching by adding a 300 | bang to the command. 301 | > 302 | :PluginSearch! foo 303 | 304 | If the command is run without argument: 305 | > 306 | :PluginSearch! 307 | 308 | it will display all known plugins in the new split. 309 | 310 | 3.6 LISTING BUNDLES ~ 311 | *vundle-plugins-list* *:PluginList* 312 | > 313 | :PluginList 314 | 315 | Displays a list of installed bundles. 316 | 317 | 3.7 CLEANING UP ~ 318 | *vundle-plugins-cleanup* *:PluginClean* 319 | > 320 | :PluginClean 321 | 322 | Requests confirmation for the removal of all plugins no longered configured 323 | in your `.vimrc` but present in your bundle installation directory 324 | (default: `.vim/bundle/`). 325 | 326 | *:PluginClean!* 327 | > 328 | :PluginClean! 329 | 330 | Automatically confirm removal of unused bundles. 331 | 332 | ============================================================================= 333 | 4. INTERACTIVE MODE ~ 334 | *vundle-interactive* 335 | 336 | Vundle provides a simple interactive mode to help you explore new plugins 337 | easily. Interactive mode is available after any command that lists `Plugins` 338 | such as PluginSearch, PluginList or Plugins. For instance: 339 | > 340 | :PluginSearch! unite 341 | 342 | Searches for plugins matching 'unite' and yields a split window with: 343 | > 344 | "Keymap: i - Install bundle; c - Cleanup; s - Search; R - Reload list 345 | "Search results for: unite 346 | Plugin 'unite-scriptenames' 347 | Plugin 'unite.vim' 348 | Plugin 'unite-yarm' 349 | Plugin 'unite-gem' 350 | Plugin 'unite-locate' 351 | Plugin 'unite-font' 352 | Plugin 'unite-colorscheme' 353 | 354 | To install a bundle, move your cursor to the Plugin of interest and then 355 | select a command. To install 'unite.vim' put your cursor on the line and 356 | then push `i`. For a more complete list see |vundle-keymappings|. After 357 | unite.vim is installed the `:Unite file` command should be available. 358 | 359 | Note: Interactive installation doesn't update your `.vimrc`. 360 | 361 | ============================================================================= 362 | 5. KEY MAPPINGS ~ 363 | *vundle-keymappings* 364 | 365 | KEY | DESCRIPTION 366 | ----|-------------------------- > 367 | i | run :PluginInstall with name taken from line cursor is positioned on 368 | I | same as i, but runs :PluginInstall! to update bundle 369 | D | delete selected bundle (be careful not to remove local modifications) 370 | c | run :PluginClean 371 | s | run :PluginSearch 372 | R | fetch fresh script list from server 373 | 374 | ============================================================================= 375 | 6. OPTIONS ~ 376 | *vundle-options* 377 | > 378 | let g:vundle_default_git_proto = 'git' 379 | < 380 | This option makes Vundle use `git` instead of `https` when building 381 | absolute URIs. For example: 382 | > 383 | Plugin 'sjl/gundo.vim' -> git@github.com:sjl/gundo.git 384 | 385 | ============================================================================= 386 | 7. VUNDLE INTERFACE CHANGE ~ 387 | *vundle-interface-change* *:Bundle* *:BundleInstall!* 388 | *:BundleUpdate* *:BundleSearch* *:BundleList* *:BundleClean!* 389 | *:VundleInstall!* *:VundleUpdate* *:VundleSearch* 390 | *:VundleList* *:VundleClean!* 391 | 392 | In order to bring in new changes, Vundle is adopting a new interface. 393 | Going forward we will support primarily the Plugin namespace, additionally 394 | for convenience we will also alias some commands to the Vundle namespace. 395 | The following table summarizes the interface changes. 396 | 397 | Deprecated Names | New Names 398 | ----------------------------- 399 | Bundle | Plugin 400 | BundleInstall(!) | PluginInstall(!), VundleInstall(!) 401 | BundleUpdate | PluginUpdate, VundleUpdate 402 | BundleSearch(!) | PluginSearch(!), VundleSearch(!) 403 | BundleClean | PluginClean(!), VundleClean(!) 404 | BundleList | PluginList 405 | 406 | Note: The Bundle commands will be deprecated. You may continue using them, 407 | but they may not get all future updates. For instance, we have enabled 408 | comments on Plugin lines but not Bundle, since it requires a change in 409 | command declaration. 410 | 411 | " vim: set expandtab sts=2 ts=2 sw=2 tw=78 ft=help norl: 412 | -------------------------------------------------------------------------------- /.vim/bundle/Vundle.vim/ftplugin/vundlelog.vim: -------------------------------------------------------------------------------- 1 | " --------------------------------------------------------------------------- 2 | " Standard ftplugin boilerplate; see ':help ftplugin'. 3 | " --------------------------------------------------------------------------- 4 | if exists("b:did_ftplugin") 5 | finish 6 | endif 7 | let b:did_ftplugin = 1 8 | 9 | 10 | " --------------------------------------------------------------------------- 11 | " Settings for the Vundle update log buffer. 12 | " --------------------------------------------------------------------------- 13 | setlocal textwidth=0 14 | setlocal nowrap 15 | setlocal noswapfile 16 | -------------------------------------------------------------------------------- /.vim/bundle/Vundle.vim/syntax/vundlelog.vim: -------------------------------------------------------------------------------- 1 | " --------------------------------------------------------------------------- 2 | " Syntax highlighting for the line which identifies the plugin. 3 | " --------------------------------------------------------------------------- 4 | syntax match VundlePluginName '\v(^Updated Plugin: )@<=.*$' 5 | highlight link VundlePluginName Keyword 6 | 7 | " --------------------------------------------------------------------------- 8 | " Syntax highlighting for the 'compare at' line of each plugin. 9 | " --------------------------------------------------------------------------- 10 | syntax region VundleCompareLine start='\v^Compare at: https:' end='\v\n' 11 | \ contains=VundleCompareUrl 12 | syntax match VundleCompareUrl '\vhttps:\S+' 13 | highlight link VundleCompareLine Comment 14 | highlight link VundleCompareUrl Underlined 15 | 16 | " --------------------------------------------------------------------------- 17 | " Syntax highlighting for individual commits. 18 | " --------------------------------------------------------------------------- 19 | " The main commit line. 20 | " Note that this regex is intimately related to the one for VundleCommitTree, 21 | " and the two should be changed in sync. 22 | syntax match VundleCommitLine '\v(^ [|*]( *[\\|/\*])* )@<=[^*|].*$' 23 | \ contains=VundleCommitMerge,VundleCommitUser,VundleCommitTime 24 | highlight link VundleCommitLine String 25 | " Sub-regions inside the commit message. 26 | syntax match VundleCommitMerge '\v Merge pull request #\d+.*' 27 | syntax match VundleCommitUser '\v( )@<=\S+( \S+)*(, \d+ \w+ ago$)@=' 28 | syntax match VundleCommitTime '\v(, )@<=\d+ \w+ ago$' 29 | highlight link VundleCommitMerge Ignore 30 | highlight link VundleCommitUser Identifier 31 | highlight link VundleCommitTime Comment 32 | " The git history DAG markers are outside of the main commit line region. 33 | " Note that this regex is intimately related to the one for VundleCommitLine, 34 | " and the two should be changed in sync. 35 | syntax match VundleCommitTree '\v(^ )@<=[|*]( *[\\|/\*])*' 36 | highlight link VundleCommitTree Label 37 | -------------------------------------------------------------------------------- /.vim/bundle/Vundle.vim/test/files/test.erl: -------------------------------------------------------------------------------- 1 | -module(mmc_logmon_sup). 2 | -behaviour(supervisor). 3 | -export([init/1]). 4 | 5 | init(_) -> 6 | {ok, { 7 | {one_for_one, 5, 1}, 8 | [ 9 | {listener, 10 | {aaa, start_link, []}, 11 | permanent, 100, worker, 12 | [aaa] 13 | }, 14 | {server, 15 | {bbb, start_link, []}, 16 | permanent, 100, worker, 17 | [bbb] 18 | } 19 | ] 20 | }}. 21 | -------------------------------------------------------------------------------- /.vim/bundle/Vundle.vim/test/minirc.vim: -------------------------------------------------------------------------------- 1 | set nocompatible 2 | syntax on 3 | filetype off 4 | set rtp+=~/.vim/bundle/Vundle.vim/ 5 | call vundle#begin() 6 | Plugin 'VundleVim/Vundle.vim' 7 | call vundle#end() 8 | filetype plugin indent on 9 | 10 | -------------------------------------------------------------------------------- /.vim/bundle/Vundle.vim/test/vimrc: -------------------------------------------------------------------------------- 1 | " vim -u test/vimrc 2 | set nocompatible 3 | 4 | set nowrap 5 | 6 | let bundle_dir = '/tmp/vundle-test/bundles/' 7 | " let src = 'http://github.com/gmarik/vundle.git' 8 | 9 | " Vundle Options 10 | " let g:vundle_default_git_proto = 'git' 11 | 12 | silent execute '!mkdir -p '.bundle_dir 13 | silent execute '!ln -f -s ~/.vim/bundle/Vundle.vim '.bundle_dir 14 | 15 | filetype off 16 | syntax on 17 | 18 | runtime macros/matchit.vim 19 | 20 | " This test should be executed in "test" directory 21 | exec 'set rtp^='.bundle_dir.'Vundle.vim/' 22 | 23 | call vundle#rc(bundle_dir) 24 | 25 | 26 | Plugin 'molokai' " vim-scripts name 27 | 28 | " github username with dashes 29 | Bundle 'vim-scripts/ragtag.vim' 30 | 31 | " original repo 32 | Bundle 'altercation/vim-colors-solarized' 33 | " with extension 34 | Bundle 'nelstrom/vim-mac-classic-theme.git' 35 | " 36 | " invalid uri 37 | "Bundle 'nonexistinguser/yupppierepo.git' 38 | 39 | " full uri 40 | Bundle 'https://github.com/vim-scripts/vim-game-of-life' 41 | " full uri 42 | Bundle 'git@github.com:gmarik/ingretu.git' 43 | " short uri 44 | Bundle 'gh:gmarik/snipmate.vim.git' 45 | Bundle 'github:mattn/gist-vim.git' 46 | 47 | " local uri stuff 48 | Bundle '~/Dropbox/.gitrepos/utilz.vim.git' 49 | " Bundle 'file://Dropbox/.gitrepos/utilz.vim.git' 50 | 51 | " with options 52 | Bundle 'rstacruz/sparkup.git', {'rtp': 'vim/'} 53 | Bundle 'matchit.zip', {'name': 'matchit'} 54 | 55 | " Camel case 56 | Bundle 'vim-scripts/RubySinatra' 57 | 58 | " syntax issue #203 59 | Bundle 'jimenezrick/vimerl' 60 | 61 | " Static bundle: Same name as a valid vim-scripts bundle 62 | Bundle 'latte', {'pinned' : 1} 63 | if !isdirectory(expand(bundle_dir) . '/latte') 64 | call mkdir(expand(bundle_dir) . '/latte', 'p') 65 | endif 66 | 67 | 68 | filetype plugin indent on " Automatically detect file types. 69 | 70 | set wildignore+=doc " should not break helptags 71 | set wildignore+=.git " should not break clone 72 | set wildignore+=.git/* " should not break clone 73 | set wildignore+=*/.git/* 74 | " TODO: helptags fails with this 75 | " set wildignore+=doc/* " should not break clone 76 | " set wildignore+=*/doc/* 77 | 78 | au VimEnter * BundleInstall 79 | 80 | " e test/files/erlang.erl 81 | " vim: set expandtab sts=2 ts=2 sw=2 tw=78: 82 | -------------------------------------------------------------------------------- /.vim/custom/ale.vim: -------------------------------------------------------------------------------- 1 | let g:ale_sign_error = '☢' 2 | let g:ale_sign_warning = '⚠' 3 | -------------------------------------------------------------------------------- /.vim/custom/colorizer.vim: -------------------------------------------------------------------------------- 1 | let g:colorizer_auto_filetype='css,html' 2 | -------------------------------------------------------------------------------- /.vim/custom/easyalign.vim: -------------------------------------------------------------------------------- 1 | xmap ga (EasyAlign) 2 | nmap ga (EasyAlign) 3 | -------------------------------------------------------------------------------- /.vim/custom/gui.vim: -------------------------------------------------------------------------------- 1 | " mostra caracteres que ficam escondidos: 2 | " tab: dois caracteres, um para a tab e outro para ocupar o espaço da tab 3 | " trail: caracter para espaços extras (sobrando no final de linha) 4 | " extends: mostra quando wrap está desligado e a linha excede o limite 5 | " precedes: mostra quando wrap está desligado e tem texto antes 6 | set listchars=tab:▸\ ,trail:·,extends:>,precedes:< 7 | 8 | " mostra os caracteres definidos acima 9 | set list 10 | 11 | " fundo escuro 12 | set background=dark 13 | -------------------------------------------------------------------------------- /.vim/custom/maps.vim: -------------------------------------------------------------------------------- 1 | " line numbers {{{ 2 | map srn :set number nonu rnu 3 | map snn :set number nu nornu 4 | " }}} 5 | -------------------------------------------------------------------------------- /.vim/custom/nerdtree.vim: -------------------------------------------------------------------------------- 1 | noremap nt :NERDTreeToggle 2 | -------------------------------------------------------------------------------- /.vim/custom/tagbar.vim: -------------------------------------------------------------------------------- 1 | noremap tb :TagbarToggle 2 | -------------------------------------------------------------------------------- /.vim/custom/theme.vim: -------------------------------------------------------------------------------- 1 | " Theme 2 | syntax enable 3 | " for vim 7 4 | set t_Co=256 5 | 6 | " for vim 8 7 | if (has("termguicolors")) 8 | set termguicolors 9 | endif 10 | 11 | colorscheme OceanicNext 12 | -------------------------------------------------------------------------------- /.vim/custom/tmux.vim: -------------------------------------------------------------------------------- 1 | " only for Neovim 2 | if has('nvim') 3 | set t_8b=^[[48;2;%lu;%lu;%lum 4 | set t_8f=^[[38;2;%lu;%lu;%lum 5 | endif 6 | -------------------------------------------------------------------------------- /.vim/custom/vundle.vim: -------------------------------------------------------------------------------- 1 | set nocompatible 2 | filetype off 3 | 4 | set rtp+=~/.vim/bundle/Vundle.vim 5 | call vundle#begin() 6 | " Plugin 'VundleVim/Vundle.vim' 7 | 8 | " programming 9 | Plugin 'rking/ag.vim' 10 | Plugin 'camelcasemotion' 11 | Plugin 'mattn/emmet-vim.git' 12 | Plugin 'scrooloose/nerdcommenter.git' 13 | Plugin 'scrooloose/nerdtree.git' 14 | Plugin 'Xuyuanp/nerdtree-git-plugin' 15 | Plugin 'ctrlpvim/ctrlp.vim' 16 | Plugin 'tpope/vim-fugitive' 17 | Plugin 'airblade/vim-gitgutter' 18 | Plugin 'junegunn/vim-easy-align.git' 19 | Plugin 'easymotion/vim-easymotion' 20 | Plugin 'sheerun/vim-polyglot' 21 | "Plugin 'vim-syntastic/syntastic' 22 | Plugin 'kshenoy/vim-signature' 23 | Plugin 'tpope/vim-surround' 24 | Plugin 'ludovicchabant/vim-gutentags' 25 | Plugin 'terryma/vim-multiple-cursors.git' 26 | Plugin 'chrisbra/Colorizer' 27 | Plugin 'AndrewRadev/splitjoin.vim' 28 | Plugin 'tpope/vim-abolish' 29 | Plugin 'w0rp/ale' 30 | 31 | Plugin 'tomtom/tlib_vim.git' 32 | Plugin 'MarcWeber/vim-addon-mw-utils.git' 33 | Plugin 'garbas/vim-snipmate' 34 | Plugin 'honza/vim-snippets.git' 35 | 36 | " colorschemes 37 | Plugin 'mhartington/oceanic-next' 38 | Plugin 'NLKNguyen/papercolor-theme' 39 | Plugin 'jacoborus/tender.vim' 40 | Plugin 'majutsushi/tagbar' 41 | 42 | " utils 43 | Plugin 'rhysd/open-pdf.vim' 44 | 45 | call vundle#end() 46 | filetype plugin indent on 47 | -------------------------------------------------------------------------------- /.vimrc: -------------------------------------------------------------------------------- 1 | " utilizando fold method como fold-marker, onde os comentários podem indicar 2 | " folds 3 | " vim:fdm=marker 4 | 5 | " configurações básicas {{{ 6 | set nocompatible " não precisamos ser totalmente compatíveis com o Vi! 7 | syntax on " habilita syntax highlight 8 | let mapleader="," 9 | " }}} 10 | 11 | " tabs default {{{ 12 | set tabstop=3 " número de espaços da tabulação 13 | set softtabstop=3 " número de espaços de tabulação para edição 14 | set shiftwidth=3 " número de espaços para usar com a indentação automática 15 | set expandtab " fim da guerra: use espaços ao invés de tabulações 16 | " }}} 17 | 18 | " plugin manager {{{ 19 | source ~/.vim/custom/vundle.vim 20 | " }}} 21 | 22 | " encoding {{{ 23 | set encoding=utf-8 " encoding utilizado dentro do editor 24 | set fileencoding=utf-8 " encoding utilizado para os arquivos 25 | " }}} 26 | 27 | " filetype {{{ 28 | filetype plugin on " carrega plugins do filetype 29 | filetype indent on " habilita indentação do filetype 30 | " }}} 31 | 32 | " visual {{{ 33 | set relativenumber " número relativo da linha, salva a pátria! 34 | set novisualbell " sem ficar piscando, enche o saco 35 | set smartindent " indenta linhas novas 36 | set foldmethod=indent " método de fold (dobras) baseado em indentação 37 | set ignorecase " ignora maiúsculas e minúsculas 38 | set hlsearch " destaca os termos de pesquisa que foram encontrados 39 | set incsearch " mostra o termo de pesquisa enquanto ele é digitado 40 | set laststatus=2 " sempre usar linhas de status 41 | set textwidth=80 " comprimento máximo do texto inserido antes de quebrar a linha 42 | set cursorline " destaca a linha que o cursor está 43 | set showmatch " mostra os parenteses que 'casam' 44 | set splitbelow " posiciona janelas divididas sempre abaixo da atual 45 | " }}} 46 | 47 | " backup {{{ 48 | set nobackup " não mantém arquivos .swp 49 | set writebackup " cria um arquivo de backup quando sobrescreve 50 | " }}} 51 | 52 | " sessões {{{ 53 | map ms :mksession! /tmp/session.vim 54 | map rs :source /tmp/session.vim 55 | " }}} 56 | 57 | " correção ortográfica {{{ 58 | map spon :set spell spelllang=pt 59 | map spof :set nospell 60 | " }}} 61 | 62 | source ~/.vim/custom/gui.vim 63 | source ~/.vim/custom/nerdtree.vim 64 | source ~/.vim/custom/tagbar.vim 65 | source ~/.vim/custom/easyalign.vim 66 | source ~/.vim/custom/theme.vim 67 | source ~/.vim/custom/colorizer.vim 68 | source ~/.vim/custom/tmux.vim 69 | source ~/.vim/custom/maps.vim 70 | source ~/.vim/custom/ale.vim 71 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Arquivos do Workshop de Vim 2 | 3 | Aqui estão os arquivos utilizados no workshop de Vim! 4 | 5 | ## Slides 6 | 7 | Os slides do workshop podem ser vistos em: 8 | 9 | [https://speakerdeck.com/taq/conhecendo-o-vim](https://speakerdeck.com/taq/conhecendo-o-vim) 10 | 11 | ## Instalação 12 | 13 | **Faça uma cópia do seu arquivo `.vimrc` e do diretório `.vim` antes!** 14 | 15 | Após a cópia, clone esse repositório e copie ou crie links simbólicos no seu 16 | diretório `home` para o arquivo `.vimrc` e o diretório `.vim` contidos aqui. 17 | 18 | Abra o Vim e digite: 19 | 20 | ``` 21 | :PluginInstall 22 | ``` 23 | 24 | Os plugins devem ser instalados. Feche e abra o Vim novamente e tudo deve estar 25 | funcionando corretamente. 26 | -------------------------------------------------------------------------------- /code/ruby/ar.rb: -------------------------------------------------------------------------------- 1 | class Ar 2 | def self.belongs_to(what) 3 | @belongs = what 4 | puts "Sou #{self.to_s.downcase} e pertenço à #{@belongs}!" 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /code/ruby/item.rb: -------------------------------------------------------------------------------- 1 | require_relative "ar.rb" 2 | 3 | class Item < Ar 4 | belongs_to :pedido 5 | end 6 | -------------------------------------------------------------------------------- /code/ruby/pedido.rb: -------------------------------------------------------------------------------- 1 | require_relative "ar.rb" 2 | 3 | class Pedido < Ar 4 | end 5 | -------------------------------------------------------------------------------- /code/ruby/teste.rb: -------------------------------------------------------------------------------- 1 | require_relative "ar.rb" 2 | require_relative "pedido.rb" 3 | require_relative "item.rb" 4 | 5 | order = Pedido.new 6 | item = Item.new 7 | --------------------------------------------------------------------------------