From 2b0ae7215f95d32a89860cf5e492ab20e4944f09 Mon Sep 17 00:00:00 2001 From: Techlive Zheng Date: Mon, 6 Aug 2012 11:20:14 +0800 Subject: [PATCH 01/72] Use the global bundles instead of reinitializing --- autoload/vundle/installer.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/autoload/vundle/installer.vim b/autoload/vundle/installer.vim index 036a756..d94fb77 100644 --- a/autoload/vundle/installer.vim +++ b/autoload/vundle/installer.vim @@ -100,7 +100,8 @@ endf func! vundle#installer#install(bang, name) abort if !isdirectory(g:bundle_dir) | call mkdir(g:bundle_dir, 'p') | endif - let b = vundle#config#init_bundle(a:name, {}) + let n = substitute(a:name,"['".'"]\+','','g') + let b = filter(copy(g:bundles), 'v:val.name_spec == n')[0] return s:sync(a:bang, b) endf From f31aa52552ceb40240e56e475e6df89cc756507e Mon Sep 17 00:00:00 2001 From: gmarik Date: Tue, 3 Dec 2013 18:43:46 -0600 Subject: [PATCH 02/72] remove donation link MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - until we figure out how to manage it… --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index f2cbd55..afc2250 100644 --- a/README.md +++ b/README.md @@ -64,10 +64,6 @@ Installation requires [Git] and triggers [`git clone`](http://gitref.org/creating/#clone) for each configured repo to `~/.vim/bundle/`. -4. Consider [donating](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=T44EJZX8RBUWY) - - [*Thank you*](http://j.mp/rSbm01) for supporting this project! - ## Why Vundle From a3c4c03a4c8730e526e21c3a65e69890a307d6a7 Mon Sep 17 00:00:00 2001 From: gmarik Date: Wed, 5 Feb 2014 18:19:57 -0600 Subject: [PATCH 03/72] Help maintain Vundle section --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index afc2250..6758f62 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +### Halp + +[Help maintain Vundle](https://github.com/gmarik/Vundle.vim/issues/241) + ## About [Vundle] is short for _Vim bundle_ and is a [Vim] plugin manager. From 6b45d873bc90dd8da8515c3fa77b2f681e7157b9 Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Fri, 7 Feb 2014 07:09:16 +0900 Subject: [PATCH 04/72] Fix #374 shellescape problem --- autoload/vundle/installer.vim | 15 +++++++-------- autoload/vundle/scripts.vim | 10 +++++----- test/vimrc | 13 ++++++------- 3 files changed, 18 insertions(+), 20 deletions(-) diff --git a/autoload/vundle/installer.vim b/autoload/vundle/installer.vim index bc807c3..c022386 100644 --- a/autoload/vundle/installer.vim +++ b/autoload/vundle/installer.vim @@ -174,7 +174,7 @@ func! vundle#installer#delete(bang, dir_name) abort \ 'rm -rf' let bundle = vundle#config#init_bundle(a:dir_name, {}) - let cmd .= ' '.shellescape(bundle.path()) + let cmd .= ' '.vundle#installer#shellesc(bundle.path()) let out = s:system(cmd) @@ -214,15 +214,15 @@ func! s:sync(bang, bundle) abort let git_dir = expand(a:bundle.path().'/.git/', 1) if isdirectory(git_dir) || filereadable(expand(a:bundle.path().'/.git', 1)) if !(a:bang) | return 'todate' | endif - let cmd = 'cd '.shellescape(a:bundle.path()).' && git pull && git submodule update --init --recursive' + let cmd = 'cd '.vundle#installer#shellesc(a:bundle.path()).' && git pull && git submodule update --init --recursive' let cmd = g:shellesc_cd(cmd) - let get_current_sha = 'cd '.shellescape(a:bundle.path()).' && git rev-parse HEAD' + let get_current_sha = 'cd '.vundle#installer#shellesc(a:bundle.path()).' && git rev-parse HEAD' let get_current_sha = g:shellesc_cd(get_current_sha) let initial_sha = s:system(get_current_sha)[0:15] else - let cmd = 'git clone --recursive '.shellescape(a:bundle.uri).' '.shellescape(a:bundle.path()) + let cmd = 'git clone --recursive '.vundle#installer#shellesc(a:bundle.uri).' '.vundle#installer#shellesc(a:bundle.path()) let initial_sha = '' endif @@ -250,19 +250,18 @@ func! s:sync(bang, bundle) abort return 'updated' endf -func! g:shellesc(cmd) abort +func! vundle#installer#shellesc(cmd) abort if ((has('win32') || has('win64')) && empty(matchstr(&shell, 'sh'))) - if &shellxquote != '(' " workaround for patch #445 + if &shellxquote != '(' " workaround for patch #445 return '"'.a:cmd.'"' " enclose in quotes so && joined cmds work endif endif - return a:cmd + return shellescape(a:cmd) endf func! g:shellesc_cd(cmd) abort if ((has('win32') || has('win64')) && empty(matchstr(&shell, 'sh'))) let cmd = substitute(a:cmd, '^cd ','cd /d ','') " add /d switch to change drives - let cmd = g:shellesc(cmd) return cmd else return a:cmd diff --git a/autoload/vundle/scripts.vim b/autoload/vundle/scripts.vim index ded6a46..0cd4d13 100644 --- a/autoload/vundle/scripts.vim +++ b/autoload/vundle/scripts.vim @@ -39,7 +39,7 @@ func! s:create_changelog() abort let updated_sha = bundle_data[1] let bundle = bundle_data[2] - let cmd = 'cd '.shellescape(bundle.path()). + let cmd = 'cd '.vundle#installer#shellesc(bundle.path()). \ ' && git log --pretty=format:"%s %an, %ar" --graph '. \ initial_sha.'..'.updated_sha @@ -155,13 +155,13 @@ func! s:fetch_scripts(to) let l:vim_scripts_json = 'http://vim-scripts.org/api/scripts.json' if executable("curl") - let cmd = 'curl --fail -s -o '.shellescape(a:to).' '.l:vim_scripts_json + let cmd = 'curl --fail -s -o '.vundle#installer#shellesc(a:to).' '.l:vim_scripts_json elseif executable("wget") - let temp = shellescape(tempname()) - let cmd = 'wget -q -O '.temp.' '.l:vim_scripts_json. ' && mv -f '.temp.' '.shellescape(a:to) + let temp = vundle#installer#shellesc(tempname()) + let cmd = 'wget -q -O '.temp.' '.l:vim_scripts_json. ' && mv -f '.temp.' '.vundle#installer#shellesc(a:to) if (has('win32') || has('win64')) let cmd = substitute(cmd, 'mv -f ', 'move /Y ', '') " change force flag - let cmd = g:shellesc(cmd) + let cmd = vundle#installer#shellesc(cmd) end else echoerr 'Error curl or wget is not available!' diff --git a/test/vimrc b/test/vimrc index 662709f..45e4d80 100644 --- a/test/vimrc +++ b/test/vimrc @@ -4,28 +4,27 @@ set nocompatible set nowrap let root = '/tmp/!vundle-test/bundles/' -let src = 'http://github.com/gmarik/vundle.git' +" let src = 'http://github.com/gmarik/vundle.git' " let src = '~/.vim/bundle/vundle/.git' " Vundle Options " let g:vundle_default_git_proto = 'git' -if !isdirectory(expand(root, 1).'/vundle') - exec '!git clone '.src.' '.shellescape(root, 1).'/vundle' -endif +" if !isdirectory(expand(root, 1).'/vundle') +" exec '!git clone '.src.' '.shellescape(root, 1).'/vundle' +" endif filetype off syntax on runtime macros/matchit.vim -exec 'set rtp+='.root.'/vundle' +" This test should be executed in "test" directory +set rtp+=.. call vundle#rc(root) -Bundle "gmarik/vundle" - " vim-scripts name Bundle 'molokai' From 4472ffa078944dd00860c74564eb29ffe1bf9ba2 Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Fri, 7 Feb 2014 07:22:38 +0900 Subject: [PATCH 05/72] Fix shellesc() --- autoload/vundle/installer.vim | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/autoload/vundle/installer.vim b/autoload/vundle/installer.vim index c022386..d99791f 100644 --- a/autoload/vundle/installer.vim +++ b/autoload/vundle/installer.vim @@ -252,9 +252,7 @@ endf func! vundle#installer#shellesc(cmd) abort if ((has('win32') || has('win64')) && empty(matchstr(&shell, 'sh'))) - if &shellxquote != '(' " workaround for patch #445 - return '"'.a:cmd.'"' " enclose in quotes so && joined cmds work - endif + return '"' . substitute(a:cmd, '"', '\\"', 'g') . '"' endif return shellescape(a:cmd) endf From b49939a9512e0e52d7a39f61376c704265b44ff6 Mon Sep 17 00:00:00 2001 From: Martin Lundberg Date: Tue, 11 Feb 2014 00:14:32 +0100 Subject: [PATCH 06/72] Some documentation fixes and changes 1. Fixed some lines which were wider than 78 characters. 2. Added a couple of more borders above all the sub-sections. 3. Moved about part above the TOC, seems unnecessary to have that as its own section when it's so small. This also look more like a default vim help file. 4. Changed "NOTE:" into "Note that" because that is more like how it's used in default vim files. 5. Changed some wording like "the plug-in manager" to "a plug-in manager". 6. Moved a couple of *tag names* below their headings so it's like that everywhere in the file. --- doc/vundle.txt | 139 +++++++++++++++++++++++++------------------------ 1 file changed, 70 insertions(+), 69 deletions(-) diff --git a/doc/vundle.txt b/doc/vundle.txt index bb4ea4f..fc196ae 100644 --- a/doc/vundle.txt +++ b/doc/vundle.txt @@ -1,48 +1,43 @@ -*vundle.txt* Vundle the plug-in manager for Vim. *vundle* - -CONTENTS ~ - *vundle-contents* -=========================================================================== - -1. About |vundle-about| -2. Why Vundle |vundle-why-vundle| -3. Quick start |vundle-quickstart| -4. Scripts |vundle-scripts| - 4.1. Configure scripts |vundle-scripts-configure| - 4.2. Installing scripts |vundle-scripts-install| - 4.3. Updating scripts |vundle-scripts-update| - 4.4. Searching scripts |vundle-scripts-search| - 4.5. Listing scripts |vundle-scripts-list| - 4.6. Cleanup |vundle-scripts-cleanup| -5. Interactive mode |vundle-interactive| -6. Key mappings |vundle-keymappings| -7. Options |vundle-options| - -=========================================================================== - -ABOUT *vundle-about* - -Vundle is a short cut for Vim bundle and is the Vim plug-in manager. - -2. WHY VUNDLE ~ +*vundle.txt* Vundle, a plug-in manager for Vim. *vundle* + + VUNDLE MANUAL + +Vundle is short for Vim bundle and is a Vim plug-in manager. + +1. Why Vundle |vundle-why-vundle| +2. Quick start |vundle-quickstart| +3. Scripts |vundle-scripts| + 3.1. Configure scripts |vundle-scripts-configure| + 3.2. Installing scripts |vundle-scripts-install| + 3.3. Updating scripts |vundle-scripts-update| + 3.4. Searching scripts |vundle-scripts-search| + 3.5. Listing scripts |vundle-scripts-list| + 3.6. Cleanup |vundle-scripts-cleanup| +4. Interactive mode |vundle-interactive| +5. Key mappings |vundle-keymappings| +6. Options |vundle-options| + +============================================================================= +1. WHY VUNDLE ~ *vundle-why-vundle* Vundle allows to: - keep track and configure your scripts right in `.vimrc` -- install configured scripts (aka bundle) +- install configured scripts (aka bundle) - update configured scripts - search [all available vim scripts] by name - clean up from unused scripts -Also *Vundle* : +Also Vundle: - manages runtime path of your installed scripts - regenerates helptags automatically -Vundle takes advantage of [vim-scripts.org](http://vim-scripts.org) +Vundle takes advantage of [vim-scripts.org](http://vim-scripts.org) in order to install/search [all available vim scripts] -3. QUICK START ~ +============================================================================= +2. QUICK START ~ *vundle-quickstart* 1) Setup Vundle: > @@ -55,7 +50,7 @@ in order to install/search [all available vim scripts] set nocompatible " be iMproved filetype off " required! - set rtp+=~/.vim/vundle.git/ + set rtp+=~/.vim/vundle.git/ call vundle#rc() " let Vundle manage Vundle @@ -77,9 +72,10 @@ in order to install/search [all available vim scripts] Bundle 'file:///Users/gmarik/path/to/plugin' " ... - filetype plugin indent on " required! - " or - " filetype plugin on " to not use the indentation settings set by plugins + filetype plugin indent on " required! + " or + " filetype plugin on " to not use the indentation settings set + " by plugins 3) Install configured bundles: @@ -87,19 +83,24 @@ in order to install/search [all available vim scripts] :BundleInstall -Installing requires [Git] and triggers [Git clone](http://gitref.org/creating/#clone) for -each configured repo to `~/.vim/bundle/`. +Installing requires [Git] and triggers +[Git clone](http://gitref.org/creating/#clone) for each configured repo to +`~/.vim/bundle/`. -4. SCRIPTS ~ +============================================================================= +3. SCRIPTS ~ *vundle-scripts* -4.1 CONFIGURE SCRIPTS ~ +3.1 CONFIGURE SCRIPTS ~ *vundle-scripts-configure* *Bundle* Before installing scripts they need to be configured. It's done using `Bundle` command in `.vimrc`: > - Bundle 'git_repo_uri' " 'git_repo_uri' should be a valid uri to git repository + Bundle 'git_repo_uri' " 'git_repo_uri' should be a valid uri to git + " repository or > - Bundle 'script_name' " 'script-name' should be an official script name (see |vundle-scripts-search| ) + + Bundle 'script_name' " 'script-name' should be an official script + " name (see |vundle-scripts-search|) Vundle loves Github, that's why short uris can be used with commands: > @@ -109,10 +110,10 @@ equals full uri > Bundle 'http://github.com/tpope/vim-fugitive.git' -NOTE: Vundle defaults to http:// protocol for the short URIs +Note that Vundle defaults to http:// protocol for the short URIs. -4.2 INSTALL SCRIPTS ~ +3.2 INSTALL SCRIPTS ~ *vundle-scripts-install* *BundleInstall* run > :BundleInstall @@ -124,11 +125,11 @@ BundleInstall allows to install scripts by name:> :BundleInstall unite.vim -installs and activates unite.vim. You can use Tab to auto-complete known script names. -NOTE: installation, as just described, doesn't automatically configure scripts; -you have to configure them manually. +installs and activates unite.vim. You can use Tab to auto-complete known +script names. Note that the installation, as just described, doesn't +automatically configure scripts; you have to configure them manually. -4.3 UPDATE SCRIPTS ~ +3.3 UPDATE SCRIPTS ~ *vundle-scripts-update* *BundleInstall!* run > :BundleInstall! " NOTE: bang(!) @@ -136,7 +137,7 @@ run > installs or updates configured scripts. press u after updates complete to see the changelog of all updated bundles. -4.4 SEARCHING ~ +3.4 SEARCHING ~ *vundle-scripts-search* *BundleSearch* run > :BundleSearch foo @@ -160,7 +161,7 @@ it will display all known scripts Searching requires [`curl`](http://curl.haxx.se/) -4.5 LISTING BUNDLES ~ +3.5 LISTING BUNDLES ~ *vundle-scripts-list* *BundleList* To quickly pull list of installed bundles use > @@ -168,7 +169,7 @@ To quickly pull list of installed bundles use > :BundleList -4.6 CLEANING UP ~ +3.6 CLEANING UP ~ *vundle-scripts-cleanup* *BundleClean* run > @@ -183,12 +184,12 @@ confirms removal of unused script-dirs from `.vim/bundle/`. removes unused dirs with no questions. - *vundle-interactive* -5. INTERACTIVE MODE ~ - -Vundle provides simple interactive mode to help you explore new scripts easily. -Interactive mode is available as result of any commands that display list of -bundles. For instance, running: > +============================================================================= +4. INTERACTIVE MODE ~ + *vundle-interactive* +Vundle provides simple interactive mode to help you explore new scripts +easily. Interactive mode is available as result of any commands that display +list of bundles. For instance, running: > :BundleSearch! unite @@ -204,17 +205,18 @@ content: > Bundle 'unite-font' Bundle 'unite-colorscheme' -As the first line(starting with `"Keymap:`) shows, certain actions may be applied -to selected bundles . Move cursor over line `Bundle 'unite.vim'` and press i -key(install, see |vundle-keymappings| for more details). -After unite.vim is installed - `:Unite file` command should be -available to prove 'unite.vim' availability. - -NOTE: Interactive installation doesn't update your .vimrc configuration. +As the first line(starting with `"Keymap:`) shows, certain actions may be +applied to selected bundles. Move cursor over line `Bundle 'unite.vim'` and +press i key (install, see |vundle-keymappings| for more details). After +unite.vim is installed - `:Unite file` command should be available to prove +'unite.vim' availability. - *vundle-keymappings* -6. KEY MAPPINGS ~ +Note that the interactive installation doesn't update your .vimrc +configuration. +============================================================================= +5. KEY MAPPINGS ~ + *vundle-keymappings* KEY | DESCRIPTION ----|-------------------------- > i | run :BundleInstall with name taken from line cursor is positioned on @@ -225,10 +227,9 @@ KEY | DESCRIPTION R | fetch fresh script list from server . - *vundle-options* -7. OPTIONS ~ - -> +============================================================================= +6. OPTIONS ~ + *vundle-options* let g:vundle_default_git_proto = 'git' makes Vundle use `git` instead default `https` when building absolute repo URIs From f9e31fd97f6c56c1d30e4a02fa132736cfb4789e Mon Sep 17 00:00:00 2001 From: Martin Lundberg Date: Tue, 11 Feb 2014 06:28:45 +0100 Subject: [PATCH 07/72] Language fixes after notes from @starcraftman --- doc/vundle.txt | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/doc/vundle.txt b/doc/vundle.txt index fc196ae..826c5f1 100644 --- a/doc/vundle.txt +++ b/doc/vundle.txt @@ -20,7 +20,7 @@ Vundle is short for Vim bundle and is a Vim plug-in manager. ============================================================================= 1. WHY VUNDLE ~ *vundle-why-vundle* -Vundle allows to: +Vundle allows you to: - keep track and configure your scripts right in `.vimrc` - install configured scripts (aka bundle) @@ -126,8 +126,9 @@ BundleInstall allows to install scripts by name:> :BundleInstall unite.vim installs and activates unite.vim. You can use Tab to auto-complete known -script names. Note that the installation, as just described, doesn't -automatically configure scripts; you have to configure them manually. +script names. Note that the installation just described isn't permanent. To +finish, you must put `Bundle 'unite.vim` at the appropriate line in your +`.vimrc` to tell Vundle to load the plugin at startup. 3.3 UPDATE SCRIPTS ~ *vundle-scripts-update* *BundleInstall!* @@ -187,9 +188,9 @@ removes unused dirs with no questions. ============================================================================= 4. INTERACTIVE MODE ~ *vundle-interactive* -Vundle provides simple interactive mode to help you explore new scripts -easily. Interactive mode is available as result of any commands that display -list of bundles. For instance, running: > +Vundle provides a simple interactive mode to help you explore new scripts +easily. Interactive mode is available as result of any commands that displays +a list of bundles. For instance, running: > :BundleSearch! unite @@ -205,11 +206,11 @@ content: > Bundle 'unite-font' Bundle 'unite-colorscheme' -As the first line(starting with `"Keymap:`) shows, certain actions may be -applied to selected bundles. Move cursor over line `Bundle 'unite.vim'` and -press i key (install, see |vundle-keymappings| for more details). After -unite.vim is installed - `:Unite file` command should be available to prove -'unite.vim' availability. +As the first line (starting with `"Keymap:`) shows, certain actions may be +applied to selected bundles. Move the cursor over the line `Bundle +'unite.vim'` and press i key (install, see |vundle-keymappings| for more +details). After unite.vim is installed - `:Unite file` command should be +available to prove 'unite.vim' availability. Note that the interactive installation doesn't update your .vimrc configuration. From de7d87d4d11f4d2a149f86897de97d1e40ddbdea Mon Sep 17 00:00:00 2001 From: "Jeremy Pallats/starcraft.man" Date: Sun, 16 Feb 2014 23:11:35 -0500 Subject: [PATCH 08/72] Updating the readme to be clearer. --- README.md | 123 +++++++++++++++++++++++++++--------------------------- 1 file changed, 61 insertions(+), 62 deletions(-) diff --git a/README.md b/README.md index 6758f62..38ea63f 100644 --- a/README.md +++ b/README.md @@ -1,53 +1,74 @@ -### Halp - -[Help maintain Vundle](https://github.com/gmarik/Vundle.vim/issues/241) +## [Help Maintain Vundle](https://github.com/gmarik/Vundle.vim/issues/241) ## About [Vundle] is short for _Vim bundle_ and is a [Vim] plugin manager. +[Vundle] allows you to... + +* keep track of and configure your scripts right in the `.vimrc` +* [install] configured scripts (a.k.a. bundle) +* [update] configured scripts +* [search] by name all available [Vim scripts] +* [clean] unused scripts up +* run the above actions in a *single keypress* with [interactive mode] + +[Vundle] automatically... + +* manages the [runtime path] of your installed scripts +* regenerates [help tags] after installing and updating + ![Vundle-installer](http://25.media.tumblr.com/tumblr_m8m96w06G81r39828o1_1280.png) -## Quick start +## Quick Start -1. Set up [Vundle]: +1. Introduction: - ``` - $ git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle - ``` + Installation requires [Git] and triggers [`git clone`] for each configured repository to `~/.vim/bundle/` by default. -2. Configure bundles: + If you are using Windows, go directly to [Windows setup]. If you run into any issues, please consult the [FAQ]. - Sample `.vimrc`: +2. Set up [Vundle]: + + `$ git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle` + +3. Configure Bundles: + + Put this at the top of your `.vimrc` to use Vundle. Remove bundles you don't need, they are for illustration purposes. ```vim - set nocompatible " be iMproved - filetype off " required! - + set nocompatible " be iMproved, required + filetype off " required + + " set the runtime path to include Vundle and initialize set rtp+=~/.vim/bundle/vundle/ call vundle#rc() - - " let Vundle manage Vundle - " required! + " alternatively, pass a path where Vundle should install bundles + "let path = '~/some/path/here' + "call vundle#rc(path) + + " let Vundle manage Vundle, required Bundle 'gmarik/vundle' - - " My bundles here: - " - " original repos on GitHub + + " The following are examples of different formats supported. + " Keep bundle commands between here and filetype plugin indent on. + " scripts on GitHub repos Bundle 'tpope/vim-fugitive' Bundle 'Lokaltog/vim-easymotion' - Bundle 'rstacruz/sparkup', {'rtp': 'vim/'} Bundle 'tpope/vim-rails.git' - " vim-scripts repos + " The sparkup vim script is in a subdirectory of this repo called vim. + " Pass the path to set the runtimepath properly. + Bundle 'rstacruz/sparkup', {'rtp': 'vim/'} + " scripts from http://vim-scripts.org/vim/scripts.html Bundle 'L9' Bundle 'FuzzyFinder' - " non-GitHub repos + " scripts not on GitHub Bundle 'git://git.wincent.com/command-t.git' - " Git repos on your local machine (i.e. when working on your own plugin) - Bundle 'file:///Users/gmarik/path/to/plugin' + " git repos on your local machine (i.e. when working on your own plugin) + Bundle 'file:///home/gmarik/path/to/plugin' " ... - - filetype plugin indent on " required! + + filetype plugin indent on " required " " Brief help " :BundleList - list configured bundles @@ -59,54 +80,30 @@ " NOTE: comments after Bundle commands are not allowed. ``` -3. Install configured bundles: - - Launch `vim`, run `:BundleInstall` - (or `vim +BundleInstall +qall` for CLI lovers) - - *Windows users*: see [Vundle for Windows](https://github.com/gmarik/vundle/wiki/Vundle-for-Windows) - - Installation requires [Git] and triggers [`git clone`](http://gitref.org/creating/#clone) for each configured repo to `~/.vim/bundle/`. - +4. Install Bundles: -## Why Vundle + Launch `vim` and run `:BundleInstall` -[Vundle] allows you to: - -- keep track of and configure your scripts right in `.vimrc` -- [install] configured scripts (a.k.a. bundle) -- [update] configured scripts -- [search] by name [all available Vim scripts] -- [clean] unused scripts up -- run the above actions in a *single keypress* with [interactive mode] - -[Vundle] also: - -- manages the [runtime path] of your installed scripts -- [regenerates help tags][helptags] automatically + To install from command line: `vim +BundleInstall +qall` ## Docs See the [`:h vundle`](https://github.com/gmarik/vundle/blob/master/doc/vundle.txt) Vimdoc for more details. -## People using Vundle +## People Using Vundle see [Examples](https://github.com/gmarik/vundle/wiki/Examples) -## FAQ - -see [the wiki](https://github.com/gmarik/vundle/wiki#faq) - ## Contributors see [Vundle contributors](https://github.com/gmarik/vundle/graphs/contributors) *Thank you!* -## Inspiration and ideas from +## Inspiration & Ideas -* [pathogen.vim] -* [Bundler] +* [pathogen.vim](http://github.com/tpope/vim-pathogen/) +* [Bundler](https://github.com/bundler/bundler) * [Scott Bronson](http://github.com/bronson) ## Also @@ -130,12 +127,14 @@ see [Vundle contributors](https://github.com/gmarik/vundle/graphs/contributors) * make it rock! [Vundle]:http://github.com/gmarik/vundle -[pathogen.vim]:http://github.com/tpope/vim-pathogen/ -[Bundler]:https://github.com/bundler/bundler +[Windows setup]:https://github.com/gmarik/vundle/wiki/Vundle-for-Windows +[FAQ]:https://github.com/gmarik/vundle/wiki [Vim]:http://www.vim.org [Git]:http://git-scm.com -[all available Vim scripts]:http://vim-scripts.org/vim/scripts.html -[helptags]:http://vimdoc.sourceforge.net/htmldoc/helphelp.html#:helptags +[`git clone`]:http://gitref.org/creating/#clone + +[Vim scripts]:http://vim-scripts.org/vim/scripts.html +[help tags]:http://vimdoc.sourceforge.net/htmldoc/helphelp.html#:helptags [runtime path]:http://vimdoc.sourceforge.net/htmldoc/options.html#%27runtimepath%27 [install]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L115-129 From 33f0f70663905593ea3a8ac3a7031a97866b0936 Mon Sep 17 00:00:00 2001 From: "Jeremy Pallats/starcraft.man" Date: Sun, 16 Feb 2014 22:23:03 -0500 Subject: [PATCH 09/72] Adding CONTRIBUTING file with guidelines for PRs and issues. --- CONTRIBUTING.md | 111 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..3188124 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,111 @@ +Pull Requests +============= + +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/). + +2. Clearly describe what you aim to fix or add to Vundle. + +3. Try to minimize code changes and use existing style/functions. + +Issues +====== + +## Check For Answers + +Before submitting an issue, be sure to check the following places for answers. + +1. Vundle docs at [`:h vundle`](https://github.com/gmarik/vundle/blob/master/doc/vundle.txt). + +2. The [FAQ](https://github.com/gmarik/Vundle.vim/search). + +3. [Search](https://github.com/gmarik/Vundle.vim/search) the repository for related issues. + +## Try To Eliminate Your Vimrc + +In order to make sure it isn't just `.vimrc` replace your own config file with the [minimal vimrc](https://github.com/gmarik/Vundle.vim/blob/master/test/minirc.vim). Clear out bundles and then try to reproduce. + +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. + +If you can still reproduce the problem, try to find the smallest `.vimrc` config file that creates the problem to include later. + +## Guidelines + +To better respond to issues please follow these general guidelines when explaining the problem. + +1. Clearly describe what the error is, if relevant attach output/screenshots. + +2. Describe how developers can reproduce the bug, the steps should be from starting Vim. + +3. Include your OS, version and architecture. For example, Windows 7 64, Kubuntu 13.04 32, etc... + +4. If relevant to reproducing the bug, include the smallest subset of your `.vimrc` that causes the issue. Put this in code tags. + +5. At the end of your issue, please put the output of `vim --version` in code tags. + +## Example Post + +I am using Vim on Kubuntu 13.04 64 bit and I get the following error... (add further explanation here) + +To reproduce the bug, use the vimrc file below and run `:BundleInstall`... (continue with steps) + +Vimrc: +``` +set nocompatible +syntax on +filetype off +set rtp+=~/.vim/bundle/vundle/ +call vundle#rc() +Bundle 'gmarik/vundle' +Bundle 'relevant/plugin' +filetype plugin indent on + +.... more user configs here... +``` + +Vim Version: +``` +VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 15 2013 10:58:39) +Included patches: 1-5 +Modified by pkg-vim-maintainers@lists.alioth.debian.org +Compiled by buildd@ +Huge version with GTK2 GUI. Features included (+) or not (-): ++arabic +file_in_path +mouse_sgr +tag_binary ++autocmd +find_in_path -mouse_sysmouse +tag_old_static ++balloon_eval +float +mouse_urxvt -tag_any_white ++browse +folding +mouse_xterm +tcl +++builtin_terms -footer +multi_byte +terminfo ++byte_offset +fork() +multi_lang +termresponse ++cindent +gettext -mzscheme +textobjects ++clientserver -hangul_input +netbeans_intg +title ++clipboard +iconv +path_extra +toolbar ++cmdline_compl +insert_expand +perl +user_commands ++cmdline_hist +jumplist +persistent_undo +vertsplit ++cmdline_info +keymap +postscript +virtualedit ++comments +langmap +printer +visual ++conceal +libcall +profile +visualextra ++cryptv +linebreak +python +viminfo ++cscope +lispindent -python3 +vreplace ++cursorbind +listcmds +quickfix +wildignore ++cursorshape +localmap +reltime +wildmenu ++dialog_con_gui +lua +rightleft +windows ++diff +menu +ruby +writebackup ++digraphs +mksession +scrollbind +X11 ++dnd +modify_fname +signs -xfontset +-ebcdic +mouse +smartindent +xim ++emacs_tags +mouseshape -sniff +xsmp_interact ++eval +mouse_dec +startuptime +xterm_clipboard ++ex_extra +mouse_gpm +statusline -xterm_save ++extra_search -mouse_jsbterm -sun_workshop ++farsi +mouse_netterm +syntax + system vimrc file: "$VIM/vimrc" + user vimrc file: "$HOME/.vimrc" + 2nd user vimrc file: "~/.vim/vimrc" + user exrc file: "$HOME/.exrc" + system gvimrc file: "$VIM/gvimrc" + user gvimrc file: "$HOME/.gvimrc" +2nd user gvimrc file: "~/.vim/gvimrc" + system menu file: "$VIMRUNTIME/menu.vim" + fall-back for $VIM: "/usr/share/vim" +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 +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 +``` From 215dd5f84277c89498ce494d88752c8286b1f6d0 Mon Sep 17 00:00:00 2001 From: gmarik Date: Fri, 21 Feb 2014 20:51:33 -0600 Subject: [PATCH 10/72] fixed test/vimrc --- test/vimrc | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/test/vimrc b/test/vimrc index 45e4d80..546e6dc 100644 --- a/test/vimrc +++ b/test/vimrc @@ -3,17 +3,14 @@ set nocompatible set nowrap -let root = '/tmp/!vundle-test/bundles/' +let bundle_dir = '/tmp/vundle-test/bundles/' " let src = 'http://github.com/gmarik/vundle.git' -" let src = '~/.vim/bundle/vundle/.git' - " Vundle Options " let g:vundle_default_git_proto = 'git' -" if !isdirectory(expand(root, 1).'/vundle') -" exec '!git clone '.src.' '.shellescape(root, 1).'/vundle' -" endif +silent execute '!mkdir -p '.bundle_dir +silent execute '!ln -f -s ~/.vim/bundle/vundle '.bundle_dir filetype off syntax on @@ -21,9 +18,9 @@ syntax on runtime macros/matchit.vim " This test should be executed in "test" directory -set rtp+=.. +exec 'set rtp^='.bundle_dir.'vundle/' -call vundle#rc(root) +call vundle#rc(bundle_dir) " vim-scripts name Bundle 'molokai' @@ -37,7 +34,7 @@ Bundle 'altercation/vim-colors-solarized' Bundle 'nelstrom/vim-mac-classic-theme.git' " " invalid uri -Bundle 'nonexistinguser/yupppierepo.git' +"Bundle 'nonexistinguser/yupppierepo.git' " full uri Bundle 'https://github.com/vim-scripts/vim-game-of-life' @@ -62,12 +59,12 @@ Bundle 'jimenezrick/vimerl' filetype plugin indent on " Automatically detect file types. -set wildignore+=doc " should not break helptags -set wildignore+=.git " should not break clone -set wildignore+=.git/* " should not break clone +set wildignore+=doc " should not break helptags +set wildignore+=.git " should not break clone +set wildignore+=.git/* " should not break clone set wildignore+=*/.git/* " TODO: helptags fails with this -" set wildignore+=doc/* " should not break clone +" set wildignore+=doc/* " should not break clone " set wildignore+=*/doc/* au VimEnter * BundleInstall From ec9625c628a67202b2d82d41a4d6f1e5879f85c1 Mon Sep 17 00:00:00 2001 From: gmarik Date: Fri, 21 Feb 2014 20:53:31 -0600 Subject: [PATCH 11/72] fixes helptags and wildigore issue #390 - resolve introduced in 08e9894d2 resolves only bundle dir - so '/doc/' dir doesn't loose its trailing slash --- autoload/vundle/installer.vim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/autoload/vundle/installer.vim b/autoload/vundle/installer.vim index d99791f..02c7903 100644 --- a/autoload/vundle/installer.vim +++ b/autoload/vundle/installer.vim @@ -199,10 +199,11 @@ func! s:has_doc(rtp) abort endf func! s:helptags(rtp) abort - let doc_path = a:rtp.'/doc/' + " it is important to keep trailing slash here + let doc_path = resolve(a:rtp).'/doc/' call s:log(':helptags '.doc_path) try - execute 'helptags ' . resolve(doc_path) + execute 'helptags ' . doc_path catch call s:log("> Error running :helptags ".doc_path) return 0 From f77d85cc28e938d33fe9f04ddb1f34c11709a9c9 Mon Sep 17 00:00:00 2001 From: Lucas Hoffmann Date: Sat, 22 Feb 2014 23:52:47 +0100 Subject: [PATCH 12/72] docs: explain directory argument to :Bundle Add some documentation to explain the directory argument (optional second argument) to the Bundle command. Maybe fixes #295 --- doc/vundle.txt | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/doc/vundle.txt b/doc/vundle.txt index 826c5f1..d17c94e 100644 --- a/doc/vundle.txt +++ b/doc/vundle.txt @@ -50,7 +50,7 @@ in order to install/search [all available vim scripts] set nocompatible " be iMproved filetype off " required! - set rtp+=~/.vim/vundle.git/ + set rtp+=~/.vim/bundle/vundle/ call vundle#rc() " let Vundle manage Vundle @@ -102,7 +102,7 @@ or > Bundle 'script_name' " 'script-name' should be an official script " name (see |vundle-scripts-search|) -Vundle loves Github, that's why short uris can be used with commands: > +Vundle loves Github, that's why short URIs can be used with commands: > Bundle 'tpope/vim-fugitive' @@ -112,6 +112,15 @@ equals full uri > Note that Vundle defaults to http:// protocol for the short URIs. +There can also be a second argument after URI. It has to be a dictionary with +a key called 'rtp'. The value for that key is a directory inside the +repository (relative path from the root of the repository) where the vim +plugin resides. For example: > + + Bundle 'any_valid_uri', {'rtp': 'some/subdir/'} + +This can be used with git repositories that put the vim plugin inside a +subdirectory. 3.2 INSTALL SCRIPTS ~ *vundle-scripts-install* *BundleInstall* @@ -145,8 +154,8 @@ run > lists bundles matching 'foo' in new a new split window, ie: > - Bundle "VimFootnotes" - Bundle "foo.vim" + Bundle 'VimFootnotes' + Bundle 'foo.vim' > and > From 56e78a349f4510ace4843e35cff995c49f087fd7 Mon Sep 17 00:00:00 2001 From: "Jeremy Pallats/starcraft.man" Date: Tue, 25 Feb 2014 21:29:17 -0500 Subject: [PATCH 13/72] Updated vundle.txt to align with new README. --- README.md | 14 +- doc/vundle.txt | 403 +++++++++++++++++++++++++++++-------------------- 2 files changed, 245 insertions(+), 172 deletions(-) diff --git a/README.md b/README.md index 38ea63f..d0fbbd7 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ 1. Introduction: Installation requires [Git] and triggers [`git clone`] for each configured repository to `~/.vim/bundle/` by default. + Curl is required for search. If you are using Windows, go directly to [Windows setup]. If you run into any issues, please consult the [FAQ]. @@ -69,6 +70,8 @@ " ... filetype plugin indent on " required + " To ignore plugin indent changes, instead use: + "filetype plugin on " " Brief help " :BundleList - list configured bundles @@ -78,6 +81,7 @@ " " see :h vundle for more details or wiki for FAQ " NOTE: comments after Bundle commands are not allowed. + " Put your stuff after this line ``` 4. Install Bundles: @@ -137,8 +141,8 @@ see [Vundle contributors](https://github.com/gmarik/vundle/graphs/contributors) [help tags]:http://vimdoc.sourceforge.net/htmldoc/helphelp.html#:helptags [runtime path]:http://vimdoc.sourceforge.net/htmldoc/options.html#%27runtimepath%27 -[install]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L115-129 -[update]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L131-137 -[search]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L139-161 -[clean]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L171-L183 -[interactive mode]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L186-213 +[install]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L179-198 +[update]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L200-209 +[search]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L211-238 +[clean]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L247-260 +[interactive mode]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L263-303 diff --git a/doc/vundle.txt b/doc/vundle.txt index d17c94e..4bc3a5f 100644 --- a/doc/vundle.txt +++ b/doc/vundle.txt @@ -1,248 +1,317 @@ -*vundle.txt* Vundle, a plug-in manager for Vim. *vundle* +*vundle.txt* Vundle, a plug-in manager for Vim. *vundle* - VUNDLE MANUAL + VUNDLE MANUAL -Vundle is short for Vim bundle and is a Vim plug-in manager. - -1. Why Vundle |vundle-why-vundle| -2. Quick start |vundle-quickstart| +1. About Vundle |vundle-about| +2. Quick Start |vundle-quickstart| 3. Scripts |vundle-scripts| - 3.1. Configure scripts |vundle-scripts-configure| - 3.2. Installing scripts |vundle-scripts-install| - 3.3. Updating scripts |vundle-scripts-update| - 3.4. Searching scripts |vundle-scripts-search| - 3.5. Listing scripts |vundle-scripts-list| - 3.6. Cleanup |vundle-scripts-cleanup| -4. Interactive mode |vundle-interactive| -5. Key mappings |vundle-keymappings| + 3.1. Configuring Scripts |vundle-scripts-configure| + 3.2. Supported URIs |vundle-uris| + 3.3. Installing Scripts |vundle-scripts-install| + 3.4. Updating Scripts |vundle-scripts-update| + 3.5. Searching Scripts |vundle-scripts-search| + 3.6. Listing Bundles |vundle-scripts-list| + 3.7. Cleaning Up |vundle-scripts-cleanup| +4. Interactive Mode |vundle-interactive| +5. Key Mappings |vundle-keymappings| 6. Options |vundle-options| ============================================================================= -1. WHY VUNDLE ~ - *vundle-why-vundle* -Vundle allows you to: - -- keep track and configure your scripts right in `.vimrc` -- install configured scripts (aka bundle) -- update configured scripts -- search [all available vim scripts] by name -- clean up from unused scripts +1. ABOUT VUNDLE ~ + *vundle-about* -Also Vundle: +Vundle is short for Vim bundle and is a Vim plugin manager. -- manages runtime path of your installed scripts -- regenerates helptags automatically +Vundle allows you to... -Vundle takes advantage of [vim-scripts.org](http://vim-scripts.org) -in order to install/search [all available vim scripts] + - keep track of and configure your scripts right in the `.vimrc` + - install configured scripts (a.k.a. bundle) + - update configured scripts + - search by name all available Vim scripts + - clean unused scripts up + - run the above actions in a single keypress with interactive mode -============================================================================= -2. QUICK START ~ - *vundle-quickstart* -1) Setup Vundle: > +Vundle automatically... - git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle + - manages the runtime path of your installed scripts + - regenerates help tags after installing and updating -2) Configure bundles: +Vundle's search uses http://vim-scripts.org to provide a list of all +available Vim scripts. - Sample `.vimrc`: > - - set nocompatible " be iMproved - filetype off " required! - - set rtp+=~/.vim/bundle/vundle/ - call vundle#rc() +============================================================================= +2. QUICK START ~ + *vundle-quickstart* - " let Vundle manage Vundle - Bundle 'gmarik/vundle' +1. Introduction: - " My Bundles here: - " - " original repos on github - Bundle 'tpope/vim-fugitive' - Bundle 'Lokaltog/vim-easymotion' - Bundle 'rstacruz/sparkup', {'rtp': 'vim/'} - " vim-scripts repos - Bundle 'L9' - Bundle 'FuzzyFinder' - Bundle 'rails.vim' - " non github repos - Bundle 'git://git.wincent.com/command-t.git' - " git repos on your local machine (ie. when working on your own plugin) - Bundle 'file:///Users/gmarik/path/to/plugin' - " ... + Installation requires `Git` and triggers git clone for each configured + repository to `~/.vim/bundle/` by default. Curl is required for search. - filetype plugin indent on " required! - " or - " filetype plugin on " to not use the indentation settings set - " by plugins + *vundle-windows* + If you are using Windows, see instructions on the Wiki + https://github.com/gmarik/Vundle.vim/wiki/Vundle-for-Windows. -3) Install configured bundles: + *vundle-faq* + If you run into any issues, please consult the FAQ at + https://github.com/gmarik/Vundle.vim/wiki - Launch `vim`, run > +2. Setup Vundle: +> + git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle +< +3. Configure bundles: + Put this at the top of your `.vimrc` to use Vundle. Remove bundles you + don't need, they are for illustration purposes. +> + set nocompatible " be iMproved, required + filetype off " required + + " set the runtime path to include Vundle and initialize + set rtp+=~/.vim/bundle/vundle/ + call vundle#rc() + " alternatively, pass a path where Vundle should install bundles + "let path = '~/some/path/here' + "call vundle#rc(path) + + " let Vundle manage Vundle, required + Bundle 'gmarik/vundle' + + " The following are examples of different formats supported. + " Keep bundle commands between here and filetype plugin indent on. + " scripts on GitHub repos + Bundle 'tpope/vim-fugitive' + Bundle 'Lokaltog/vim-easymotion' + Bundle 'tpope/vim-rails.git' + " The sparkup vim script is in a subdirectory of this repo called vim. + " Pass the path to set the runtimepath properly. + Bundle 'rstacruz/sparkup', {'rtp': 'vim/'} + " scripts from http://vim-scripts.org/vim/scripts.html + Bundle 'L9' + Bundle 'FuzzyFinder' + " scripts not on GitHub + Bundle 'git://git.wincent.com/command-t.git' + " git repos on your local machine (i.e. when working on your own plugin) + Bundle 'file:///home/gmarik/path/to/plugin' + " ... + + filetype plugin indent on " required + " To ignore plugin indent changes, instead use: + "filetype plugin on + " Put your stuff after this line + +4. Install configured bundles: + + Launch vim and run +> :BundleInstall - -Installing requires [Git] and triggers -[Git clone](http://gitref.org/creating/#clone) for each configured repo to -`~/.vim/bundle/`. +< + To install from command line: +> + vim +BundleInstall +qall ============================================================================= 3. SCRIPTS ~ - *vundle-scripts* -3.1 CONFIGURE SCRIPTS ~ - *vundle-scripts-configure* *Bundle* -Before installing scripts they need to be configured. It's done using `Bundle` -command in `.vimrc`: > - - Bundle 'git_repo_uri' " 'git_repo_uri' should be a valid uri to git - " repository -or > - - Bundle 'script_name' " 'script-name' should be an official script - " name (see |vundle-scripts-search|) + *vundle-scripts* -Vundle loves Github, that's why short URIs can be used with commands: > - - Bundle 'tpope/vim-fugitive' +3.1 CONFIGURING SCRIPTS ~ + *vundle-scripts-configure* *:Bundle* -equals full uri > +Vundle tracks what scripts you want configured by the `Bundle` commands in your +`.vimrc`. Each `Bundle` command tells Vundle to activate the script on startup +adding it to your runtimepath. Commenting out or removing the line will +disable the `Bundle`. - Bundle 'http://github.com/tpope/vim-fugitive.git' - -Note that Vundle defaults to http:// protocol for the short URIs. +Each `Bundle` command takes a URI pointing to the script. No comments should +follow on the same line as the command. Example: +> + Bundle 'git_URI' There can also be a second argument after URI. It has to be a dictionary with a key called 'rtp'. The value for that key is a directory inside the repository (relative path from the root of the repository) where the vim -plugin resides. For example: > - - Bundle 'any_valid_uri', {'rtp': 'some/subdir/'} +plugin resides. For example: +> + Bundle 'git_URI', {'rtp': 'some/subdir/'} This can be used with git repositories that put the vim plugin inside a subdirectory. -3.2 INSTALL SCRIPTS ~ - *vundle-scripts-install* *BundleInstall* -run > - :BundleInstall -installs configured scripts. Newly installed scripts will be automatically -enabled. Except special cases requiring compilation or pre-configuration. +3.2 SUPPORTED URIS ~ + *vundle-uris* -BundleInstall allows to install scripts by name:> +`Vundle` integrates very well with both GitHub and vim-scripts.org +(http://vim-scripts.org/vim/scripts.html) allowing short URIs. It also allows +the use of any URI `git` recognizes. In all of the following cases (except +local) the 'https' protocol is used, see Vundle's options to override this. - :BundleInstall unite.vim +More information on `git`'s protocols can be found at: +http://git-scm.com/book/ch4-1.html -installs and activates unite.vim. You can use Tab to auto-complete known -script names. Note that the installation just described isn't permanent. To -finish, you must put `Bundle 'unite.vim` at the appropriate line in your -`.vimrc` to tell Vundle to load the plugin at startup. - -3.3 UPDATE SCRIPTS ~ - *vundle-scripts-update* *BundleInstall!* -run > - :BundleInstall! " NOTE: bang(!) +GitHub +------ +GitHub is used when a user/repo is passed to `Bundle`. +> + Bundle 'gmarik/Vundle.vim' => https://github.com/gmarik/Vundle.vim -installs or updates configured scripts. -press u after updates complete to see the changelog of all updated bundles. +Vim Scripts +----------- +Any single word without a '/' is assumed to be from Vim Scripts. +> + Bundle 'ctrlp.vim' => https://github.com/vim-scripts/ctrlp.vim -3.4 SEARCHING ~ - *vundle-scripts-search* *BundleSearch* -run > - :BundleSearch foo +Other Git URIs +-------------- +No modification is performed on valid URIs that point outside the above +URLs. +> + Bundle 'git://git.wincent.com/command-t.git' -lists bundles matching 'foo' in new a new split window, ie: +Local Plugins +------------- +The git protocol supports local installation using the 'file://' protocol. +This is handy when developing plugins locally. Follow the protocol with an +absolute path to the script directory. > - Bundle 'VimFootnotes' - Bundle 'foo.vim' + Bundle 'file///path/from/root/to/plugin' + +3.3 INSTALLING SCRIPTS ~ + *vundle-scripts-install* *:BundleInstall* > -and > + :BundleInstall - :BundleSearch! foo +Will install all plugins configured in your `.vimrc`. Newly installed +scripts will be automatically enabled. Some scripts may require extra steps +such as compilation or external programs, refer to their documentation. -refreshes script list before performing actual search. +BundleInstall allows installation of scripts by name: +> + :BundleInstall unite.vim -If command is run without argument: > +Installs and activates unite.vim. You can use Tab to auto-complete known +script names. Note that the installation just described isn't permanent. To +finish, you must put `Bundle 'unite.vim'` at the appropriate place in your +`.vimrc` to tell Vundle to load the plugin at startup. - :BundleSearch! +After installing scripts press 'l' (lowercase 'L') to see the log of commands +if any errors occurred. -it will display all known scripts +3.4 UPDATING SCRIPTS ~ + *vundle-scripts-update* *:BundleUpdate* *:BundleInstall!* +> + :BundleInstall! " NOTE: bang(!) +or > + :BundleUpdate -Searching requires [`curl`](http://curl.haxx.se/) +Installs or updates the configured scripts. Press 'u' after updates complete +to see the change log of all updated bundles. Press 'l' (lowercase 'L') to +see the log of commands if any errors occurred. -3.5 LISTING BUNDLES ~ - *vundle-scripts-list* *BundleList* +3.5 SEARCHING SCRIPTS ~ + *vundle-scripts-search* *:BundleSearch* +> + :BundleSearch -To quickly pull list of installed bundles use > +Search requires that `curl` be available on the system. The command searches +Vim Scripts (http://vim-scripts.org/vim/scripts.html) for matching +plugins. Results display in a new split window. For example: +> + BundleSearch foo - :BundleList +displays: +> + "Search results for: foo + Bundle 'MarkdownFootnotes' + Bundle 'VimFootnotes' + Bundle 'foo.vim' +< + *:BundleSearch!* +Alternatively, you can refresh the script list before searching by adding a +bang to the command. +> + :BundleSearch! foo +If the command is run without argument: +> + :BundleSearch! -3.6 CLEANING UP ~ - *vundle-scripts-cleanup* *BundleClean* -run > +it will display all known scripts in the new split. - :BundleClean +3.6 LISTING BUNDLES ~ + *vundle-scripts-list* *:BundleList* +> + :BundleList -confirms removal of unused script-dirs from `.vim/bundle/`. +Displays a list of installed bundles. - *BundleClean!* +3.7 CLEANING UP ~ + *vundle-scripts-cleanup* *:BundleClean* > - :BundleClean! + :BundleClean -removes unused dirs with no questions. +Requests confirmation for the removal of all scripts no longered configured +in your `.vimrc` but present in your bundle installation directory +(default: `.vim/bundle/`). + *:BundleClean!* +> + :BundleClean! + +Automatically confirm removal of unused bundles. ============================================================================= 4. INTERACTIVE MODE ~ - *vundle-interactive* -Vundle provides a simple interactive mode to help you explore new scripts -easily. Interactive mode is available as result of any commands that displays -a list of bundles. For instance, running: > - - :BundleSearch! unite - -triggers search for scripts matching 'unite' and yields a split window with -content: > + *vundle-interactive* - "Keymap: i - Install bundle; c - Cleanup; r - Refine list; R - Reload list - "Search results for: unite - Bundle 'unite.vim' - Bundle 'unite-yarm' - Bundle 'unite-gem' - Bundle 'unite-locate' - Bundle 'unite-font' - Bundle 'unite-colorscheme' - -As the first line (starting with `"Keymap:`) shows, certain actions may be -applied to selected bundles. Move the cursor over the line `Bundle -'unite.vim'` and press i key (install, see |vundle-keymappings| for more -details). After unite.vim is installed - `:Unite file` command should be -available to prove 'unite.vim' availability. +Vundle provides a simple interactive mode to help you explore new scripts +easily. Interactive mode is available after any command that lists `Bundles` +such as BundleSearch, BundleList or Bundles. For instance: +> + :BundleSearch! unite -Note that the interactive installation doesn't update your .vimrc -configuration. +Searches for scripts matching 'unite' and yields a split window with: +> + "Keymap: i - Install bundle; c - Cleanup; s - Search; R - Reload list + "Search results for: unite + Bundle 'unite-scriptenames' + Bundle 'unite.vim' + Bundle 'unite-yarm' + Bundle 'unite-gem' + Bundle 'unite-locate' + Bundle 'unite-font' + Bundle 'unite-colorscheme' + +To install a bundle, move your cursor to the Bundle of interest and then +select a command. To install 'unite.vim' put your cursor on the line and +then push `i`. For a more complete list see |vundle-keymappings|. After +unite.vim is installed the `:Unite file` command should be available. + +Note: Interactive installation doesn't update your `.vimrc`. ============================================================================= 5. KEY MAPPINGS ~ - *vundle-keymappings* + *vundle-keymappings* + KEY | DESCRIPTION ----|-------------------------- > i | run :BundleInstall with name taken from line cursor is positioned on I | same as i, but runs :BundleInstall! to update bundle - D | delete selected bundle( be careful not to remove local modifications) + D | delete selected bundle (be careful not to remove local modifications) c | run :BundleClean s | run :BundleSearch R | fetch fresh script list from server -. ============================================================================= 6. OPTIONS ~ - *vundle-options* + *vundle-options* +> let g:vundle_default_git_proto = 'git' - -makes Vundle use `git` instead default `https` when building absolute repo URIs - +< + This option makes Vundle use `git` instead of `https` when building + absolute URIs. For example: +> + Bundle 'sjl/gundo.vim' -> git@github.com:sjl/gundo.git vim:tw=78:ts=8:ft=help:norl: From 2d2690e41f875466b7de06f93e7ff93b8c50a9af Mon Sep 17 00:00:00 2001 From: Marius Gedminas Date: Thu, 13 Mar 2014 15:47:57 +0200 Subject: [PATCH 14/72] Don't touch 'ignorecase' Should fix #231. --- autoload/vundle/scripts.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/vundle/scripts.vim b/autoload/vundle/scripts.vim index 0cd4d13..d8989ed 100644 --- a/autoload/vundle/scripts.vim +++ b/autoload/vundle/scripts.vim @@ -99,7 +99,7 @@ func! vundle#scripts#view(title, headers, results) setl noswapfile setl cursorline - setl nonu ro noma ignorecase + setl nonu ro noma if (exists('&relativenumber')) | setl norelativenumber | endif setl ft=vundle From a30bedf26cc5d9123cedeab8ee501e82f809a0bf Mon Sep 17 00:00:00 2001 From: Jacobo de Vera Date: Thu, 20 Mar 2014 09:11:22 +0100 Subject: [PATCH 15/72] Make bundle options visible to installer Bundle configuration options that are inferred from the bundle specs overwrite user provided ones. This used to prevent users from changing the name of directory where the cloned bundle should go, for instance. Keep the user provided options with a preference over inferred ones. --- autoload/vundle/config.vim | 2 +- doc/vundle.txt | 31 +++++++++++++++++++++++++++---- test/vimrc | 1 + 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/autoload/vundle/config.vim b/autoload/vundle/config.vim index 5bb6e3f..88a414a 100644 --- a/autoload/vundle/config.vim +++ b/autoload/vundle/config.vim @@ -27,7 +27,7 @@ func! vundle#config#init_bundle(name, opts) if a:name != substitute(a:name, '^\s*\(.\{-}\)\s*$', '\1', '') echo "Spurious leading and/or trailing whitespace found in bundle spec '" . a:name . "'" endif - let opts = extend(s:parse_options(a:opts), s:parse_name(substitute(a:name,"['".'"]\+','','g'))) + let opts = extend(s:parse_options(a:opts), s:parse_name(substitute(a:name,"['".'"]\+','','g')), 'keep') let b = extend(opts, copy(s:bundle)) let b.rtpath = s:rtpath(opts) return b diff --git a/doc/vundle.txt b/doc/vundle.txt index 4bc3a5f..c860d7f 100644 --- a/doc/vundle.txt +++ b/doc/vundle.txt @@ -128,16 +128,39 @@ follow on the same line as the command. Example: > Bundle 'git_URI' -There can also be a second argument after URI. It has to be a dictionary with -a key called 'rtp'. The value for that key is a directory inside the -repository (relative path from the root of the repository) where the vim -plugin resides. For example: +The `Bundle` command can optionally take a second argument after the URI. It +has to be a dictionary, separated from the URI by a comma. Each key-value pair +in the dictionary is a configuration option. + +The following per-script configuration options are available. + +The 'rtp' option +---------------- + +Specifies a directory inside the repository (relative path from the root of +the repository) where the vim plugin resides. It determines the path that will +be added to the |runtimepath|. + +For example: > Bundle 'git_URI', {'rtp': 'some/subdir/'} This can be used with git repositories that put the vim plugin inside a subdirectory. +The 'name' option +----------------- + +The name of the directory that will hold the local clone of the configured +script. + +For example: +> + Bundle 'git_URI', {'name': 'newPluginName'} + +This can be used to prevent name collisions between plugins that Vundle would +otherwise try to clone into the same directory. It also provides an additional +level of customisation. 3.2 SUPPORTED URIS ~ *vundle-uris* diff --git a/test/vimrc b/test/vimrc index 546e6dc..bfaaf32 100644 --- a/test/vimrc +++ b/test/vimrc @@ -50,6 +50,7 @@ Bundle '~/Dropbox/.gitrepos/utilz.vim.git' " with options Bundle 'rstacruz/sparkup.git', {'rtp': 'vim/'} +Bundle 'matchit.zip', {'name': 'matchit'} " Camel case Bundle 'vim-scripts/RubySinatra' From 21326e161caf54536fd7d7c1778e4c5fd0f686a7 Mon Sep 17 00:00:00 2001 From: "Jeremy Pallats/starcraft.man" Date: Fri, 21 Mar 2014 19:05:05 -0400 Subject: [PATCH 16/72] Fixes issues #407. --- autoload/vundle/installer.vim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/autoload/vundle/installer.vim b/autoload/vundle/installer.vim index 48fae6d..55dbeff 100644 --- a/autoload/vundle/installer.vim +++ b/autoload/vundle/installer.vim @@ -101,7 +101,13 @@ func! vundle#installer#install(bang, name) abort if !isdirectory(g:bundle_dir) | call mkdir(g:bundle_dir, 'p') | endif let n = substitute(a:name,"['".'"]\+','','g') - let b = filter(copy(g:bundles), 'v:val.name_spec == n')[0] + let matched = filter(copy(g:bundles), 'v:val.name_spec == n') + + if len(matched) > 0 + let b = matched[0] + else + let b = vundle#config#init_bundle(a:name, {}) + endif return s:sync(a:bang, b) endf From 0521de95eac09298c4e71b3662839612280c1ae9 Mon Sep 17 00:00:00 2001 From: gmarik Date: Tue, 18 Mar 2014 13:50:51 -0500 Subject: [PATCH 17/72] use Plugin instead Bundle - closes many issues ) --- README.md | 66 +++++----- autoload/vundle.vim | 44 ++++++- autoload/vundle/config.vim | 6 +- autoload/vundle/installer.vim | 29 ++-- autoload/vundle/scripts.vim | 31 ++--- doc/vundle.txt | 240 +++++++++++++++++++++------------- test/vimrc | 5 +- 7 files changed, 265 insertions(+), 156 deletions(-) diff --git a/README.md b/README.md index d0fbbd7..95c5ec0 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,11 @@ [Vundle] allows you to... -* keep track of and configure your scripts right in the `.vimrc` -* [install] configured scripts (a.k.a. bundle) -* [update] configured scripts +* keep track of and [configure] your plugins right in the `.vimrc` +* [install] configured plugins (a.k.a. scripts/bundle) +* [update] configured plugins * [search] by name all available [Vim scripts] -* [clean] unused scripts up +* [clean] unused plugins up * run the above actions in a *single keypress* with [interactive mode] [Vundle] automatically... @@ -18,6 +18,8 @@ * manages the [runtime path] of your installed scripts * regenerates [help tags] after installing and updating +[Vundle] is undergoing an [interface change], please stay up to date to get latest changes. + ![Vundle-installer](http://25.media.tumblr.com/tumblr_m8m96w06G81r39828o1_1280.png) ## Quick Start @@ -33,9 +35,9 @@ `$ git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle` -3. Configure Bundles: +3. Configure Plugins: - Put this at the top of your `.vimrc` to use Vundle. Remove bundles you don't need, they are for illustration purposes. + Put this at the top of your `.vimrc` to use Vundle. Remove plugins you don't need, they are for illustration purposes. ```vim set nocompatible " be iMproved, required @@ -44,29 +46,29 @@ " set the runtime path to include Vundle and initialize set rtp+=~/.vim/bundle/vundle/ call vundle#rc() - " alternatively, pass a path where Vundle should install bundles + " alternatively, pass a path where Vundle should install plugins "let path = '~/some/path/here' "call vundle#rc(path) " let Vundle manage Vundle, required - Bundle 'gmarik/vundle' + Plugin 'gmarik/vundle' " The following are examples of different formats supported. - " Keep bundle commands between here and filetype plugin indent on. + " Keep Plugin commands between here and filetype plugin indent on. " scripts on GitHub repos - Bundle 'tpope/vim-fugitive' - Bundle 'Lokaltog/vim-easymotion' - Bundle 'tpope/vim-rails.git' + Plugin 'tpope/vim-fugitive' + Plugin 'Lokaltog/vim-easymotion' + Plugin 'tpope/vim-rails.git' " The sparkup vim script is in a subdirectory of this repo called vim. " Pass the path to set the runtimepath properly. - Bundle 'rstacruz/sparkup', {'rtp': 'vim/'} + Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} " scripts from http://vim-scripts.org/vim/scripts.html - Bundle 'L9' - Bundle 'FuzzyFinder' + Plugin 'L9' + Plugin 'FuzzyFinder' " scripts not on GitHub - Bundle 'git://git.wincent.com/command-t.git' + Plugin 'git://git.wincent.com/command-t.git' " git repos on your local machine (i.e. when working on your own plugin) - Bundle 'file:///home/gmarik/path/to/plugin' + Plugin 'file:///home/gmarik/path/to/plugin' " ... filetype plugin indent on " required @@ -74,21 +76,21 @@ "filetype plugin on " " Brief help - " :BundleList - list configured bundles - " :BundleInstall(!) - install (update) bundles - " :BundleSearch(!) foo - search (or refresh cache first) for foo - " :BundleClean(!) - confirm (or auto-approve) removal of unused bundles + " :PluginList - list configured plugins + " :PluginInstall(!) - install (update) plugins + " :PluginSearch(!) foo - search (or refresh cache first) for foo + " :PluginClean(!) - confirm (or auto-approve) removal of unused plugins " " see :h vundle for more details or wiki for FAQ - " NOTE: comments after Bundle commands are not allowed. + " NOTE: comments after Plugin commands are not allowed. " Put your stuff after this line ``` -4. Install Bundles: +4. Install Plugins: - Launch `vim` and run `:BundleInstall` + Launch `vim` and run `:PluginInstall` - To install from command line: `vim +BundleInstall +qall` + To install from command line: `vim +PluginInstall +qall` ## Docs @@ -118,7 +120,7 @@ see [Vundle contributors](https://github.com/gmarik/vundle/graphs/contributors) ## TODO: [Vundle] is a work in progress, so any ideas and patches are appreciated. -* ✓ activate newly added bundles on `.vimrc` reload or after `:BundleInstall` +* ✓ activate newly added bundles on `.vimrc` reload or after `:PluginInstall` * ✓ use preview window for search results * ✓ Vim documentation * ✓ put Vundle in `bundles/` too (will fix Vundle help) @@ -141,8 +143,10 @@ see [Vundle contributors](https://github.com/gmarik/vundle/graphs/contributors) [help tags]:http://vimdoc.sourceforge.net/htmldoc/helphelp.html#:helptags [runtime path]:http://vimdoc.sourceforge.net/htmldoc/options.html#%27runtimepath%27 -[install]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L179-198 -[update]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L200-209 -[search]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L211-238 -[clean]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L247-260 -[interactive mode]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L263-303 +[configure]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L122-L205 +[install]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L207-L226 +[update]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L228-L237 +[search]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L239-L267 +[clean]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L276-L289 +[interactive mode]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L292-L331 +[interface change]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L345-L369 diff --git a/autoload/vundle.vim b/autoload/vundle.vim index 0bc7bf5..adf1b87 100644 --- a/autoload/vundle.vim +++ b/autoload/vundle.vim @@ -4,6 +4,48 @@ " Readme: http://github.com/gmarik/vundle/blob/master/README.md " Version: 0.9 +" Plugin Commands +com! -nargs=+ -bar Plugin +\ call vundle#config#bundle() + +com! -nargs=? -bang -complete=custom,vundle#scripts#complete PluginInstall +\ call vundle#installer#new('!' == '', ) + +com! -nargs=? -bang -complete=custom,vundle#scripts#complete PluginSearch +\ call vundle#scripts#all('!'=='', ) + +com! -nargs=? -bang -complete=custom,vundle#scripts#complete Plugins +\ call vundle#scripts#all('!'=='', ) + +com! -nargs=0 -bang PluginList +\ call vundle#installer#list('!'=='') + +com! -nargs=? -bang PluginClean +\ call vundle#installer#clean('!' == '') + +com! -nargs=0 PluginDocs +\ call vundle#installer#helptags(g:bundles) + +" Aliases +com! PluginUpdate PluginInstall! + +" Vundle Aliases +com! -nargs=? -bang -complete=custom,vundle#scripts#complete VundleInstall +\ call vundle#installer#new('!' == '', ) + +com! -nargs=? -bang -complete=custom,vundle#scripts#complete VundleSearch +\ call vundle#scripts#all('!'=='', ) + +com! -nargs=? -bang VundleClean +\ call vundle#installer#clean('!' == '') + +com! -nargs=0 VundleDocs +\ call vundle#installer#helptags(g:bundles) + +" Aliases +com! VundleUpdate PluginInstall! + +" deprecated com! -nargs=+ Bundle \ call vundle#config#bundle() @@ -22,7 +64,7 @@ com! -nargs=0 -bang BundleList com! -nargs=? -bang BundleClean \ call vundle#installer#clean('!' == '') -com! -nargs=0 BundleDocs +com! -nargs=0 BundleDocs \ call vundle#installer#helptags(g:bundles) " Aliases diff --git a/autoload/vundle/config.vim b/autoload/vundle/config.vim index 5bb6e3f..7bcf647 100644 --- a/autoload/vundle/config.vim +++ b/autoload/vundle/config.vim @@ -25,9 +25,9 @@ endf func! vundle#config#init_bundle(name, opts) if a:name != substitute(a:name, '^\s*\(.\{-}\)\s*$', '\1', '') - echo "Spurious leading and/or trailing whitespace found in bundle spec '" . a:name . "'" + echo "Spurious leading and/or trailing whitespace found in plugin spec '" . a:name . "'" endif - let opts = extend(s:parse_options(a:opts), s:parse_name(substitute(a:name,"['".'"]\+','','g'))) + let opts = extend(s:parse_options(a:opts), s:parse_name(substitute(a:name,"['".'"]\+','','g')), 'keep') let b = extend(opts, copy(s:bundle)) let b.rtpath = s:rtpath(opts) return b @@ -55,7 +55,7 @@ func! s:parse_name(arg) let uri .= '.git' endif let name = substitute(split(uri,'\/')[-1], '\.git\s*$','','i') - elseif arg =~? '^\s*\(git@\|git://\)\S\+' + elseif arg =~? '^\s*\(git@\|git://\)\S\+' \ || arg =~? '\(file\|https\?\)://' \ || arg =~? '\.git\s*$' let uri = arg diff --git a/autoload/vundle/installer.vim b/autoload/vundle/installer.vim index 02c7903..7fdc5f3 100644 --- a/autoload/vundle/installer.vim +++ b/autoload/vundle/installer.vim @@ -4,7 +4,7 @@ func! vundle#installer#new(bang, ...) abort \ map(copy(a:000), 'vundle#config#bundle(v:val, {})') let names = vundle#scripts#bundle_names(map(copy(bundles), 'v:val.name_spec')) - call vundle#scripts#view('Installer',['" Installing bundles to '.expand(g:bundle_dir, 1)], names + ['Helptags']) + call vundle#scripts#view('Installer',['" Installing plugins to '.expand(g:bundle_dir, 1)], names + ['Helptags']) call s:process(a:bang, (a:bang ? 'add!' : 'add')) @@ -30,7 +30,7 @@ func! s:process(bang, cmd) endif if 'updated' == g:vundle_last_status && empty(msg) - let msg = 'Bundles updated; press u to view changelog' + let msg = 'Plugins updated; press u to view changelog' endif " goto next one @@ -81,7 +81,7 @@ func! vundle#installer#run(func_name, name, ...) abort return status endf -func! s:sign(status) +func! s:sign(status) if (!has('signs')) return endif @@ -100,7 +100,14 @@ endf func! vundle#installer#install(bang, name) abort if !isdirectory(g:bundle_dir) | call mkdir(g:bundle_dir, 'p') | endif - let b = vundle#config#init_bundle(a:name, {}) + let n = substitute(a:name,"['".'"]\+','','g') + let matched = filter(copy(g:bundles), 'v:val.name_spec == n') + + if len(matched) > 0 + let b = matched[0] + else + let b = vundle#config#init_bundle(a:name, {}) + endif return s:sync(a:bang, b) endf @@ -123,21 +130,21 @@ func! vundle#installer#helptags(bundles) abort let statuses = map(copy(help_dirs), 's:helptags(v:val)') let errors = filter(statuses, 'v:val == 0') - call s:log('Helptags: '.len(help_dirs).' bundles processed') + call s:log('Helptags: '.len(help_dirs).' plugins processed') return len(errors) endf func! vundle#installer#list(bang) abort let bundles = vundle#scripts#bundle_names(map(copy(g:bundles), 'v:val.name_spec')) - call vundle#scripts#view('list', ['" My Bundles'], bundles) + call vundle#scripts#view('list', ['" My Plugins'], bundles) redraw - echo len(g:bundles).' bundles configured' + echo len(g:bundles).' plugins configured' endf func! vundle#installer#clean(bang) abort - let bundle_dirs = map(copy(g:bundles), 'v:val.path()') + let bundle_dirs = map(copy(g:bundles), 'v:val.path()') let all_dirs = (v:version > 702 || (v:version == 702 && has("patch51"))) \ ? split(globpath(g:bundle_dir, '*', 1), "\n") \ : split(globpath(g:bundle_dir, '*'), "\n") @@ -147,7 +154,7 @@ func! vundle#installer#clean(bang) abort let headers = ['" All clean!'] let names = [] else - let headers = ['" Removing bundles:'] + let headers = ['" Removing Plugins:'] let names = vundle#scripts#bundle_names(map(copy(x_dirs), 'fnamemodify(v:val, ":t")')) end @@ -179,7 +186,7 @@ func! vundle#installer#delete(bang, dir_name) abort let out = s:system(cmd) call s:log('') - call s:log('Bundle '.a:dir_name) + call s:log('Plugin '.a:dir_name) call s:log('$ '.cmd) call s:log('> '.out) @@ -229,7 +236,7 @@ func! s:sync(bang, bundle) abort let out = s:system(cmd) call s:log('') - call s:log('Bundle '.a:bundle.name_spec) + call s:log('Plugin '.a:bundle.name_spec) call s:log('$ '.cmd) call s:log('> '.out) diff --git a/autoload/vundle/scripts.vim b/autoload/vundle/scripts.vim index 0cd4d13..6da47d1 100644 --- a/autoload/vundle/scripts.vim +++ b/autoload/vundle/scripts.vim @@ -1,6 +1,6 @@ func! vundle#scripts#all(bang, ...) let b:match = '' - let info = ['"Keymap: i - Install bundle; c - Cleanup; s - Search; R - Reload list'] + let info = ['"Keymap: i - Install plugin; c - Cleanup; s - Search; R - Reload list'] let matches = s:load_scripts(a:bang) if !empty(a:1) let matches = filter(matches, 'v:val =~? "'.escape(a:1,'"').'"') @@ -10,11 +10,11 @@ func! vundle#scripts#all(bang, ...) endif call vundle#scripts#view('search',info, vundle#scripts#bundle_names(reverse(matches))) redraw - echo len(matches).' bundles found' + echo len(matches).' plugins found' endf func! vundle#scripts#reload() abort - silent exec ':BundleSearch! '.(exists('b:match') ? b:match : '') + silent exec ':PluginSearch! '.(exists('b:match') ? b:match : '') redraw endf @@ -48,7 +48,7 @@ func! s:create_changelog() abort let updates = system(cmd) call add(g:vundle_changelog, '') - call add(g:vundle_changelog, 'Updated Bundle: '.bundle.name) + call add(g:vundle_changelog, 'Updated Plugin: '.bundle.name) if bundle.uri =~ "https://github.com" call add(g:vundle_changelog, 'Compare at: '.bundle.uri[0:-5].'/compare/'.initial_sha.'...'.updated_sha) @@ -75,7 +75,7 @@ func! s:view_changelog() endf func! vundle#scripts#bundle_names(names) - return map(copy(a:names), ' printf("Bundle ' ."'%s'".'", v:val) ') + return map(copy(a:names), ' printf("Plugin ' ."'%s'".'", v:val) ') endf func! vundle#scripts#view(title, headers, results) @@ -89,7 +89,7 @@ func! vundle#scripts#view(title, headers, results) let g:vundle_view = bufnr('%') " - " make buffer modifiable + " make buffer modifiable " to append without errors set modifiable @@ -99,24 +99,25 @@ func! vundle#scripts#view(title, headers, results) setl noswapfile setl cursorline - setl nonu ro noma ignorecase + setl nonu ro noma if (exists('&relativenumber')) | setl norelativenumber | endif setl ft=vundle setl syntax=vim + syn keyword vimCommand Plugin syn keyword vimCommand Bundle syn keyword vimCommand Helptags - com! -buffer -bang -nargs=1 DeleteBundle + com! -buffer -bang -nargs=1 DeletePlugin \ call vundle#installer#run('vundle#installer#delete', split(,',')[0], ['!' == '', ]) - com! -buffer -bang -nargs=? InstallAndRequireBundle + com! -buffer -bang -nargs=? InstallAndRequirePlugin \ call vundle#installer#run('vundle#installer#install_and_require', split(,',')[0], ['!' == '', ]) - com! -buffer -bang -nargs=? InstallBundle + com! -buffer -bang -nargs=? InstallPlugin \ call vundle#installer#run('vundle#installer#install', split(,',')[0], ['!' == '', ]) - com! -buffer -bang -nargs=0 InstallHelptags + com! -buffer -bang -nargs=0 InstallHelptags \ call vundle#installer#run('vundle#installer#docs', 'helptags', []) com! -buffer -nargs=0 VundleLog call s:view_log() @@ -127,10 +128,10 @@ func! vundle#scripts#view(title, headers, results) nnoremap D :exec 'Delete'.getline('.') nnoremap add :exec 'Install'.getline('.') - nnoremap add! :exec 'Install'.substitute(getline('.'), '^Bundle ', 'Bundle! ', '') + nnoremap add! :exec 'Install'.substitute(getline('.'), '^Plugin ', 'Plugin! ', '') nnoremap i :exec 'InstallAndRequire'.getline('.') - nnoremap I :exec 'InstallAndRequire'.substitute(getline('.'), '^Bundle ', 'Bundle! ', '') + nnoremap I :exec 'InstallAndRequire'.substitute(getline('.'), '^Plugin ', 'Plugin! ', '') nnoremap l :VundleLog nnoremap u :VundleChangelog @@ -140,7 +141,7 @@ func! vundle#scripts#view(title, headers, results) nnoremap c :BundleClean nnoremap C :BundleClean! - nnoremap s :BundleSearch + nnoremap s :BundleSearch nnoremap R :call vundle#scripts#reload() " goto first line after headers @@ -159,7 +160,7 @@ func! s:fetch_scripts(to) elseif executable("wget") let temp = vundle#installer#shellesc(tempname()) let cmd = 'wget -q -O '.temp.' '.l:vim_scripts_json. ' && mv -f '.temp.' '.vundle#installer#shellesc(a:to) - if (has('win32') || has('win64')) + if (has('win32') || has('win64')) let cmd = substitute(cmd, 'mv -f ', 'move /Y ', '') " change force flag let cmd = vundle#installer#shellesc(cmd) end diff --git a/doc/vundle.txt b/doc/vundle.txt index 4bc3a5f..5d397e0 100644 --- a/doc/vundle.txt +++ b/doc/vundle.txt @@ -4,17 +4,18 @@ 1. About Vundle |vundle-about| 2. Quick Start |vundle-quickstart| -3. Scripts |vundle-scripts| - 3.1. Configuring Scripts |vundle-scripts-configure| - 3.2. Supported URIs |vundle-uris| - 3.3. Installing Scripts |vundle-scripts-install| - 3.4. Updating Scripts |vundle-scripts-update| - 3.5. Searching Scripts |vundle-scripts-search| - 3.6. Listing Bundles |vundle-scripts-list| - 3.7. Cleaning Up |vundle-scripts-cleanup| +3. Plugins |vundle-plugins| + 3.1. Configuring Plugins |vundle-plugins-configure| + 3.2. Supported URIs |vundle-plugins-uris| + 3.3. Installing Plugins |vundle-plugins-install| + 3.4. Updating Plugins |vundle-plugins-update| + 3.5. Searching Plugins |vundle-plugins-search| + 3.6. Listing Plugins |vundle-plugins-list| + 3.7. Cleaning Up |vundle-plugins-cleanup| 4. Interactive Mode |vundle-interactive| 5. Key Mappings |vundle-keymappings| 6. Options |vundle-options| +7. Plugin Interface Change |vundle-interface-change| ============================================================================= 1. ABOUT VUNDLE ~ @@ -39,6 +40,9 @@ Vundle automatically... Vundle's search uses http://vim-scripts.org to provide a list of all available Vim scripts. +Vundle is undergoing an interface change, see |vundle-interface-change| for +more information. + ============================================================================= 2. QUICK START ~ *vundle-quickstart* @@ -76,24 +80,24 @@ available Vim scripts. "call vundle#rc(path) " let Vundle manage Vundle, required - Bundle 'gmarik/vundle' + Plugin 'gmarik/vundle' " The following are examples of different formats supported. " Keep bundle commands between here and filetype plugin indent on. - " scripts on GitHub repos - Bundle 'tpope/vim-fugitive' - Bundle 'Lokaltog/vim-easymotion' - Bundle 'tpope/vim-rails.git' + " plugins on GitHub repos + Plugin 'tpope/vim-fugitive' + Plugin 'Lokaltog/vim-easymotion' + Plugin 'tpope/vim-rails.git' " The sparkup vim script is in a subdirectory of this repo called vim. " Pass the path to set the runtimepath properly. - Bundle 'rstacruz/sparkup', {'rtp': 'vim/'} - " scripts from http://vim-scripts.org/vim/scripts.html - Bundle 'L9' - Bundle 'FuzzyFinder' - " scripts not on GitHub - Bundle 'git://git.wincent.com/command-t.git' + Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} + " plugins from http://vim-scripts.org/vim/scripts.html + Plugin 'L9' + Plugin 'FuzzyFinder' + " plugins not on GitHub + Plugin 'git://git.wincent.com/command-t.git' " git repos on your local machine (i.e. when working on your own plugin) - Bundle 'file:///home/gmarik/path/to/plugin' + Plugin 'file:///home/gmarik/path/to/plugin' " ... filetype plugin indent on " required @@ -105,42 +109,65 @@ available Vim scripts. Launch vim and run > - :BundleInstall + :PluginInstall < To install from command line: > - vim +BundleInstall +qall + vim +PluginInstall +qall ============================================================================= -3. SCRIPTS ~ - *vundle-scripts* +3. PLUGINS ~ + *vundle-plugins* -3.1 CONFIGURING SCRIPTS ~ - *vundle-scripts-configure* *:Bundle* +3.1 CONFIGURING PLUGINS ~ + *vundle-plugins-configure* *:Plugin* -Vundle tracks what scripts you want configured by the `Bundle` commands in your -`.vimrc`. Each `Bundle` command tells Vundle to activate the script on startup -adding it to your runtimepath. Commenting out or removing the line will -disable the `Bundle`. +Vundle tracks what plugins you want configured by the `Plugin` commands in your +`.vimrc`. Each `Plugin` command tells Vundle to activate the script on startup +adding it to your |runtimepath|. Commenting out or removing the line will +disable the `Plugin`. -Each `Bundle` command takes a URI pointing to the script. No comments should +Each `Plugin` command takes a URI pointing to the script. No comments should follow on the same line as the command. Example: > - Bundle 'git_URI' + Plugin 'git_URI' + +The `Bundle` command can optionally take a second argument after the URI. It +has to be a dictionary, separated from the URI by a comma. Each key-value pair +in the dictionary is a configuration option. + +The following per-script configuration options are available. -There can also be a second argument after URI. It has to be a dictionary with -a key called 'rtp'. The value for that key is a directory inside the -repository (relative path from the root of the repository) where the vim -plugin resides. For example: +The 'rtp' option +---------------- + +Specifies a directory inside the repository (relative path from the root of +the repository) where the vim plugin resides. It determines the path that will +be added to the |runtimepath|. + +For example: > - Bundle 'git_URI', {'rtp': 'some/subdir/'} + Plugin 'git_URI', {'rtp': 'some/subdir/'} This can be used with git repositories that put the vim plugin inside a subdirectory. +The 'name' option +----------------- + +The name of the directory that will hold the local clone of the configured +script. + +For example: +> + Plugin 'git_URI', {'name': 'newPluginName'} + +This can be used to prevent name collisions between plugins that Vundle would +otherwise try to clone into the same directory. It also provides an additional +level of customisation. 3.2 SUPPORTED URIS ~ - *vundle-uris* + *vundle-plugins-uris* `Vundle` integrates very well with both GitHub and vim-scripts.org (http://vim-scripts.org/vim/scripts.html) allowing short URIs. It also allows @@ -152,22 +179,22 @@ http://git-scm.com/book/ch4-1.html GitHub ------ -GitHub is used when a user/repo is passed to `Bundle`. +GitHub is used when a user/repo is passed to `Plugin`. > - Bundle 'gmarik/Vundle.vim' => https://github.com/gmarik/Vundle.vim + Plugin 'gmarik/Vundle.vim' => https://github.com/gmarik/Vundle.vim Vim Scripts ----------- Any single word without a '/' is assumed to be from Vim Scripts. > - Bundle 'ctrlp.vim' => https://github.com/vim-scripts/ctrlp.vim + Plugin 'ctrlp.vim' => https://github.com/vim-scripts/ctrlp.vim Other Git URIs -------------- No modification is performed on valid URIs that point outside the above URLs. > - Bundle 'git://git.wincent.com/command-t.git' + Plugin 'git://git.wincent.com/command-t.git' Local Plugins ------------- @@ -175,89 +202,89 @@ The git protocol supports local installation using the 'file://' protocol. This is handy when developing plugins locally. Follow the protocol with an absolute path to the script directory. > - Bundle 'file///path/from/root/to/plugin' + Plugin 'file///path/from/root/to/plugin' -3.3 INSTALLING SCRIPTS ~ - *vundle-scripts-install* *:BundleInstall* +3.3 INSTALLING PLUGINS ~ + *vundle-plugins-install* *:PluginInstall* > - :BundleInstall + :PluginInstall Will install all plugins configured in your `.vimrc`. Newly installed -scripts will be automatically enabled. Some scripts may require extra steps +plugins will be automatically enabled. Some plugins may require extra steps such as compilation or external programs, refer to their documentation. -BundleInstall allows installation of scripts by name: +PluginInstall allows installation of plugins by name: > - :BundleInstall unite.vim + :PluginInstall unite.vim Installs and activates unite.vim. You can use Tab to auto-complete known script names. Note that the installation just described isn't permanent. To -finish, you must put `Bundle 'unite.vim'` at the appropriate place in your +finish, you must put `Plugin 'unite.vim'` at the appropriate place in your `.vimrc` to tell Vundle to load the plugin at startup. -After installing scripts press 'l' (lowercase 'L') to see the log of commands +After installing plugins press 'l' (lowercase 'L') to see the log of commands if any errors occurred. -3.4 UPDATING SCRIPTS ~ - *vundle-scripts-update* *:BundleUpdate* *:BundleInstall!* +3.4 UPDATING PLUGINS ~ + *vundle-plugins-update* *:PluginUpdate* *:PluginInstall!* > - :BundleInstall! " NOTE: bang(!) + :PluginInstall! " NOTE: bang(!) or > - :BundleUpdate + :PluginUpdate -Installs or updates the configured scripts. Press 'u' after updates complete +Installs or updates the configured plugins. Press 'u' after updates complete to see the change log of all updated bundles. Press 'l' (lowercase 'L') to see the log of commands if any errors occurred. -3.5 SEARCHING SCRIPTS ~ - *vundle-scripts-search* *:BundleSearch* +3.5 SEARCHING PLUGINS ~ + *vundle-plugins-search* *:PluginSearch* > - :BundleSearch + :PluginSearch Search requires that `curl` be available on the system. The command searches Vim Scripts (http://vim-scripts.org/vim/scripts.html) for matching plugins. Results display in a new split window. For example: > - BundleSearch foo + PluginSearch foo displays: > "Search results for: foo - Bundle 'MarkdownFootnotes' - Bundle 'VimFootnotes' - Bundle 'foo.vim' + Plugin 'MarkdownFootnotes' + Plugin 'VimFootnotes' + Plugin 'foo.vim' < - *:BundleSearch!* + *:PluginSearch!* Alternatively, you can refresh the script list before searching by adding a bang to the command. > - :BundleSearch! foo + :PluginSearch! foo If the command is run without argument: > - :BundleSearch! + :PluginSearch! -it will display all known scripts in the new split. +it will display all known plugins in the new split. 3.6 LISTING BUNDLES ~ - *vundle-scripts-list* *:BundleList* + *vundle-plugins-list* *:PluginList* > - :BundleList + :PluginList Displays a list of installed bundles. 3.7 CLEANING UP ~ - *vundle-scripts-cleanup* *:BundleClean* + *vundle-plugins-cleanup* *:PluginClean* > - :BundleClean + :PluginClean -Requests confirmation for the removal of all scripts no longered configured +Requests confirmation for the removal of all plugins no longered configured in your `.vimrc` but present in your bundle installation directory (default: `.vim/bundle/`). - *:BundleClean!* + *:PluginClean!* > - :BundleClean! + :PluginClean! Automatically confirm removal of unused bundles. @@ -265,25 +292,25 @@ Automatically confirm removal of unused bundles. 4. INTERACTIVE MODE ~ *vundle-interactive* -Vundle provides a simple interactive mode to help you explore new scripts -easily. Interactive mode is available after any command that lists `Bundles` -such as BundleSearch, BundleList or Bundles. For instance: +Vundle provides a simple interactive mode to help you explore new plugins +easily. Interactive mode is available after any command that lists `Plugins` +such as PluginSearch, PluginList or Plugins. For instance: > - :BundleSearch! unite + :PluginSearch! unite -Searches for scripts matching 'unite' and yields a split window with: +Searches for plugins matching 'unite' and yields a split window with: > "Keymap: i - Install bundle; c - Cleanup; s - Search; R - Reload list "Search results for: unite - Bundle 'unite-scriptenames' - Bundle 'unite.vim' - Bundle 'unite-yarm' - Bundle 'unite-gem' - Bundle 'unite-locate' - Bundle 'unite-font' - Bundle 'unite-colorscheme' - -To install a bundle, move your cursor to the Bundle of interest and then + Plugin 'unite-scriptenames' + Plugin 'unite.vim' + Plugin 'unite-yarm' + Plugin 'unite-gem' + Plugin 'unite-locate' + Plugin 'unite-font' + Plugin 'unite-colorscheme' + +To install a bundle, move your cursor to the Plugin of interest and then select a command. To install 'unite.vim' put your cursor on the line and then push `i`. For a more complete list see |vundle-keymappings|. After unite.vim is installed the `:Unite file` command should be available. @@ -296,11 +323,11 @@ Note: Interactive installation doesn't update your `.vimrc`. KEY | DESCRIPTION ----|-------------------------- > - i | run :BundleInstall with name taken from line cursor is positioned on - I | same as i, but runs :BundleInstall! to update bundle + i | run :PluginInstall with name taken from line cursor is positioned on + I | same as i, but runs :PluginInstall! to update bundle D | delete selected bundle (be careful not to remove local modifications) - c | run :BundleClean - s | run :BundleSearch + c | run :PluginClean + s | run :PluginSearch R | fetch fresh script list from server ============================================================================= @@ -312,6 +339,33 @@ KEY | DESCRIPTION This option makes Vundle use `git` instead of `https` when building absolute URIs. For example: > - Bundle 'sjl/gundo.vim' -> git@github.com:sjl/gundo.git + Plugin 'sjl/gundo.vim' -> git@github.com:sjl/gundo.git + +============================================================================= +7. VUNDLE INTERFACE CHANGE ~ + *vundle-interface-change* *:Bundle* *:BundleInstall!* + *:BundleUpdate* *:BundleSearch* *:BundleList* *:BundleClean!* + *:VundleInstall!* *:VundleUpdate* *:VundleSearch* + *:VundleList* *:VundleClean!* + + In order to bring in new changes, Vundle is adopting a new interface. + Going forward we will support primarily the Plugin namespace, additionally + for convenience we will also alias some commands to the Vundle namespace. + The following table summarizes the interface changes. + + Deprecated Names | New Names + ----------------------------- + Bundle | Plugin + BundleInstall(!) | PluginInstall(!), VundleInstall(!) + BundleUpdate | PluginUpdate, VundleUpdate + BundleSearch(!) | PluginSearch(!), VundleSearch(!) + BundleClean | PluginClean(!), VundleClean(!) + BundleList | PluginList + Bundles | Plugins + + Note: The Bundle commands will be deprecated. You may continue using them, + but they may not get all future updates. For instance, we have enabled + comments on Plugin lines but not Bundle, since it requires a change in + command declaration. vim:tw=78:ts=8:ft=help:norl: diff --git a/test/vimrc b/test/vimrc index 546e6dc..13dd2e2 100644 --- a/test/vimrc +++ b/test/vimrc @@ -22,8 +22,8 @@ exec 'set rtp^='.bundle_dir.'vundle/' call vundle#rc(bundle_dir) -" vim-scripts name -Bundle 'molokai' + +Plugin 'molokai' " vim-scripts name " github username with dashes Bundle 'vim-scripts/ragtag.vim' @@ -50,6 +50,7 @@ Bundle '~/Dropbox/.gitrepos/utilz.vim.git' " with options Bundle 'rstacruz/sparkup.git', {'rtp': 'vim/'} +Bundle 'matchit.zip', {'name': 'matchit'} " Camel case Bundle 'vim-scripts/RubySinatra' From bb53f89504917ef916083dc1e2f70f2aad351836 Mon Sep 17 00:00:00 2001 From: Lucas Hoffmann Date: Wed, 26 Mar 2014 08:54:31 +0100 Subject: [PATCH 18/72] update deprecated API to call the new API directly Still keep :Bundle backwards compatible. --- autoload/vundle.vim | 58 +++++++++++-------------------------- autoload/vundle/scripts.vim | 6 ++-- 2 files changed, 20 insertions(+), 44 deletions(-) diff --git a/autoload/vundle.vim b/autoload/vundle.vim index adf1b87..76d4d59 100644 --- a/autoload/vundle.vim +++ b/autoload/vundle.vim @@ -12,13 +12,13 @@ com! -nargs=? -bang -complete=custom,vundle#scripts#complete PluginInstall \ call vundle#installer#new('!' == '', ) com! -nargs=? -bang -complete=custom,vundle#scripts#complete PluginSearch -\ call vundle#scripts#all('!'=='', ) +\ call vundle#scripts#all('!' == '', ) com! -nargs=? -bang -complete=custom,vundle#scripts#complete Plugins -\ call vundle#scripts#all('!'=='', ) +\ call vundle#scripts#all('!' == '', ) com! -nargs=0 -bang PluginList -\ call vundle#installer#list('!'=='') +\ call vundle#installer#list('!' == '') com! -nargs=? -bang PluginClean \ call vundle#installer#clean('!' == '') @@ -30,45 +30,21 @@ com! -nargs=0 PluginDocs com! PluginUpdate PluginInstall! " Vundle Aliases -com! -nargs=? -bang -complete=custom,vundle#scripts#complete VundleInstall -\ call vundle#installer#new('!' == '', ) - -com! -nargs=? -bang -complete=custom,vundle#scripts#complete VundleSearch -\ call vundle#scripts#all('!'=='', ) - -com! -nargs=? -bang VundleClean -\ call vundle#installer#clean('!' == '') - -com! -nargs=0 VundleDocs -\ call vundle#installer#helptags(g:bundles) - -" Aliases -com! VundleUpdate PluginInstall! +com! -nargs=? -bang -complete=custom,vundle#scripts#complete VundleInstall PluginList +com! -nargs=? -bang -complete=custom,vundle#scripts#complete VundleSearch PluginSearch +com! -nargs=? -bang VundleClean PluginClean +com! -nargs=0 VundleDocs PluginDocs +com! VundleUpdate PluginInstall! " deprecated -com! -nargs=+ Bundle -\ call vundle#config#bundle() - -com! -nargs=? -bang -complete=custom,vundle#scripts#complete BundleInstall -\ call vundle#installer#new('!' == '', ) - -com! -nargs=? -bang -complete=custom,vundle#scripts#complete BundleSearch -\ call vundle#scripts#all('!'=='', ) - -com! -nargs=? -bang -complete=custom,vundle#scripts#complete Bundles -\ call vundle#scripts#all('!'=='', ) - -com! -nargs=0 -bang BundleList -\ call vundle#installer#list('!'=='') - -com! -nargs=? -bang BundleClean -\ call vundle#installer#clean('!' == '') - -com! -nargs=0 BundleDocs -\ call vundle#installer#helptags(g:bundles) - -" Aliases -com! BundleUpdate BundleInstall! +com! -nargs=+ Bundle call vundle#config#bundle() +com! -nargs=? -bang -complete=custom,vundle#scripts#complete BundleInstall PluginInstall +com! -nargs=? -bang -complete=custom,vundle#scripts#complete BundleSearch PluginSearch +com! -nargs=? -bang -complete=custom,vundle#scripts#complete Bundles Plugins +com! -nargs=0 -bang BundleList PluginList +com! -nargs=? -bang BundleClean PluginClean +com! -nargs=0 BundleDocs PluginDocs +com! BundleUpdate PluginInstall! if (has('signs')) sign define Vu_error text=! texthl=Error @@ -85,6 +61,6 @@ func! vundle#rc(...) abort let g:bundle_dir = len(a:000) > 0 ? expand(a:1, 1) : expand('$HOME/.vim/bundle', 1) let g:updated_bundles = [] let g:vundle_log = [] - let g:vundle_changelog = ['Updated Bundles:'] + let g:vundle_changelog = ['Updated Plugins:'] call vundle#config#init() endf diff --git a/autoload/vundle/scripts.vim b/autoload/vundle/scripts.vim index 6da47d1..5c43547 100644 --- a/autoload/vundle/scripts.vim +++ b/autoload/vundle/scripts.vim @@ -138,10 +138,10 @@ func! vundle#scripts#view(title, headers, results) nnoremap h :h vundle nnoremap ? :norm h - nnoremap c :BundleClean - nnoremap C :BundleClean! + nnoremap c :PluginClean + nnoremap C :PluginClean! - nnoremap s :BundleSearch + nnoremap s :PluginSearch nnoremap R :call vundle#scripts#reload() " goto first line after headers From e2bf9118958cb80acf752373b654705d4845d3b0 Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Mon, 31 Mar 2014 18:09:00 -0400 Subject: [PATCH 19/72] Fix incorrectly aliased VundleInstall command --- autoload/vundle.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/vundle.vim b/autoload/vundle.vim index 76d4d59..16eebca 100644 --- a/autoload/vundle.vim +++ b/autoload/vundle.vim @@ -30,7 +30,7 @@ com! -nargs=0 PluginDocs com! PluginUpdate PluginInstall! " Vundle Aliases -com! -nargs=? -bang -complete=custom,vundle#scripts#complete VundleInstall PluginList +com! -nargs=? -bang -complete=custom,vundle#scripts#complete VundleInstall PluginInstall com! -nargs=? -bang -complete=custom,vundle#scripts#complete VundleSearch PluginSearch com! -nargs=? -bang VundleClean PluginClean com! -nargs=0 VundleDocs PluginDocs From ec16b7b797d2a0656411e52bccaa53c172149ae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Blinkiewicz?= Date: Fri, 4 Apr 2014 18:17:14 +0200 Subject: [PATCH 20/72] fix typo in line no. 205 of README.md change from `Plugin 'file///path/from/root/to/plugin'` to `Plugin 'file:///path/from/root/to/plugin'` --- doc/vundle.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/vundle.txt b/doc/vundle.txt index 5d397e0..a6c35e2 100644 --- a/doc/vundle.txt +++ b/doc/vundle.txt @@ -202,7 +202,7 @@ The git protocol supports local installation using the 'file://' protocol. This is handy when developing plugins locally. Follow the protocol with an absolute path to the script directory. > - Plugin 'file///path/from/root/to/plugin' + Plugin 'file:///path/from/root/to/plugin' 3.3 INSTALLING PLUGINS ~ *vundle-plugins-install* *:PluginInstall* From 6545681f560eb174c722cbf74b890d409c79293f Mon Sep 17 00:00:00 2001 From: Jacobo de Vera Date: Sun, 6 Apr 2014 00:08:03 +0200 Subject: [PATCH 21/72] Resolve full doc dir path when running helptags Prevents error 150 when user has doc/* in wildignore Fixes #112 --- autoload/vundle/installer.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/vundle/installer.vim b/autoload/vundle/installer.vim index 7fdc5f3..bc2f41d 100644 --- a/autoload/vundle/installer.vim +++ b/autoload/vundle/installer.vim @@ -207,7 +207,7 @@ endf func! s:helptags(rtp) abort " it is important to keep trailing slash here - let doc_path = resolve(a:rtp).'/doc/' + let doc_path = resolve(a:rtp . '/doc/') call s:log(':helptags '.doc_path) try execute 'helptags ' . doc_path From c20c90d86761c8e164ae51eb97b13b0f6d9c8adf Mon Sep 17 00:00:00 2001 From: Jacobo de Vera Date: Mon, 7 Apr 2014 00:59:23 +0200 Subject: [PATCH 22/72] Lazy loading plugins with begin/end block --- autoload/vundle.vim | 10 ++++++++++ autoload/vundle/config.vim | 14 +++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/autoload/vundle.vim b/autoload/vundle.vim index 16eebca..83d6c90 100644 --- a/autoload/vundle.vim +++ b/autoload/vundle.vim @@ -64,3 +64,13 @@ func! vundle#rc(...) abort let g:vundle_changelog = ['Updated Plugins:'] call vundle#config#init() endf + +func! vundle#begin(...) abort + let g:vundle_lazy_load = 1 + call call('vundle#rc', a:000) +endf + +func! vundle#end(...) abort + unlet g:vundle_lazy_load + call vundle#config#activate_bundles() +endf diff --git a/autoload/vundle/config.vim b/autoload/vundle/config.vim index 7bcf647..0e6b28c 100644 --- a/autoload/vundle/config.vim +++ b/autoload/vundle/config.vim @@ -1,11 +1,19 @@ func! vundle#config#bundle(arg, ...) let bundle = vundle#config#init_bundle(a:arg, a:000) - call s:rtp_rm_a() - call add(g:bundles, bundle) - call s:rtp_add_a() + if exists('g:vundle_lazy_load') && g:vundle_lazy_load + call add(g:bundles, bundle) + else + call s:rtp_rm_a() + call add(g:bundles, bundle) + call s:rtp_add_a() + endif return bundle endf +func! vundle#config#activate_bundles() + call s:rtp_add_a() +endf + func! vundle#config#init() if !exists('g:bundles') | let g:bundles = [] | endif call s:rtp_rm_a() From 1736243c0edea1209be4179b4206961a108a7d0c Mon Sep 17 00:00:00 2001 From: Jacobo de Vera Date: Mon, 7 Apr 2014 01:39:10 +0200 Subject: [PATCH 23/72] Handle default rtp values --- autoload/vundle/config.vim | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/autoload/vundle/config.vim b/autoload/vundle/config.vim index 0e6b28c..a496752 100644 --- a/autoload/vundle/config.vim +++ b/autoload/vundle/config.vim @@ -1,17 +1,19 @@ func! vundle#config#bundle(arg, ...) let bundle = vundle#config#init_bundle(a:arg, a:000) if exists('g:vundle_lazy_load') && g:vundle_lazy_load - call add(g:bundles, bundle) + call add(g:bundles, bundle) else - call s:rtp_rm_a() - call add(g:bundles, bundle) - call s:rtp_add_a() + call s:rtp_rm_a() + call add(g:bundles, bundle) + call s:rtp_add_a() + call s:rtp_add_defaults() endif return bundle endf func! vundle#config#activate_bundles() call s:rtp_add_a() + call s:rtp_add_defaults() endf func! vundle#config#init() @@ -29,6 +31,7 @@ func! vundle#config#require(bundles) abort exec 'runtime! '.b.name.'/after/*.vim' call s:rtp_rm(g:bundle_dir) endfor + call s:rtp_add_defaults() endf func! vundle#config#init_bundle(name, opts) @@ -75,6 +78,22 @@ func! s:parse_name(arg) return {'name': name, 'uri': uri, 'name_spec': arg } endf +func! s:rtp_add_defaults() + let current = &rtp + set rtp&vim + let default = &rtp + let &rtp = current + for item in reverse(split(default, ',')) + exec 'set rtp-=' . item + if fnamemodify(item, ":t") == 'after' + exec 'set rtp+=' . item + else + exec 'set rtp^=' . item + endif + endfor +endf + + func! s:rtp_rm_a() let paths = map(copy(g:bundles), 'v:val.rtpath') let prepends = join(paths, ',') From 0152571eb570c5ac9e347dfb0c1aeb25ce28c950 Mon Sep 17 00:00:00 2001 From: Jacobo de Vera Date: Mon, 7 Apr 2014 02:35:45 +0200 Subject: [PATCH 24/72] Add multiple lines separately to the log --- autoload/vundle/installer.vim | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/autoload/vundle/installer.vim b/autoload/vundle/installer.vim index bc2f41d..c96e078 100644 --- a/autoload/vundle/installer.vim +++ b/autoload/vundle/installer.vim @@ -187,8 +187,8 @@ func! vundle#installer#delete(bang, dir_name) abort call s:log('') call s:log('Plugin '.a:dir_name) - call s:log('$ '.cmd) - call s:log('> '.out) + call s:log(cmd, '$ ') + call s:log(out, '> ') if 0 != v:shell_error return 'error' @@ -237,8 +237,8 @@ func! s:sync(bang, bundle) abort let out = s:system(cmd) call s:log('') call s:log('Plugin '.a:bundle.name_spec) - call s:log('$ '.cmd) - call s:log('> '.out) + call s:log(cmd, '$ ') + call s:log(out, '> ') if 0 != v:shell_error return 'error' @@ -278,8 +278,13 @@ func! s:system(cmd) abort return system(a:cmd) endf -func! s:log(str) abort - let fmt = '%y%m%d %H:%M:%S' - call add(g:vundle_log, '['.strftime(fmt).'] '.a:str) +func! s:log(str, ...) abort + let prefix = a:0 > 0 ? a:1 : '' + let fmt = '%Y-%m-%d %H:%M:%S' + let lines = split(a:str, '\n', 1) + let time = strftime(fmt) + for line in lines + call add(g:vundle_log, '['. time .'] '. prefix . line) + endfor return a:str endf From f3da68779ad06db096313fd9ddcbb8325157acb6 Mon Sep 17 00:00:00 2001 From: Jacobo de Vera Date: Thu, 10 Nov 2011 23:50:31 +0000 Subject: [PATCH 25/72] Support plugin pinning New supported option called 'pinned' for the Plugin command. When set to 1, the plugin is added to rtp but no install/upgrade operation is performed. It not only allows vundle to do rtp management of plugins on VCS other than git, it also allows leaving plugins that had previously been managed by vundle in the current state, with no further updates. Fixes #24, #397 --- autoload/vundle.vim | 1 + autoload/vundle/config.vim | 4 ++++ autoload/vundle/installer.vim | 7 +++++++ doc/vundle.txt | 22 +++++++++++++++++++++- test/vimrc | 7 +++++++ 5 files changed, 40 insertions(+), 1 deletion(-) diff --git a/autoload/vundle.vim b/autoload/vundle.vim index 83d6c90..e41693d 100644 --- a/autoload/vundle.vim +++ b/autoload/vundle.vim @@ -54,6 +54,7 @@ sign define Vu_new text=+ texthl=Comment sign define Vu_updated text=* texthl=Comment sign define Vu_deleted text=- texthl=Comment sign define Vu_helptags text=* texthl=Comment +sign define Vu_pinned text== texthl=Comment endif diff --git a/autoload/vundle/config.vim b/autoload/vundle/config.vim index a496752..785d43c 100644 --- a/autoload/vundle/config.vim +++ b/autoload/vundle/config.vim @@ -134,3 +134,7 @@ func! s:bundle.path() return s:expand_path(g:bundle_dir.'/'.self.name) endf +func! s:bundle.is_pinned() + return get(self, 'pinned') +endf + diff --git a/autoload/vundle/installer.vim b/autoload/vundle/installer.vim index c96e078..245dd74 100644 --- a/autoload/vundle/installer.vim +++ b/autoload/vundle/installer.vim @@ -67,6 +67,8 @@ func! vundle#installer#run(func_name, name, ...) abort echo n.' deleted' elseif 'helptags' == status echo n.' regenerated' + elseif 'pinned' == status + echo n.' pinned' elseif 'error' == status echohl Error echo 'Error processing '.n @@ -219,6 +221,11 @@ func! s:helptags(rtp) abort endf func! s:sync(bang, bundle) abort + " Do not sync if this bundle is pinned + if a:bundle.is_pinned() + return 'pinned' + endif + let git_dir = expand(a:bundle.path().'/.git/', 1) if isdirectory(git_dir) || filereadable(expand(a:bundle.path().'/.git', 1)) if !(a:bang) | return 'todate' | endif diff --git a/doc/vundle.txt b/doc/vundle.txt index a6c35e2..3cffe91 100644 --- a/doc/vundle.txt +++ b/doc/vundle.txt @@ -166,6 +166,26 @@ This can be used to prevent name collisions between plugins that Vundle would otherwise try to clone into the same directory. It also provides an additional level of customisation. +The 'pinned' option +------------------- + +A flag that, when set to a value of 1, tells Vundle not to perform any git +operations on the plugin, while still adding the existing plugin under the +`bundles` directories to the |runtimepath|. + +For example: +> + Plugin 'mylocalplugin', {'pinned': 1} + +This allows the users to include, with Vundle, plugins tracked with version +control systems other than git, but the user is responsible for cloning and +keeping up to date. It also allows the users to stay in the current version of +a plugin that might have previously been updated by Vundle. + +Please note that the URI will be treated the same as for any other plugins, so +only the last part of it will be added to the |runtimepath|. The user is +advised to use this flag only with single word URIs to avoid confusion. + 3.2 SUPPORTED URIS ~ *vundle-plugins-uris* @@ -185,7 +205,7 @@ GitHub is used when a user/repo is passed to `Plugin`. Vim Scripts ----------- -Any single word without a '/' is assumed to be from Vim Scripts. +Any single word without a slash '/' is assumed to be from Vim Scripts. > Plugin 'ctrlp.vim' => https://github.com/vim-scripts/ctrlp.vim diff --git a/test/vimrc b/test/vimrc index 13dd2e2..b4f2676 100644 --- a/test/vimrc +++ b/test/vimrc @@ -58,6 +58,13 @@ Bundle 'vim-scripts/RubySinatra' " syntax issue #203 Bundle 'jimenezrick/vimerl' +" Static bundle: Same name as a valid vim-scripts bundle +Bundle 'latte', {'pinned' : 1} +if !isdirectory(expand(bundle_dir) . '/latte') + call mkdir(expand(bundle_dir) . '/latte', 'p') +endif + + filetype plugin indent on " Automatically detect file types. set wildignore+=doc " should not break helptags From b3b5f529b306b5084ad566eb2a62d3992aac5f07 Mon Sep 17 00:00:00 2001 From: Lucas Hoffmann Date: Sat, 29 Mar 2014 18:56:21 +0100 Subject: [PATCH 26/72] Add comments to document the code Also add some FIXME markers in places where the code needs more explanation. --- autoload/vundle.vim | 25 ++++---- autoload/vundle/config.vim | 66 +++++++++++++++++++++ autoload/vundle/installer.vim | 104 +++++++++++++++++++++++++++++++++- autoload/vundle/scripts.vim | 40 +++++++++++++ 4 files changed, 222 insertions(+), 13 deletions(-) diff --git a/autoload/vundle.vim b/autoload/vundle.vim index e41693d..adf93ad 100644 --- a/autoload/vundle.vim +++ b/autoload/vundle.vim @@ -36,7 +36,7 @@ com! -nargs=? -bang VundleClean Plugi com! -nargs=0 VundleDocs PluginDocs com! VundleUpdate PluginInstall! -" deprecated +" Deprecated Commands com! -nargs=+ Bundle call vundle#config#bundle() com! -nargs=? -bang -complete=custom,vundle#scripts#complete BundleInstall PluginInstall com! -nargs=? -bang -complete=custom,vundle#scripts#complete BundleSearch PluginSearch @@ -46,18 +46,23 @@ com! -nargs=? -bang BundleClean Plugi com! -nargs=0 BundleDocs PluginDocs com! BundleUpdate PluginInstall! +" Set up the signs used in the installer window. (See :help signs) if (has('signs')) -sign define Vu_error text=! texthl=Error -sign define Vu_active text=> texthl=Comment -sign define Vu_todate text=. texthl=Comment -sign define Vu_new text=+ texthl=Comment -sign define Vu_updated text=* texthl=Comment -sign define Vu_deleted text=- texthl=Comment -sign define Vu_helptags text=* texthl=Comment -sign define Vu_pinned text== texthl=Comment + sign define Vu_error text=! texthl=Error + sign define Vu_active text=> texthl=Comment + sign define Vu_todate text=. texthl=Comment + sign define Vu_new text=+ texthl=Comment + sign define Vu_updated text=* texthl=Comment + sign define Vu_deleted text=- texthl=Comment + sign define Vu_helptags text=* texthl=Comment + sign define Vu_pinned text== texthl=Comment endif - +" Set up Vundle. This function has to be called from the users vimrc file. +" This will force Vim to source this file as a side effect which wil define +" the :Plugin command. After calling this function the user can use the +" :Plugin command in the vimrc. It is not possible to do this automatically +" because when loading the vimrc file no plugins where loaded yet. func! vundle#rc(...) abort let g:bundle_dir = len(a:000) > 0 ? expand(a:1, 1) : expand('$HOME/.vim/bundle', 1) let g:updated_bundles = [] diff --git a/autoload/vundle/config.vim b/autoload/vundle/config.vim index 785d43c..4292095 100644 --- a/autoload/vundle/config.vim +++ b/autoload/vundle/config.vim @@ -1,3 +1,8 @@ +" Add a plugin to the runtimepath. +" +" arg -- a string specifying the plugin +" ... -- a dictionary of options for the plugin +" return -- the return value from vundle#config#init_bundle() func! vundle#config#bundle(arg, ...) let bundle = vundle#config#init_bundle(a:arg, a:000) if exists('g:vundle_lazy_load') && g:vundle_lazy_load @@ -16,12 +21,19 @@ func! vundle#config#activate_bundles() call s:rtp_add_defaults() endf +" Initialize Vundle. +" +" return -- 0 (unconditionally) func! vundle#config#init() if !exists('g:bundles') | let g:bundles = [] | endif call s:rtp_rm_a() let g:bundles = [] endf +" Add a list of bundles to the runtimepath and source them. +" +" bundles -- a list of bundle objects +" return -- 0 (unconditionally) func! vundle#config#require(bundles) abort for b in a:bundles call s:rtp_add(b.rtpath) @@ -34,6 +46,11 @@ func! vundle#config#require(bundles) abort call s:rtp_add_defaults() endf +" Create a bundle object from a bundle specification. +" +" name -- the bundle specification as a string +" opts -- the options dictionary from then bundle definition +" return -- an initialized bundle object func! vundle#config#init_bundle(name, opts) if a:name != substitute(a:name, '^\s*\(.\{-}\)\s*$', '\1', '') echo "Spurious leading and/or trailing whitespace found in plugin spec '" . a:name . "'" @@ -44,6 +61,12 @@ func! vundle#config#init_bundle(name, opts) return b endf +" Parse the options which can be supplied with the bundle specification. +" Corresponding documentation: vundle-plugins-configure +" +" opts -- a dictionary with the user supplied options for the bundle +" return -- a dictionary with the user supplied options for the bundle, this +" will be merged with a s:bundle object into one dictionary. func! s:parse_options(opts) " TODO: improve this if len(a:opts) != 1 | return {} | endif @@ -55,6 +78,13 @@ func! s:parse_options(opts) endif endf +" Parse the plugin specification. Corresponding documentation: +" vundle-plugins-uris +" +" arg -- the string supplied to identify the plugin +" return -- a dictionary with the folder name (key 'name') and the uri (key +" 'uri') for cloning the plugin and the original argument (key +" 'name_spec') func! s:parse_name(arg) let arg = a:arg let git_proto = exists('g:vundle_default_git_proto') ? g:vundle_default_git_proto : 'https' @@ -94,6 +124,10 @@ func! s:rtp_add_defaults() endf +" Remove all paths for the plugins which are managed by Vundle from the +" runtimepath. +" +" return -- 0 (unconditionally) func! s:rtp_rm_a() let paths = map(copy(g:bundles), 'v:val.rtpath') let prepends = join(paths, ',') @@ -102,6 +136,10 @@ func! s:rtp_rm_a() exec 'set rtp-='.fnameescape(appends) endf +" Add all paths for the plugins which are managed by Vundle to the +" runtimepath. +" +" return -- 0 (unconditionally) func! s:rtp_add_a() let paths = map(copy(g:bundles), 'v:val.rtpath') let prepends = join(paths, ',') @@ -110,26 +148,54 @@ func! s:rtp_add_a() exec 'set rtp+='.fnameescape(appends) endf +" Remove a directory and the corresponding 'after' directory from runtimepath. +" +" dir -- the directory name to be removed as a string. The corresponding +" 'after' directory will also be removed. +" return -- 0 (unconditionally) func! s:rtp_rm(dir) abort exec 'set rtp-='.fnameescape(expand(a:dir, 1)) exec 'set rtp-='.fnameescape(expand(a:dir.'/after', 1)) endf +" Add a directory and the corresponding 'after' directory to runtimepath. +" +" dir -- the directory name to be added as a string. The corresponding +" 'after' directory will also be added. +" return -- 0 (unconditionally) func! s:rtp_add(dir) abort exec 'set rtp^='.fnameescape(expand(a:dir, 1)) exec 'set rtp+='.fnameescape(expand(a:dir.'/after', 1)) endf +" Expand and simplify a path. +" +" path -- the path to expand as a string +" return -- the expanded and simplified path func! s:expand_path(path) abort return simplify(expand(a:path, 1)) endf +" Find the actual path inside a bundle directory to be added to the +" runtimepath. It might be provided by the user with the 'rtp' option. +" Corresponding documentation: vundle-plugins-configure +" +" opts -- a bundle dict +" return -- expanded path to the corresponding plugin directory func! s:rtpath(opts) return has_key(a:opts, 'rtp') ? s:expand_path(a:opts.path().'/'.a:opts.rtp) : a:opts.path() endf +" a bundle 'object' let s:bundle = {} +" FIXME: This function is only called once and in most cases the return value +" is stored in the bundle object as obj.rtpath unmodfied. Is this necessary? +" +" Return the absolute path to the directory inside the bundle directory +" (prefix) where thr bundle will be cloned. +" +" return -- the target location to clone this bundle to func! s:bundle.path() return s:expand_path(g:bundle_dir.'/'.self.name) endf diff --git a/autoload/vundle/installer.vim b/autoload/vundle/installer.vim index 245dd74..ea1bde0 100644 --- a/autoload/vundle/installer.vim +++ b/autoload/vundle/installer.vim @@ -1,3 +1,9 @@ +" Try to clone all new bundles given (or all bundles in g:bundles by default) +" to g:bundle_dir. If a:bang is 1 it will also update all plugins (git pull). +" +" bang -- 1 or 0 +" ... -- any number of bundle specifications (seperate arguments) +" return -- 0 (unconditionally) func! vundle#installer#new(bang, ...) abort let bundles = (a:1 == '') ? \ g:bundles : @@ -6,12 +12,22 @@ func! vundle#installer#new(bang, ...) abort let names = vundle#scripts#bundle_names(map(copy(bundles), 'v:val.name_spec')) call vundle#scripts#view('Installer',['" Installing plugins to '.expand(g:bundle_dir, 1)], names + ['Helptags']) + " FIXME this tries to call 'add' as a normal mode command. This is a buffer + " local mapping defined in vundle#scripts#view(). The mapping will call a + " buffer local command InstallPlugin which in turn will call + " vundle#installer#run() with vundle#installer#install(). This is very + " confusing and unclear. call s:process(a:bang, (a:bang ? 'add!' : 'add')) call vundle#config#require(bundles) endf - +" Iterate over all lines in a Vundle window and execute the given command for +" every line. Used by the installation and cleaning functions. +" +" bang -- not used (FIXME) +" cmd -- the (normal mode) command to execute for every line as a string +" return -- 0 (unconditionally) func! s:process(bang, cmd) let msg = '' @@ -43,6 +59,13 @@ func! s:process(bang, cmd) echo 'Done! '.msg endf +" Call another function in the different Vundle windows. +" +" func_name -- the function to call +" name -- the bundle name to call func_name for (string) +" ... -- the argument to be used when calling func_name (only the first +" optional argument will be used) +" return -- the status returned by the call to func_name func! vundle#installer#run(func_name, name, ...) abort let n = a:name @@ -83,6 +106,11 @@ func! vundle#installer#run(func_name, name, ...) abort return status endf +" Put a sign on the current line, indicating the status of the installation +" step. +" +" status -- string describing the status +" return -- 0 (unconditionally) func! s:sign(status) if (!has('signs')) return @@ -91,6 +119,11 @@ func! s:sign(status) exe ":sign place ".line('.')." line=".line('.')." name=Vu_". a:status ." buffer=" . bufnr("%") endf +" Install a plugin, then add it to the runtimepath and source it. +" +" bang -- 1 or 0, passed directly to vundle#installer#install() +" name -- the name of a bundle (string) +" return -- the return value from vundle#installer#install() func! vundle#installer#install_and_require(bang, name) abort let result = vundle#installer#install(a:bang, a:name) let b = vundle#config#bundle(a:name, {}) @@ -99,6 +132,11 @@ func! vundle#installer#install_and_require(bang, name) abort return result endf +" Install or update a bundle given by its name. +" +" bang -- 1 or 0, passed directly to s:sync() +" name -- the name of a bundle (string) +" return -- the return value from s:sync() func! vundle#installer#install(bang, name) abort if !isdirectory(g:bundle_dir) | call mkdir(g:bundle_dir, 'p') | endif @@ -114,6 +152,9 @@ func! vundle#installer#install(bang, name) abort return s:sync(a:bang, b) endf +" Call :helptags for all bundles in g:bundles. +" +" return -- 'error' if an error occurred, else return 'helptags' func! vundle#installer#docs() abort let error_count = vundle#installer#helptags(g:bundles) if error_count > 0 @@ -122,6 +163,11 @@ func! vundle#installer#docs() abort return 'helptags' endf +" Call :helptags for a list of bundles. +" +" bundles -- a list of bundle dictionaries for which :helptags should be +" called. +" return -- the number of directories where :helptags failed func! vundle#installer#helptags(bundles) abort let bundle_dirs = map(copy(a:bundles),'v:val.rtpath') let help_dirs = filter(bundle_dirs, 's:has_doc(v:val)') @@ -137,6 +183,11 @@ func! vundle#installer#helptags(bundles) abort return len(errors) endf +" List all installed plugins. +" Corresponding documentation: vundle-plugins-list +" +" bang -- not used +" return -- 0 (unconditionally) func! vundle#installer#list(bang) abort let bundles = vundle#scripts#bundle_names(map(copy(g:bundles), 'v:val.name_spec')) call vundle#scripts#view('list', ['" My Plugins'], bundles) @@ -144,7 +195,12 @@ func! vundle#installer#list(bang) abort echo len(g:bundles).' plugins configured' endf - +" List and remove all directories in the bundle directory which are not +" activated (added to the bundle list). +" +" bang -- 0 if the user should be asked to confirm every deletion, 1 if they +" should be removed unconditionally +" return -- 0 (unconditionally) func! vundle#installer#clean(bang) abort let bundle_dirs = map(copy(g:bundles), 'v:val.path()') let all_dirs = (v:version > 702 || (v:version == 702 && has("patch51"))) @@ -175,7 +231,12 @@ func! vundle#installer#clean(bang) abort endif endf - +" Delete to directory for a plugin. +" +" bang -- not used +" dir_name -- the bundle directory to be deleted (as a string) +" return -- 'error' if an error occurred, 'deleted' if the plugin folder was +" successfully deleted func! vundle#installer#delete(bang, dir_name) abort let cmd = ((has('win32') || has('win64')) && empty(matchstr(&shell, 'sh'))) ? @@ -199,6 +260,10 @@ func! vundle#installer#delete(bang, dir_name) abort endif endf +" Check if a bundled plugin has any documentation. +" +" rtp -- a path (string) where the plugin is installed +" return -- 1 if some documentation was found, 0 otherwise func! s:has_doc(rtp) abort return isdirectory(a:rtp.'/doc') \ && (!filereadable(a:rtp.'/doc/tags') || filewritable(a:rtp.'/doc/tags')) @@ -207,6 +272,10 @@ func! s:has_doc(rtp) abort \ : !(empty(glob(a:rtp.'/doc/*.txt')) && empty(glob(a:rtp.'/doc/*.??x'))) endf +" Update the helptags for a plugin. +" +" rtp -- the path to the plugin's root directory (string) +" return -- 1 if :helptags succeeded, 0 otherwise func! s:helptags(rtp) abort " it is important to keep trailing slash here let doc_path = resolve(a:rtp . '/doc/') @@ -220,6 +289,15 @@ func! s:helptags(rtp) abort return 1 endf +" Install or update a given bundle object with git. +" +" bang -- 0 if only new plugins should be installed, 1 if existing plugins +" should be updated +" bundle -- a bundle object (dict) +" return -- 'todate' if nothing was updated or the repository was up to date, +" 'new' when the plugin was newly installed, 'updated' if some +" changes where pulled via git, 'error' if an error occurred in the +" shell command func! s:sync(bang, bundle) abort " Do not sync if this bundle is pinned if a:bundle.is_pinned() @@ -265,6 +343,11 @@ func! s:sync(bang, bundle) abort return 'updated' endf +" Escape special characters in a string to be able to use it as a shell +" command with system(). +" +" cmd -- the string holding the shell command +" return -- a string with the relevant characters escaped func! vundle#installer#shellesc(cmd) abort if ((has('win32') || has('win64')) && empty(matchstr(&shell, 'sh'))) return '"' . substitute(a:cmd, '"', '\\"', 'g') . '"' @@ -272,6 +355,10 @@ func! vundle#installer#shellesc(cmd) abort return shellescape(a:cmd) endf +" Fix a cd shell command to be used on Windows. +" +" cmd -- the command to be fixed (string) +" return -- the fixed command (string) func! g:shellesc_cd(cmd) abort if ((has('win32') || has('win64')) && empty(matchstr(&shell, 'sh'))) let cmd = substitute(a:cmd, '^cd ','cd /d ','') " add /d switch to change drives @@ -281,10 +368,21 @@ func! g:shellesc_cd(cmd) abort endif endf +" Make a system call. This can be used to change the way system calls +" are made during developing, without searching the whole code base for +" actual system() calls. +" +" cmd -- the command passed to system() (string) +" return -- the return value from system() func! s:system(cmd) abort return system(a:cmd) endf +" Add a log message to Vundle's internal logging variable. +" +" str -- the log message (string) +" prefix -- optional prefix for multiline entries (string) +" return -- a:str func! s:log(str, ...) abort let prefix = a:0 > 0 ? a:1 : '' let fmt = '%Y-%m-%d %H:%M:%S' diff --git a/autoload/vundle/scripts.vim b/autoload/vundle/scripts.vim index 5c43547..6381391 100644 --- a/autoload/vundle/scripts.vim +++ b/autoload/vundle/scripts.vim @@ -1,3 +1,10 @@ +" Searches the database from vim-script.org for a matching plugin. If no +" argument is given all plugins are listed. This function is used by the +" :Plugins and :PluginSearch commands. +" +" bang -- if 1 refresh the script name cache, if 0 don't +" ... -- a plugin name to search for (FIXME what about multible arguments, it +" doesn't seem to work.) func! vundle#scripts#all(bang, ...) let b:match = '' let info = ['"Keymap: i - Install plugin; c - Cleanup; s - Search; R - Reload list'] @@ -13,15 +20,22 @@ func! vundle#scripts#all(bang, ...) echo len(matches).' plugins found' endf +" Repeat the search for bundles. func! vundle#scripts#reload() abort silent exec ':PluginSearch! '.(exists('b:match') ? b:match : '') redraw endf +" Complete names for bundles in the command line. +" +" a, c, d -- see :h command-completion-custom +" return -- all valid plugin names from vim-scripts.org as completion +" candidates, see also :h command-completion-custom func! vundle#scripts#complete(a,c,d) return join(s:load_scripts(0),"\n") endf +" View the logfile after an update or installation. func! s:view_log() if !exists('g:vundle_log_file') let g:vundle_log_file = tempname() @@ -33,6 +47,10 @@ func! s:view_log() wincmd P | wincmd H endf +" Parse the output from git log after an update to create a change log for the +" tuser. +" +" return -- 0 (unconditionally) func! s:create_changelog() abort for bundle_data in g:updated_bundles let initial_sha = bundle_data[0] @@ -61,6 +79,7 @@ func! s:create_changelog() abort endfor endf +" View the change log after an update or installation. func! s:view_changelog() call s:create_changelog() @@ -74,10 +93,21 @@ func! s:view_changelog() wincmd P | wincmd H endf +" Create a list of 'Plugin ...' lines from a list of bundle names. +" +" names -- a list of names (strings) of plugins +" return -- a list of 'Plugin ...' lines suitable to be written to a buffer func! vundle#scripts#bundle_names(names) return map(copy(a:names), ' printf("Plugin ' ."'%s'".'", v:val) ') endf +" Open a buffer to display information to the user. Several special commands +" are defined in the new buffer. +" +" title -- a title for the new buffer +" headers -- a list of header lines to be displayed at the top of the buffer +" results -- the main information to be displayed in the buffer (list of +" strings) func! vundle#scripts#view(title, headers, results) if exists('g:vundle_view') && bufloaded(g:vundle_view) exec g:vundle_view.'bd!' @@ -148,6 +178,10 @@ func! vundle#scripts#view(title, headers, results) exec ':'.(len(a:headers) + 1) endf +" Load the plugin database from vim-scripts.org . +" +" to -- the filename (string) to save the database to +" return -- 0 on success, 1 if an error occurred func! s:fetch_scripts(to) let scripts_dir = fnamemodify(expand(a:to, 1), ":h") if !isdirectory(scripts_dir) @@ -178,6 +212,12 @@ func! s:fetch_scripts(to) return 0 endf +" Load the plugin database and return a list of all plugins. +" +" bang -- if 1 download the redatabase, else only download if it is not +" readable on disk (i.e. does not exist) +" return -- a list of strings, these are the names (valid bundle +" specifications) of all plugins from vim-scripts.org func! s:load_scripts(bang) let f = expand(g:bundle_dir.'/.vundle/script-names.vim-scripts.org.json', 1) if a:bang || !filereadable(f) From 87e5a195207150eb2fc2374645e1bdd9d12412d2 Mon Sep 17 00:00:00 2001 From: Jacobo de Vera Date: Thu, 10 Apr 2014 23:50:05 +0200 Subject: [PATCH 27/72] Complete function documentation - Complete the code documentation effort started by @lucc - Remove some judgemental comments :sparkles: - Remove comments pertaining to things that should be opened as issues - Boxed :exclamation: --- autoload/vundle/config.vim | 71 +++++++++++++++++++++++++++++------ autoload/vundle/installer.vim | 67 ++++++++++++++++++++++++++++----- autoload/vundle/scripts.vim | 42 +++++++++++++++++---- 3 files changed, 151 insertions(+), 29 deletions(-) diff --git a/autoload/vundle/config.vim b/autoload/vundle/config.vim index 4292095..309fb4e 100644 --- a/autoload/vundle/config.vim +++ b/autoload/vundle/config.vim @@ -1,8 +1,10 @@ +" --------------------------------------------------------------------------- " Add a plugin to the runtimepath. " " arg -- a string specifying the plugin " ... -- a dictionary of options for the plugin " return -- the return value from vundle#config#init_bundle() +" --------------------------------------------------------------------------- func! vundle#config#bundle(arg, ...) let bundle = vundle#config#init_bundle(a:arg, a:000) if exists('g:vundle_lazy_load') && g:vundle_lazy_load @@ -16,24 +18,36 @@ func! vundle#config#bundle(arg, ...) return bundle endf + +" --------------------------------------------------------------------------- +" When lazy bundle load is used (begin/end functions), add all configured +" bundles to runtimepath and reorder appropriately. +" --------------------------------------------------------------------------- func! vundle#config#activate_bundles() call s:rtp_add_a() call s:rtp_add_defaults() endf + +" --------------------------------------------------------------------------- " Initialize Vundle. " -" return -- 0 (unconditionally) +" Start a new bundles list and make sure the runtimepath does not contain +" directories from a previous call. In theory, this should only be called +" once. +" --------------------------------------------------------------------------- func! vundle#config#init() if !exists('g:bundles') | let g:bundles = [] | endif call s:rtp_rm_a() let g:bundles = [] endf + +" --------------------------------------------------------------------------- " Add a list of bundles to the runtimepath and source them. " " bundles -- a list of bundle objects -" return -- 0 (unconditionally) +" --------------------------------------------------------------------------- func! vundle#config#require(bundles) abort for b in a:bundles call s:rtp_add(b.rtpath) @@ -46,11 +60,14 @@ func! vundle#config#require(bundles) abort call s:rtp_add_defaults() endf + +" --------------------------------------------------------------------------- " Create a bundle object from a bundle specification. " " name -- the bundle specification as a string " opts -- the options dictionary from then bundle definition " return -- an initialized bundle object +" --------------------------------------------------------------------------- func! vundle#config#init_bundle(name, opts) if a:name != substitute(a:name, '^\s*\(.\{-}\)\s*$', '\1', '') echo "Spurious leading and/or trailing whitespace found in plugin spec '" . a:name . "'" @@ -61,12 +78,15 @@ func! vundle#config#init_bundle(name, opts) return b endf + +" --------------------------------------------------------------------------- " Parse the options which can be supplied with the bundle specification. " Corresponding documentation: vundle-plugins-configure " " opts -- a dictionary with the user supplied options for the bundle " return -- a dictionary with the user supplied options for the bundle, this " will be merged with a s:bundle object into one dictionary. +" --------------------------------------------------------------------------- func! s:parse_options(opts) " TODO: improve this if len(a:opts) != 1 | return {} | endif @@ -78,6 +98,8 @@ func! s:parse_options(opts) endif endf + +" --------------------------------------------------------------------------- " Parse the plugin specification. Corresponding documentation: " vundle-plugins-uris " @@ -85,6 +107,7 @@ endf " return -- a dictionary with the folder name (key 'name') and the uri (key " 'uri') for cloning the plugin and the original argument (key " 'name_spec') +" --------------------------------------------------------------------------- func! s:parse_name(arg) let arg = a:arg let git_proto = exists('g:vundle_default_git_proto') ? g:vundle_default_git_proto : 'https' @@ -108,6 +131,12 @@ func! s:parse_name(arg) return {'name': name, 'uri': uri, 'name_spec': arg } endf + +" --------------------------------------------------------------------------- +" Modify the runtimepath, after all bundles have been added, so that the +" directories that were in the default runtimepath appear first in the list +" (with their 'after' directories last). +" --------------------------------------------------------------------------- func! s:rtp_add_defaults() let current = &rtp set rtp&vim @@ -124,10 +153,10 @@ func! s:rtp_add_defaults() endf +" --------------------------------------------------------------------------- " Remove all paths for the plugins which are managed by Vundle from the " runtimepath. -" -" return -- 0 (unconditionally) +" --------------------------------------------------------------------------- func! s:rtp_rm_a() let paths = map(copy(g:bundles), 'v:val.rtpath') let prepends = join(paths, ',') @@ -136,10 +165,11 @@ func! s:rtp_rm_a() exec 'set rtp-='.fnameescape(appends) endf + +" --------------------------------------------------------------------------- " Add all paths for the plugins which are managed by Vundle to the " runtimepath. -" -" return -- 0 (unconditionally) +" --------------------------------------------------------------------------- func! s:rtp_add_a() let paths = map(copy(g:bundles), 'v:val.rtpath') let prepends = join(paths, ',') @@ -148,58 +178,77 @@ func! s:rtp_add_a() exec 'set rtp+='.fnameescape(appends) endf + +" --------------------------------------------------------------------------- " Remove a directory and the corresponding 'after' directory from runtimepath. " " dir -- the directory name to be removed as a string. The corresponding " 'after' directory will also be removed. -" return -- 0 (unconditionally) +" --------------------------------------------------------------------------- func! s:rtp_rm(dir) abort exec 'set rtp-='.fnameescape(expand(a:dir, 1)) exec 'set rtp-='.fnameescape(expand(a:dir.'/after', 1)) endf + +" --------------------------------------------------------------------------- " Add a directory and the corresponding 'after' directory to runtimepath. " " dir -- the directory name to be added as a string. The corresponding " 'after' directory will also be added. -" return -- 0 (unconditionally) +" --------------------------------------------------------------------------- func! s:rtp_add(dir) abort exec 'set rtp^='.fnameescape(expand(a:dir, 1)) exec 'set rtp+='.fnameescape(expand(a:dir.'/after', 1)) endf + +" --------------------------------------------------------------------------- " Expand and simplify a path. " " path -- the path to expand as a string " return -- the expanded and simplified path +" --------------------------------------------------------------------------- func! s:expand_path(path) abort return simplify(expand(a:path, 1)) endf + +" --------------------------------------------------------------------------- " Find the actual path inside a bundle directory to be added to the " runtimepath. It might be provided by the user with the 'rtp' option. " Corresponding documentation: vundle-plugins-configure " " opts -- a bundle dict " return -- expanded path to the corresponding plugin directory +" --------------------------------------------------------------------------- func! s:rtpath(opts) return has_key(a:opts, 'rtp') ? s:expand_path(a:opts.path().'/'.a:opts.rtp) : a:opts.path() endf + +" --------------------------------------------------------------------------- " a bundle 'object' +" --------------------------------------------------------------------------- let s:bundle = {} -" FIXME: This function is only called once and in most cases the return value -" is stored in the bundle object as obj.rtpath unmodfied. Is this necessary? -" + +" --------------------------------------------------------------------------- " Return the absolute path to the directory inside the bundle directory " (prefix) where thr bundle will be cloned. " " return -- the target location to clone this bundle to +" --------------------------------------------------------------------------- func! s:bundle.path() return s:expand_path(g:bundle_dir.'/'.self.name) endf + +" --------------------------------------------------------------------------- +" Determine if the bundle has the pinned attribute set in the config +" +" return -- 1 if the bundle is pinned, 0 otherwise +" --------------------------------------------------------------------------- func! s:bundle.is_pinned() return get(self, 'pinned') endf diff --git a/autoload/vundle/installer.vim b/autoload/vundle/installer.vim index ea1bde0..a9afd11 100644 --- a/autoload/vundle/installer.vim +++ b/autoload/vundle/installer.vim @@ -1,9 +1,10 @@ +" --------------------------------------------------------------------------- " Try to clone all new bundles given (or all bundles in g:bundles by default) " to g:bundle_dir. If a:bang is 1 it will also update all plugins (git pull). " " bang -- 1 or 0 " ... -- any number of bundle specifications (seperate arguments) -" return -- 0 (unconditionally) +" --------------------------------------------------------------------------- func! vundle#installer#new(bang, ...) abort let bundles = (a:1 == '') ? \ g:bundles : @@ -12,22 +13,23 @@ func! vundle#installer#new(bang, ...) abort let names = vundle#scripts#bundle_names(map(copy(bundles), 'v:val.name_spec')) call vundle#scripts#view('Installer',['" Installing plugins to '.expand(g:bundle_dir, 1)], names + ['Helptags']) - " FIXME this tries to call 'add' as a normal mode command. This is a buffer - " local mapping defined in vundle#scripts#view(). The mapping will call a - " buffer local command InstallPlugin which in turn will call - " vundle#installer#run() with vundle#installer#install(). This is very - " confusing and unclear. + " This calls 'add' as a normal mode command. This is a buffer local mapping + " defined in vundle#scripts#view(). The mapping will call a buffer local + " command InstallPlugin which in turn will call vundle#installer#run() with + " vundle#installer#install(). call s:process(a:bang, (a:bang ? 'add!' : 'add')) call vundle#config#require(bundles) endf + +" --------------------------------------------------------------------------- " Iterate over all lines in a Vundle window and execute the given command for " every line. Used by the installation and cleaning functions. " " bang -- not used (FIXME) " cmd -- the (normal mode) command to execute for every line as a string -" return -- 0 (unconditionally) +" --------------------------------------------------------------------------- func! s:process(bang, cmd) let msg = '' @@ -59,6 +61,8 @@ func! s:process(bang, cmd) echo 'Done! '.msg endf + +" --------------------------------------------------------------------------- " Call another function in the different Vundle windows. " " func_name -- the function to call @@ -66,6 +70,7 @@ endf " ... -- the argument to be used when calling func_name (only the first " optional argument will be used) " return -- the status returned by the call to func_name +" --------------------------------------------------------------------------- func! vundle#installer#run(func_name, name, ...) abort let n = a:name @@ -106,11 +111,13 @@ func! vundle#installer#run(func_name, name, ...) abort return status endf + +" --------------------------------------------------------------------------- " Put a sign on the current line, indicating the status of the installation " step. " " status -- string describing the status -" return -- 0 (unconditionally) +" --------------------------------------------------------------------------- func! s:sign(status) if (!has('signs')) return @@ -119,11 +126,14 @@ func! s:sign(status) exe ":sign place ".line('.')." line=".line('.')." name=Vu_". a:status ." buffer=" . bufnr("%") endf + +" --------------------------------------------------------------------------- " Install a plugin, then add it to the runtimepath and source it. " " bang -- 1 or 0, passed directly to vundle#installer#install() " name -- the name of a bundle (string) " return -- the return value from vundle#installer#install() +" --------------------------------------------------------------------------- func! vundle#installer#install_and_require(bang, name) abort let result = vundle#installer#install(a:bang, a:name) let b = vundle#config#bundle(a:name, {}) @@ -132,11 +142,14 @@ func! vundle#installer#install_and_require(bang, name) abort return result endf + +" --------------------------------------------------------------------------- " Install or update a bundle given by its name. " " bang -- 1 or 0, passed directly to s:sync() " name -- the name of a bundle (string) " return -- the return value from s:sync() +" --------------------------------------------------------------------------- func! vundle#installer#install(bang, name) abort if !isdirectory(g:bundle_dir) | call mkdir(g:bundle_dir, 'p') | endif @@ -152,9 +165,12 @@ func! vundle#installer#install(bang, name) abort return s:sync(a:bang, b) endf + +" --------------------------------------------------------------------------- " Call :helptags for all bundles in g:bundles. " " return -- 'error' if an error occurred, else return 'helptags' +" --------------------------------------------------------------------------- func! vundle#installer#docs() abort let error_count = vundle#installer#helptags(g:bundles) if error_count > 0 @@ -163,11 +179,14 @@ func! vundle#installer#docs() abort return 'helptags' endf + +" --------------------------------------------------------------------------- " Call :helptags for a list of bundles. " " bundles -- a list of bundle dictionaries for which :helptags should be " called. " return -- the number of directories where :helptags failed +" --------------------------------------------------------------------------- func! vundle#installer#helptags(bundles) abort let bundle_dirs = map(copy(a:bundles),'v:val.rtpath') let help_dirs = filter(bundle_dirs, 's:has_doc(v:val)') @@ -183,11 +202,13 @@ func! vundle#installer#helptags(bundles) abort return len(errors) endf + +" --------------------------------------------------------------------------- " List all installed plugins. " Corresponding documentation: vundle-plugins-list " " bang -- not used -" return -- 0 (unconditionally) +" --------------------------------------------------------------------------- func! vundle#installer#list(bang) abort let bundles = vundle#scripts#bundle_names(map(copy(g:bundles), 'v:val.name_spec')) call vundle#scripts#view('list', ['" My Plugins'], bundles) @@ -195,12 +216,14 @@ func! vundle#installer#list(bang) abort echo len(g:bundles).' plugins configured' endf + +" --------------------------------------------------------------------------- " List and remove all directories in the bundle directory which are not " activated (added to the bundle list). " " bang -- 0 if the user should be asked to confirm every deletion, 1 if they " should be removed unconditionally -" return -- 0 (unconditionally) +" --------------------------------------------------------------------------- func! vundle#installer#clean(bang) abort let bundle_dirs = map(copy(g:bundles), 'v:val.path()') let all_dirs = (v:version > 702 || (v:version == 702 && has("patch51"))) @@ -231,12 +254,15 @@ func! vundle#installer#clean(bang) abort endif endf + +" --------------------------------------------------------------------------- " Delete to directory for a plugin. " " bang -- not used " dir_name -- the bundle directory to be deleted (as a string) " return -- 'error' if an error occurred, 'deleted' if the plugin folder was " successfully deleted +" --------------------------------------------------------------------------- func! vundle#installer#delete(bang, dir_name) abort let cmd = ((has('win32') || has('win64')) && empty(matchstr(&shell, 'sh'))) ? @@ -260,10 +286,13 @@ func! vundle#installer#delete(bang, dir_name) abort endif endf + +" --------------------------------------------------------------------------- " Check if a bundled plugin has any documentation. " " rtp -- a path (string) where the plugin is installed " return -- 1 if some documentation was found, 0 otherwise +" --------------------------------------------------------------------------- func! s:has_doc(rtp) abort return isdirectory(a:rtp.'/doc') \ && (!filereadable(a:rtp.'/doc/tags') || filewritable(a:rtp.'/doc/tags')) @@ -272,10 +301,13 @@ func! s:has_doc(rtp) abort \ : !(empty(glob(a:rtp.'/doc/*.txt')) && empty(glob(a:rtp.'/doc/*.??x'))) endf + +" --------------------------------------------------------------------------- " Update the helptags for a plugin. " " rtp -- the path to the plugin's root directory (string) " return -- 1 if :helptags succeeded, 0 otherwise +" --------------------------------------------------------------------------- func! s:helptags(rtp) abort " it is important to keep trailing slash here let doc_path = resolve(a:rtp . '/doc/') @@ -289,6 +321,8 @@ func! s:helptags(rtp) abort return 1 endf + +" --------------------------------------------------------------------------- " Install or update a given bundle object with git. " " bang -- 0 if only new plugins should be installed, 1 if existing plugins @@ -298,6 +332,7 @@ endf " 'new' when the plugin was newly installed, 'updated' if some " changes where pulled via git, 'error' if an error occurred in the " shell command +" --------------------------------------------------------------------------- func! s:sync(bang, bundle) abort " Do not sync if this bundle is pinned if a:bundle.is_pinned() @@ -343,11 +378,14 @@ func! s:sync(bang, bundle) abort return 'updated' endf + +" --------------------------------------------------------------------------- " Escape special characters in a string to be able to use it as a shell " command with system(). " " cmd -- the string holding the shell command " return -- a string with the relevant characters escaped +" --------------------------------------------------------------------------- func! vundle#installer#shellesc(cmd) abort if ((has('win32') || has('win64')) && empty(matchstr(&shell, 'sh'))) return '"' . substitute(a:cmd, '"', '\\"', 'g') . '"' @@ -355,10 +393,13 @@ func! vundle#installer#shellesc(cmd) abort return shellescape(a:cmd) endf + +" --------------------------------------------------------------------------- " Fix a cd shell command to be used on Windows. " " cmd -- the command to be fixed (string) " return -- the fixed command (string) +" --------------------------------------------------------------------------- func! g:shellesc_cd(cmd) abort if ((has('win32') || has('win64')) && empty(matchstr(&shell, 'sh'))) let cmd = substitute(a:cmd, '^cd ','cd /d ','') " add /d switch to change drives @@ -368,21 +409,27 @@ func! g:shellesc_cd(cmd) abort endif endf + +" --------------------------------------------------------------------------- " Make a system call. This can be used to change the way system calls " are made during developing, without searching the whole code base for " actual system() calls. " " cmd -- the command passed to system() (string) " return -- the return value from system() +" --------------------------------------------------------------------------- func! s:system(cmd) abort return system(a:cmd) endf + +" --------------------------------------------------------------------------- " Add a log message to Vundle's internal logging variable. " " str -- the log message (string) " prefix -- optional prefix for multiline entries (string) " return -- a:str +" --------------------------------------------------------------------------- func! s:log(str, ...) abort let prefix = a:0 > 0 ? a:1 : '' let fmt = '%Y-%m-%d %H:%M:%S' diff --git a/autoload/vundle/scripts.vim b/autoload/vundle/scripts.vim index 6381391..40f91b9 100644 --- a/autoload/vundle/scripts.vim +++ b/autoload/vundle/scripts.vim @@ -1,10 +1,11 @@ -" Searches the database from vim-script.org for a matching plugin. If no -" argument is given all plugins are listed. This function is used by the -" :Plugins and :PluginSearch commands. +" --------------------------------------------------------------------------- +" Search the database from vim-script.org for a matching plugin. If no +" argument is given, list all plugins. This function is used by the :Plugins +" and :PluginSearch commands. " " bang -- if 1 refresh the script name cache, if 0 don't -" ... -- a plugin name to search for (FIXME what about multible arguments, it -" doesn't seem to work.) +" ... -- a plugin name to search for +" --------------------------------------------------------------------------- func! vundle#scripts#all(bang, ...) let b:match = '' let info = ['"Keymap: i - Install plugin; c - Cleanup; s - Search; R - Reload list'] @@ -20,22 +21,31 @@ func! vundle#scripts#all(bang, ...) echo len(matches).' plugins found' endf + +" --------------------------------------------------------------------------- " Repeat the search for bundles. +" --------------------------------------------------------------------------- func! vundle#scripts#reload() abort silent exec ':PluginSearch! '.(exists('b:match') ? b:match : '') redraw endf + +" --------------------------------------------------------------------------- " Complete names for bundles in the command line. " " a, c, d -- see :h command-completion-custom " return -- all valid plugin names from vim-scripts.org as completion " candidates, see also :h command-completion-custom +" --------------------------------------------------------------------------- func! vundle#scripts#complete(a,c,d) return join(s:load_scripts(0),"\n") endf + +" --------------------------------------------------------------------------- " View the logfile after an update or installation. +" --------------------------------------------------------------------------- func! s:view_log() if !exists('g:vundle_log_file') let g:vundle_log_file = tempname() @@ -47,10 +57,11 @@ func! s:view_log() wincmd P | wincmd H endf + +" --------------------------------------------------------------------------- " Parse the output from git log after an update to create a change log for the -" tuser. -" -" return -- 0 (unconditionally) +" user. +" --------------------------------------------------------------------------- func! s:create_changelog() abort for bundle_data in g:updated_bundles let initial_sha = bundle_data[0] @@ -79,7 +90,10 @@ func! s:create_changelog() abort endfor endf + +" --------------------------------------------------------------------------- " View the change log after an update or installation. +" --------------------------------------------------------------------------- func! s:view_changelog() call s:create_changelog() @@ -93,14 +107,19 @@ func! s:view_changelog() wincmd P | wincmd H endf + +" --------------------------------------------------------------------------- " Create a list of 'Plugin ...' lines from a list of bundle names. " " names -- a list of names (strings) of plugins " return -- a list of 'Plugin ...' lines suitable to be written to a buffer +" --------------------------------------------------------------------------- func! vundle#scripts#bundle_names(names) return map(copy(a:names), ' printf("Plugin ' ."'%s'".'", v:val) ') endf + +" --------------------------------------------------------------------------- " Open a buffer to display information to the user. Several special commands " are defined in the new buffer. " @@ -108,6 +127,7 @@ endf " headers -- a list of header lines to be displayed at the top of the buffer " results -- the main information to be displayed in the buffer (list of " strings) +" --------------------------------------------------------------------------- func! vundle#scripts#view(title, headers, results) if exists('g:vundle_view') && bufloaded(g:vundle_view) exec g:vundle_view.'bd!' @@ -178,10 +198,13 @@ func! vundle#scripts#view(title, headers, results) exec ':'.(len(a:headers) + 1) endf + +" --------------------------------------------------------------------------- " Load the plugin database from vim-scripts.org . " " to -- the filename (string) to save the database to " return -- 0 on success, 1 if an error occurred +" --------------------------------------------------------------------------- func! s:fetch_scripts(to) let scripts_dir = fnamemodify(expand(a:to, 1), ":h") if !isdirectory(scripts_dir) @@ -212,12 +235,15 @@ func! s:fetch_scripts(to) return 0 endf + +" --------------------------------------------------------------------------- " Load the plugin database and return a list of all plugins. " " bang -- if 1 download the redatabase, else only download if it is not " readable on disk (i.e. does not exist) " return -- a list of strings, these are the names (valid bundle " specifications) of all plugins from vim-scripts.org +" --------------------------------------------------------------------------- func! s:load_scripts(bang) let f = expand(g:bundle_dir.'/.vundle/script-names.vim-scripts.org.json', 1) if a:bang || !filereadable(f) From 50fe09cbd28afdb61879cb667730116f23a376f8 Mon Sep 17 00:00:00 2001 From: Jacobo de Vera Date: Fri, 11 Apr 2014 00:13:32 +0200 Subject: [PATCH 28/72] Remove Plugins command It's a duplicate of the PluginSearch command. Fixes #428 --- autoload/vundle.vim | 4 ---- 1 file changed, 4 deletions(-) diff --git a/autoload/vundle.vim b/autoload/vundle.vim index adf93ad..781abc3 100644 --- a/autoload/vundle.vim +++ b/autoload/vundle.vim @@ -14,9 +14,6 @@ com! -nargs=? -bang -complete=custom,vundle#scripts#complete PluginInstall com! -nargs=? -bang -complete=custom,vundle#scripts#complete PluginSearch \ call vundle#scripts#all('!' == '', ) -com! -nargs=? -bang -complete=custom,vundle#scripts#complete Plugins -\ call vundle#scripts#all('!' == '', ) - com! -nargs=0 -bang PluginList \ call vundle#installer#list('!' == '') @@ -40,7 +37,6 @@ com! VundleUpdate Plugi com! -nargs=+ Bundle call vundle#config#bundle() com! -nargs=? -bang -complete=custom,vundle#scripts#complete BundleInstall PluginInstall com! -nargs=? -bang -complete=custom,vundle#scripts#complete BundleSearch PluginSearch -com! -nargs=? -bang -complete=custom,vundle#scripts#complete Bundles Plugins com! -nargs=0 -bang BundleList PluginList com! -nargs=? -bang BundleClean PluginClean com! -nargs=0 BundleDocs PluginDocs From e7660d50f3c71b0805a376585bd55995e4f3f95b Mon Sep 17 00:00:00 2001 From: "Jeremy Pallats/starcraft.man" Date: Mon, 14 Apr 2014 10:44:55 -0400 Subject: [PATCH 29/72] Documentation Update. * Add modelines to all code/doc files excluding README.md. The modeline used is: `" vim: set expandtab sts=2 ts=2 sw=2 tw=78 norl:` * Rename links with /vundle to /Vundle.vim, seems to confuse some people with redirect. * Remove duplicates from Quickstart, add example of `name` flag. * Add link to Tips page by @Lucc . * Change help maintain vundle link directly to the new one. * README.md line number links updated. Note: Users with bundle/vundle need to rename vundle to Vundle.vim to use test files. Vundle will continue to function otherwise. Fixes #413. Fixes #438. --- CONTRIBUTING.md | 6 +-- README.md | 70 +++++++++++++++++------------------ autoload/vundle.vim | 9 ++++- autoload/vundle/config.vim | 1 + autoload/vundle/installer.vim | 2 + autoload/vundle/scripts.vim | 2 + doc/vundle.txt | 50 ++++++++++++++----------- test/minirc.vim | 4 +- test/vimrc | 7 ++-- 9 files changed, 84 insertions(+), 67 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3188124..2162ffc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,7 +14,7 @@ Issues Before submitting an issue, be sure to check the following places for answers. -1. Vundle docs at [`:h vundle`](https://github.com/gmarik/vundle/blob/master/doc/vundle.txt). +1. Vundle docs at [`:h vundle`](https://github.com/gmarik/Vundle.vim/blob/master/doc/vundle.txt). 2. The [FAQ](https://github.com/gmarik/Vundle.vim/search). @@ -53,9 +53,9 @@ Vimrc: set nocompatible syntax on filetype off -set rtp+=~/.vim/bundle/vundle/ +set rtp+=~/.vim/bundle/Vundle.vim/ call vundle#rc() -Bundle 'gmarik/vundle' +Bundle 'gmarik/Vundle.vim' Bundle 'relevant/plugin' filetype plugin indent on diff --git a/README.md b/README.md index 95c5ec0..a2417af 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -## [Help Maintain Vundle](https://github.com/gmarik/Vundle.vim/issues/241) +## [Help Maintain Vundle](https://github.com/gmarik/Vundle.vim/issues/383) ## About @@ -30,10 +30,11 @@ Curl is required for search. If you are using Windows, go directly to [Windows setup]. If you run into any issues, please consult the [FAQ]. + See [Tips] for some advanced configurations. 2. Set up [Vundle]: - `$ git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle` + `$ git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim` 3. Configure Plugins: @@ -44,34 +45,33 @@ filetype off " required " set the runtime path to include Vundle and initialize - set rtp+=~/.vim/bundle/vundle/ - call vundle#rc() + set rtp+=~/.vim/bundle/Vundle.vim + call vundle#begin() " alternatively, pass a path where Vundle should install plugins - "let path = '~/some/path/here' - "call vundle#rc(path) + "call vundle#begin('~/some/path/here') " let Vundle manage Vundle, required - Plugin 'gmarik/vundle' + Plugin 'gmarik/Vundle.vim' " The following are examples of different formats supported. - " Keep Plugin commands between here and filetype plugin indent on. - " scripts on GitHub repos + " Keep Plugin commands between vundle#begin/end. + " plugin on GitHub repo Plugin 'tpope/vim-fugitive' - Plugin 'Lokaltog/vim-easymotion' - Plugin 'tpope/vim-rails.git' - " The sparkup vim script is in a subdirectory of this repo called vim. - " Pass the path to set the runtimepath properly. - Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} - " scripts from http://vim-scripts.org/vim/scripts.html + " plugin from http://vim-scripts.org/vim/scripts.html Plugin 'L9' - Plugin 'FuzzyFinder' - " scripts not on GitHub + " plugin not on GitHub Plugin 'git://git.wincent.com/command-t.git' " git repos on your local machine (i.e. when working on your own plugin) Plugin 'file:///home/gmarik/path/to/plugin' - " ... + " The sparkup vim script is in a subdirectory of this repo called vim. + " Pass the path to set the runtimepath properly. + Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} + " Avoid a name conflict with L9 + Plugin 'user/L9', {'name': 'newL9'} - filetype plugin indent on " required + " All of your Plugins must be added before the following line + call vundle#end() " required + filetype plugin indent on " required " To ignore plugin indent changes, instead use: "filetype plugin on " @@ -82,27 +82,26 @@ " :PluginClean(!) - confirm (or auto-approve) removal of unused plugins " " see :h vundle for more details or wiki for FAQ - " NOTE: comments after Plugin commands are not allowed. - " Put your stuff after this line + " Put your non-Plugin stuff after this line ``` 4. Install Plugins: - Launch `vim` and run `:PluginInstall` + Launch `vim` and run `:PluginInstall` To install from command line: `vim +PluginInstall +qall` ## Docs -See the [`:h vundle`](https://github.com/gmarik/vundle/blob/master/doc/vundle.txt) Vimdoc for more details. +See the [`:h vundle`](https://github.com/gmarik/Vundle.vim/blob/master/doc/vundle.txt) Vimdoc for more details. ## People Using Vundle -see [Examples](https://github.com/gmarik/vundle/wiki/Examples) +see [Examples](https://github.com/gmarik/Vundle.vim/wiki/Examples) ## Contributors -see [Vundle contributors](https://github.com/gmarik/vundle/graphs/contributors) +see [Vundle contributors](https://github.com/gmarik/Vundle.vim/graphs/contributors) *Thank you!* @@ -132,9 +131,10 @@ see [Vundle contributors](https://github.com/gmarik/vundle/graphs/contributors) * search by description as well * make it rock! -[Vundle]:http://github.com/gmarik/vundle -[Windows setup]:https://github.com/gmarik/vundle/wiki/Vundle-for-Windows -[FAQ]:https://github.com/gmarik/vundle/wiki +[Vundle]:http://github.com/gmarik/Vundle.vim +[Windows setup]:https://github.com/gmarik/Vundle.vim/wiki/Vundle-for-Windows +[FAQ]:https://github.com/gmarik/Vundle.vim/wiki +[Tips]:https://github.com/gmarik/Vundle.vim/wiki/Tips-and-Tricks [Vim]:http://www.vim.org [Git]:http://git-scm.com [`git clone`]:http://gitref.org/creating/#clone @@ -143,10 +143,10 @@ see [Vundle contributors](https://github.com/gmarik/vundle/graphs/contributors) [help tags]:http://vimdoc.sourceforge.net/htmldoc/helphelp.html#:helptags [runtime path]:http://vimdoc.sourceforge.net/htmldoc/options.html#%27runtimepath%27 -[configure]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L122-L205 -[install]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L207-L226 -[update]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L228-L237 -[search]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L239-L267 -[clean]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L276-L289 -[interactive mode]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L292-L331 -[interface change]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L345-L369 +[configure]:https://github.com/gmarik/Vundle.vim/blob/master/doc/vundle.txt#L125-L232 +[install]:https://github.com/gmarik/Vundle.vim/blob/master/doc/vundle.txt#L233-L253 +[update]:https://github.com/gmarik/Vundle.vim/blob/master/doc/vundle.txt#L254-L264 +[search]:https://github.com/gmarik/Vundle.vim/blob/master/doc/vundle.txt#L265-L294 +[clean]:https://github.com/gmarik/Vundle.vim/blob/master/doc/vundle.txt#L302-L317 +[interactive mode]:https://github.com/gmarik/Vundle.vim/blob/master/doc/vundle.txt#L318-L359 +[interface change]:https://github.com/gmarik/Vundle.vim/blob/master/doc/vundle.txt#L371-L395 diff --git a/autoload/vundle.vim b/autoload/vundle.vim index 781abc3..2657121 100644 --- a/autoload/vundle.vim +++ b/autoload/vundle.vim @@ -1,7 +1,7 @@ " Vundle is a shortcut for Vim Bundle and Is a simple plugin manager for Vim " Author: gmarik -" HomePage: http://github.com/gmarik/vundle -" Readme: http://github.com/gmarik/vundle/blob/master/README.md +" HomePage: http://github.com/gmarik/Vundle.vim +" Readme: http://github.com/gmarik/Vundle.vim/blob/master/README.md " Version: 0.9 " Plugin Commands @@ -67,12 +67,17 @@ func! vundle#rc(...) abort call vundle#config#init() endf +" Alternative to vundle#rc, offers speed up by modifying rtp only when end() +" called later. func! vundle#begin(...) abort let g:vundle_lazy_load = 1 call call('vundle#rc', a:000) endf +" Finishes putting plugins on the rtp. func! vundle#end(...) abort unlet g:vundle_lazy_load call vundle#config#activate_bundles() endf + +" vim: set expandtab sts=2 ts=2 sw=2 tw=78 norl: diff --git a/autoload/vundle/config.vim b/autoload/vundle/config.vim index 309fb4e..1f942e1 100644 --- a/autoload/vundle/config.vim +++ b/autoload/vundle/config.vim @@ -253,3 +253,4 @@ func! s:bundle.is_pinned() return get(self, 'pinned') endf +" vim: set expandtab sts=2 ts=2 sw=2 tw=78 norl: diff --git a/autoload/vundle/installer.vim b/autoload/vundle/installer.vim index a9afd11..4e3d36c 100644 --- a/autoload/vundle/installer.vim +++ b/autoload/vundle/installer.vim @@ -440,3 +440,5 @@ func! s:log(str, ...) abort endfor return a:str endf + +" vim: set expandtab sts=2 ts=2 sw=2 tw=78 norl: diff --git a/autoload/vundle/scripts.vim b/autoload/vundle/scripts.vim index 40f91b9..2129903 100644 --- a/autoload/vundle/scripts.vim +++ b/autoload/vundle/scripts.vim @@ -253,3 +253,5 @@ func! s:load_scripts(bang) endif return eval(readfile(f, 'b')[0]) endf + +" vim: set expandtab sts=2 ts=2 sw=2 tw=78 norl: diff --git a/doc/vundle.txt b/doc/vundle.txt index 3cffe91..8f310cd 100644 --- a/doc/vundle.txt +++ b/doc/vundle.txt @@ -62,7 +62,7 @@ more information. 2. Setup Vundle: > - git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle + git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim < 3. Configure bundles: @@ -73,37 +73,44 @@ more information. filetype off " required " set the runtime path to include Vundle and initialize - set rtp+=~/.vim/bundle/vundle/ - call vundle#rc() - " alternatively, pass a path where Vundle should install bundles - "let path = '~/some/path/here' - "call vundle#rc(path) + set rtp+=~/.vim/bundle/Vundle.vim + call vundle#begin() + " alternatively, pass a path where Vundle should install plugins + "call vundle#begin('~/some/path/here') " let Vundle manage Vundle, required - Plugin 'gmarik/vundle' + Plugin 'gmarik/Vundle.vim' " The following are examples of different formats supported. - " Keep bundle commands between here and filetype plugin indent on. - " plugins on GitHub repos + " Keep Plugin commands between vundle#begin/end. + " plugin on GitHub repo Plugin 'tpope/vim-fugitive' - Plugin 'Lokaltog/vim-easymotion' - Plugin 'tpope/vim-rails.git' - " The sparkup vim script is in a subdirectory of this repo called vim. - " Pass the path to set the runtimepath properly. - Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} - " plugins from http://vim-scripts.org/vim/scripts.html + " plugin from http://vim-scripts.org/vim/scripts.html Plugin 'L9' - Plugin 'FuzzyFinder' - " plugins not on GitHub + " plugin not on GitHub Plugin 'git://git.wincent.com/command-t.git' " git repos on your local machine (i.e. when working on your own plugin) Plugin 'file:///home/gmarik/path/to/plugin' - " ... + " The sparkup vim script is in a subdirectory of this repo called vim. + " Pass the path to set the runtimepath properly. + Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} + " Avoid a name conflict with L9 + Plugin 'user/L9', {'name': 'newL9'} - filetype plugin indent on " required + " All of your Plugins must be added before the following line + call vundle#end() " required + filetype plugin indent on " required " To ignore plugin indent changes, instead use: "filetype plugin on - " Put your stuff after this line + " + " Brief help + " :PluginList - list configured plugins + " :PluginInstall(!) - install (update) plugins + " :PluginSearch(!) foo - search (or refresh cache first) for foo + " :PluginClean(!) - confirm (or auto-approve) removal of unused plugins + " + " see :h vundle for more details or wiki for FAQ + " Put your non-Plugin stuff after this line 4. Install configured bundles: @@ -381,11 +388,10 @@ KEY | DESCRIPTION BundleSearch(!) | PluginSearch(!), VundleSearch(!) BundleClean | PluginClean(!), VundleClean(!) BundleList | PluginList - Bundles | Plugins Note: The Bundle commands will be deprecated. You may continue using them, but they may not get all future updates. For instance, we have enabled comments on Plugin lines but not Bundle, since it requires a change in command declaration. -vim:tw=78:ts=8:ft=help:norl: +" vim: set expandtab sts=2 ts=2 sw=2 tw=78 ft=help norl: diff --git a/test/minirc.vim b/test/minirc.vim index 352d9bc..3c24395 100644 --- a/test/minirc.vim +++ b/test/minirc.vim @@ -1,8 +1,8 @@ set nocompatible syntax on filetype off -set rtp+=~/.vim/bundle/vundle/ +set rtp+=~/.vim/bundle/Vundle.vim/ call vundle#rc() -Bundle 'gmarik/vundle' +Bundle 'gmarik/Vundle.vim' filetype plugin indent on diff --git a/test/vimrc b/test/vimrc index b4f2676..d8455a7 100644 --- a/test/vimrc +++ b/test/vimrc @@ -4,13 +4,13 @@ set nocompatible set nowrap let bundle_dir = '/tmp/vundle-test/bundles/' -" let src = 'http://github.com/gmarik/vundle.git' +" let src = 'http://github.com/gmarik/vundle.git' " Vundle Options " let g:vundle_default_git_proto = 'git' silent execute '!mkdir -p '.bundle_dir -silent execute '!ln -f -s ~/.vim/bundle/vundle '.bundle_dir +silent execute '!ln -f -s ~/.vim/bundle/Vundle.vim '.bundle_dir filetype off syntax on @@ -18,7 +18,7 @@ syntax on runtime macros/matchit.vim " This test should be executed in "test" directory -exec 'set rtp^='.bundle_dir.'vundle/' +exec 'set rtp^='.bundle_dir.'Vundle.vim/' call vundle#rc(bundle_dir) @@ -78,3 +78,4 @@ set wildignore+=*/.git/* au VimEnter * BundleInstall " e test/files/erlang.erl +" vim: set expandtab sts=2 ts=2 sw=2 tw=78: From 53cb1215f61e510ae6c82361a79da223d2376ba8 Mon Sep 17 00:00:00 2001 From: Jacobo de Vera Date: Thu, 3 Apr 2014 08:25:29 +0200 Subject: [PATCH 30/72] Treat changed remotes as new plugins If one had this plugin: Plugin 'foo/bar' And now switches to another one with the same name: Plugin 'baz/bar' Recognise this scenario and replace the old plugin with the new one, rather than silently assuming they are the same. Fixes #367 #48 #183 #400 --- autoload/vundle/installer.vim | 110 +++++++++++++++++++++++++++++----- 1 file changed, 94 insertions(+), 16 deletions(-) diff --git a/autoload/vundle/installer.vim b/autoload/vundle/installer.vim index 4e3d36c..3f1805d 100644 --- a/autoload/vundle/installer.vim +++ b/autoload/vundle/installer.vim @@ -3,7 +3,7 @@ " to g:bundle_dir. If a:bang is 1 it will also update all plugins (git pull). " " bang -- 1 or 0 -" ... -- any number of bundle specifications (seperate arguments) +" ... -- any number of bundle specifications (separate arguments) " --------------------------------------------------------------------------- func! vundle#installer#new(bang, ...) abort let bundles = (a:1 == '') ? @@ -323,27 +323,67 @@ endf " --------------------------------------------------------------------------- -" Install or update a given bundle object with git. +" Get the URL for the remote called 'origin' on the repository that +" corresponds to a given bundle. +" +" bundle -- a bundle object to check the repository for +" return -- the URL for the origin remote (string) +" --------------------------------------------------------------------------- +func! s:get_current_origin_url(bundle) abort + let cmd = 'cd '.vundle#installer#shellesc(a:bundle.path()).' && git config --get remote.origin.url' + let cmd = g:shellesc_cd(cmd) + let out = s:strip(s:system(cmd)) + return out +endf + + +" --------------------------------------------------------------------------- +" Create the appropriate sync command to run according to the current state of +" the local repository (clone, pull, reset, etc). +" +" In the case of a pull (update), also return the current sha, so that we can +" later check that there has been an upgrade. " " bang -- 0 if only new plugins should be installed, 1 if existing plugins " should be updated -" bundle -- a bundle object (dict) -" return -- 'todate' if nothing was updated or the repository was up to date, -" 'new' when the plugin was newly installed, 'updated' if some -" changes where pulled via git, 'error' if an error occurred in the -" shell command +" bundle -- a bundle object to create the sync command for +" return -- A list containing the command to run and the sha for the current +" HEAD " --------------------------------------------------------------------------- -func! s:sync(bang, bundle) abort - " Do not sync if this bundle is pinned - if a:bundle.is_pinned() - return 'pinned' - endif - +func! s:make_sync_command(bang, bundle) abort let git_dir = expand(a:bundle.path().'/.git/', 1) if isdirectory(git_dir) || filereadable(expand(a:bundle.path().'/.git', 1)) - if !(a:bang) | return 'todate' | endif - let cmd = 'cd '.vundle#installer#shellesc(a:bundle.path()).' && git pull && git submodule update --init --recursive' + let current_origin_url = s:get_current_origin_url(a:bundle) + if current_origin_url != a:bundle.uri + call s:log('Plugin URI change detected for Plugin ' . a:bundle.name) + call s:log('> Plugin ' . a:bundle.name . ' old URI: ' . current_origin_url) + call s:log('> Plugin ' . a:bundle.name . ' new URI: ' . a:bundle.uri) + " Directory names match but the origin remotes are not the same + let cmd_parts = [ + \ 'cd '.vundle#installer#shellesc(a:bundle.path()) , + \ 'git remote set-url origin ' . vundle#installer#shellesc(a:bundle.uri), + \ 'git fetch', + \ 'git reset --hard origin/HEAD', + \ 'git submodule update --init --recursive', + \ ] + let cmd = join(cmd_parts, ' && ') + let cmd = g:shellesc_cd(cmd) + let initial_sha = '' + return [cmd, initial_sha] + endif + + if !(a:bang) + " The repo exists, and no !, so leave as it is. + return ['', ''] + endif + + let cmd_parts = [ + \ 'cd '.vundle#installer#shellesc(a:bundle.path()), + \ 'git pull', + \ 'git submodule update --init --recursive', + \ ] + let cmd = join(cmd_parts, ' && ') let cmd = g:shellesc_cd(cmd) let get_current_sha = 'cd '.vundle#installer#shellesc(a:bundle.path()).' && git rev-parse HEAD' @@ -353,6 +393,33 @@ func! s:sync(bang, bundle) abort let cmd = 'git clone --recursive '.vundle#installer#shellesc(a:bundle.uri).' '.vundle#installer#shellesc(a:bundle.path()) let initial_sha = '' endif + return [cmd, initial_sha] +endf + + +" --------------------------------------------------------------------------- +" Install or update a given bundle object with git. +" +" bang -- 0 if only new plugins should be installed, 1 if existing plugins +" should be updated +" bundle -- a bundle object (dictionary) +" return -- a string indicating the status of the bundle installation: +" - todate : Nothing was updated or the repository was up to date +" - new : The plugin was newly installed +" - updated : Some changes where pulled via git +" - error : An error occurred in the shell command +" - pinned : The bundle is marked as pinned +" --------------------------------------------------------------------------- +func! s:sync(bang, bundle) abort + " Do not sync if this bundle is pinned + if a:bundle.is_pinned() + return 'pinned' + endif + + let [ cmd, initial_sha ] = s:make_sync_command(a:bang, a:bundle) + if empty(cmd) + return 'todate' + endif let out = s:system(cmd) call s:log('') @@ -427,7 +494,7 @@ endf " Add a log message to Vundle's internal logging variable. " " str -- the log message (string) -" prefix -- optional prefix for multiline entries (string) +" prefix -- optional prefix for multi-line entries (string) " return -- a:str " --------------------------------------------------------------------------- func! s:log(str, ...) abort @@ -441,4 +508,15 @@ func! s:log(str, ...) abort return a:str endf + +" --------------------------------------------------------------------------- +" Remove leading and trailing whitespace from a string +" +" str -- The string to rid of trailing and leading spaces +" return -- A string stripped of side spaces +" --------------------------------------------------------------------------- +func! s:strip(str) + return substitute(a:str, '\%^\_s*\(.\{-}\)\_s*\%$', '\1', '') +endf + " vim: set expandtab sts=2 ts=2 sw=2 tw=78 norl: From 3c6dd6d16be1cfb7a4d1244f693e977ab75c6f6d Mon Sep 17 00:00:00 2001 From: Jacobo de Vera Date: Tue, 15 Apr 2014 09:22:15 +0200 Subject: [PATCH 31/72] Check name collissions --- autoload/vundle/config.vim | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/autoload/vundle/config.vim b/autoload/vundle/config.vim index 1f942e1..561f468 100644 --- a/autoload/vundle/config.vim +++ b/autoload/vundle/config.vim @@ -7,6 +7,9 @@ " --------------------------------------------------------------------------- func! vundle#config#bundle(arg, ...) let bundle = vundle#config#init_bundle(a:arg, a:000) + if !s:check_bundle_name(bundle) + return + endif if exists('g:vundle_lazy_load') && g:vundle_lazy_load call add(g:bundles, bundle) else @@ -40,6 +43,7 @@ func! vundle#config#init() if !exists('g:bundles') | let g:bundles = [] | endif call s:rtp_rm_a() let g:bundles = [] + let g:bundle_names = {} endf @@ -79,6 +83,26 @@ func! vundle#config#init_bundle(name, opts) endf +" --------------------------------------------------------------------------- +" Check if the current bundle name has already been used in this running +" instance and show an error to that effect. +" +" bundle -- a bundle object whose name is to be checked +" return -- 0 if the bundle's name has been seen before, 1 otherwise +" --------------------------------------------------------------------------- +funct! s:check_bundle_name(bundle) + if has_key(g:bundle_names, a:bundle.name) + echoerr 'Vundle error: Name collision for Plugin ' . a:bundle.name_spec . + \ '. Plugin ' . g:bundle_names[a:bundle.name] . + \ ' previously used the name "' . a:bundle.name . '"' . + \ '. Skipping Plugin ' . a:bundle.name_spec . '.' + return 0 + endif + let g:bundle_names[a:bundle.name] = a:bundle.name_spec + return 1 +endf + + " --------------------------------------------------------------------------- " Parse the options which can be supplied with the bundle specification. " Corresponding documentation: vundle-plugins-configure From f1433663ee08beceaef450d35a2bab625f44d4cf Mon Sep 17 00:00:00 2001 From: Jacobo de Vera Date: Sat, 5 Apr 2014 23:30:20 +0200 Subject: [PATCH 32/72] Turn get_current_sha into a function So it can be reused. Fixes #441 --- autoload/vundle/installer.vim | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/autoload/vundle/installer.vim b/autoload/vundle/installer.vim index 3f1805d..dd8247b 100644 --- a/autoload/vundle/installer.vim +++ b/autoload/vundle/installer.vim @@ -337,6 +337,20 @@ func! s:get_current_origin_url(bundle) abort endf +" --------------------------------------------------------------------------- +" Get a short sha of the HEAD of the repository for a given bundle +" +" bundle -- a bundle object +" return -- A 15 character log sha for the current HEAD +" --------------------------------------------------------------------------- +func! s:get_current_sha(bundle) + let cmd = 'cd '.vundle#installer#shellesc(a:bundle.path()).' && git rev-parse HEAD' + let cmd = g:shellesc_cd(cmd) + let out = s:system(cmd)[0:15] + return out +endf + + " --------------------------------------------------------------------------- " Create the appropriate sync command to run according to the current state of " the local repository (clone, pull, reset, etc). @@ -386,9 +400,7 @@ func! s:make_sync_command(bang, bundle) abort let cmd = join(cmd_parts, ' && ') let cmd = g:shellesc_cd(cmd) - let get_current_sha = 'cd '.vundle#installer#shellesc(a:bundle.path()).' && git rev-parse HEAD' - let get_current_sha = g:shellesc_cd(get_current_sha) - let initial_sha = s:system(get_current_sha)[0:15] + let initial_sha = s:get_current_sha(a:bundle) else let cmd = 'git clone --recursive '.vundle#installer#shellesc(a:bundle.uri).' '.vundle#installer#shellesc(a:bundle.path()) let initial_sha = '' @@ -435,7 +447,7 @@ func! s:sync(bang, bundle) abort return 'new' endif - let updated_sha = s:system(get_current_sha)[0:15] + let updated_sha = s:get_current_sha(a:bundle) if initial_sha == updated_sha return 'todate' From 5fb14f7eecd3fac850b3b8c1498da6a91b252523 Mon Sep 17 00:00:00 2001 From: "Jeremy Pallats/starcraft.man" Date: Tue, 15 Apr 2014 14:14:19 -0400 Subject: [PATCH 33/72] Image Update In Readme * Fixes 435 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a2417af..8f25fcf 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ [Vundle] is undergoing an [interface change], please stay up to date to get latest changes. -![Vundle-installer](http://25.media.tumblr.com/tumblr_m8m96w06G81r39828o1_1280.png) +![Vundle-installer](http://i.imgur.com/Rueh7Cc.png) ## Quick Start From ba682521b0e4ba9d133525448855aee9fe70b6b6 Mon Sep 17 00:00:00 2001 From: "Jeremy Pallats/starcraft.man" Date: Wed, 16 Apr 2014 19:28:08 -0400 Subject: [PATCH 34/72] Link line numbers updated. --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 8f25fcf..f7bc449 100644 --- a/README.md +++ b/README.md @@ -143,10 +143,10 @@ see [Vundle contributors](https://github.com/gmarik/Vundle.vim/graphs/contributo [help tags]:http://vimdoc.sourceforge.net/htmldoc/helphelp.html#:helptags [runtime path]:http://vimdoc.sourceforge.net/htmldoc/options.html#%27runtimepath%27 -[configure]:https://github.com/gmarik/Vundle.vim/blob/master/doc/vundle.txt#L125-L232 -[install]:https://github.com/gmarik/Vundle.vim/blob/master/doc/vundle.txt#L233-L253 -[update]:https://github.com/gmarik/Vundle.vim/blob/master/doc/vundle.txt#L254-L264 -[search]:https://github.com/gmarik/Vundle.vim/blob/master/doc/vundle.txt#L265-L294 -[clean]:https://github.com/gmarik/Vundle.vim/blob/master/doc/vundle.txt#L302-L317 -[interactive mode]:https://github.com/gmarik/Vundle.vim/blob/master/doc/vundle.txt#L318-L359 -[interface change]:https://github.com/gmarik/Vundle.vim/blob/master/doc/vundle.txt#L371-L395 +[configure]:https://github.com/gmarik/Vundle.vim/blob/master/doc/vundle.txt#L126-L233 +[install]:https://github.com/gmarik/Vundle.vim/blob/master/doc/vundle.txt#L234-L254 +[update]:https://github.com/gmarik/Vundle.vim/blob/master/doc/vundle.txt#L255-L265 +[search]:https://github.com/gmarik/Vundle.vim/blob/master/doc/vundle.txt#L266-L295 +[clean]:https://github.com/gmarik/Vundle.vim/blob/master/doc/vundle.txt#L303-L318 +[interactive mode]:https://github.com/gmarik/Vundle.vim/blob/master/doc/vundle.txt#L319-L360 +[interface change]:https://github.com/gmarik/Vundle.vim/blob/master/doc/vundle.txt#L372-L396 From 16a8aedc032677493660b394cbcd83a025b365ff Mon Sep 17 00:00:00 2001 From: "Jeremy Pallats/starcraft.man" Date: Thu, 17 Apr 2014 11:47:14 -0400 Subject: [PATCH 35/72] Adding Gitter Badge. Fixes #443 --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index f7bc449..8f4d7ff 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,8 @@ [Vundle] is undergoing an [interface change], please stay up to date to get latest changes. +[![Gitter-chat](https://badges.gitter.im/gmarik/Vundle.vim.png)](https://gitter.im/gmarik/Vundle.vim) for discussion and support. + ![Vundle-installer](http://i.imgur.com/Rueh7Cc.png) ## Quick Start From 5b38044baf7af8176df894a023c92664f8fbb831 Mon Sep 17 00:00:00 2001 From: "Jeremy Pallats/starcraft.man" Date: Thu, 17 Apr 2014 11:57:51 -0400 Subject: [PATCH 36/72] Adding changelog. --- README.md | 4 ++++ changelog.md | 14 ++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 changelog.md diff --git a/README.md b/README.md index 8f4d7ff..661e86e 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,10 @@ See the [`:h vundle`](https://github.com/gmarik/Vundle.vim/blob/master/doc/vundle.txt) Vimdoc for more details. +## Changelog + +See the [changelog](https://github.com/gmarik/Vundle.vim/blob/master/CHANGELOG.md). + ## People Using Vundle see [Examples](https://github.com/gmarik/Vundle.vim/wiki/Examples) diff --git a/changelog.md b/changelog.md new file mode 100644 index 0000000..d23d5c9 --- /dev/null +++ b/changelog.md @@ -0,0 +1,14 @@ +Change Log +========== +F = Feature, B = Bug Fix, D = Doc Change + +### Version 0.10 +- F: #415 Support plugin pinning (for non-git repos & preventing updates) +- F: #440 Detect plugin name collisions +- F: #418 Deferred rtp manipulation (speeds up start) +- B: #418 Leave default rtp directories (i.e. ~/.vim) where they should be +- B: #429 Fix newline character in log +- B: #440 Detect changed remotes & update repos +- D: #435 Image update in README.md +- D: #419 Add function documentation +- D: #436 Rename vundle->Vundle.vim, add modelines, quickstart update From 5030bd522805ccc181a46b282d7bfc84bb5304a2 Mon Sep 17 00:00:00 2001 From: "Jeremy Pallats/starcraft.man" Date: Thu, 17 Apr 2014 12:02:10 -0400 Subject: [PATCH 37/72] Don't use > in log, highlights. --- changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index d23d5c9..a537da7 100644 --- a/changelog.md +++ b/changelog.md @@ -11,4 +11,4 @@ F = Feature, B = Bug Fix, D = Doc Change - B: #440 Detect changed remotes & update repos - D: #435 Image update in README.md - D: #419 Add function documentation -- D: #436 Rename vundle->Vundle.vim, add modelines, quickstart update +- D: #436 Rename vundle to Vundle.vim, add modelines, quickstart update From 526d390854f14bc5886ca0606b3be51f7379eacb Mon Sep 17 00:00:00 2001 From: "Jeremy Pallats/starcraft.man" Date: Thu, 17 Apr 2014 12:10:42 -0400 Subject: [PATCH 38/72] Changelog link fix. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 661e86e..05096b0 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,7 @@ See the [`:h vundle`](https://github.com/gmarik/Vundle.vim/blob/master/doc/vundl ## Changelog -See the [changelog](https://github.com/gmarik/Vundle.vim/blob/master/CHANGELOG.md). +See the [changelog](https://github.com/gmarik/Vundle.vim/blob/master/changelog.md). ## People Using Vundle From 4b751224d3e85ac8ac2ce5e6076b276a1f1730e8 Mon Sep 17 00:00:00 2001 From: Vaibhav Sagar Date: Fri, 25 Apr 2014 18:08:44 +1000 Subject: [PATCH 39/72] Allow rtp paths with spaces on Windows Suggested by @ikurcubic --- autoload/vundle/config.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/autoload/vundle/config.vim b/autoload/vundle/config.vim index 561f468..46d694e 100644 --- a/autoload/vundle/config.vim +++ b/autoload/vundle/config.vim @@ -167,6 +167,7 @@ func! s:rtp_add_defaults() let default = &rtp let &rtp = current for item in reverse(split(default, ',')) + let item = fnameescape(item) exec 'set rtp-=' . item if fnamemodify(item, ":t") == 'after' exec 'set rtp+=' . item From 286abd12f26d108fd76e9ea626ff4c0bcdcd1b06 Mon Sep 17 00:00:00 2001 From: Matthew Vance Date: Sat, 26 Apr 2014 21:02:05 -0300 Subject: [PATCH 40/72] Clarified comment for non GitHub example in Configure bundles --- README.md | 2 +- doc/vundle.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 05096b0..7f25cab 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ Plugin 'tpope/vim-fugitive' " plugin from http://vim-scripts.org/vim/scripts.html Plugin 'L9' - " plugin not on GitHub + " Git plugin not hosted on GitHub Plugin 'git://git.wincent.com/command-t.git' " git repos on your local machine (i.e. when working on your own plugin) Plugin 'file:///home/gmarik/path/to/plugin' diff --git a/doc/vundle.txt b/doc/vundle.txt index 8f310cd..63c0b1c 100644 --- a/doc/vundle.txt +++ b/doc/vundle.txt @@ -87,7 +87,7 @@ more information. Plugin 'tpope/vim-fugitive' " plugin from http://vim-scripts.org/vim/scripts.html Plugin 'L9' - " plugin not on GitHub + " Git plugin not hosted on GitHub Plugin 'git://git.wincent.com/command-t.git' " git repos on your local machine (i.e. when working on your own plugin) Plugin 'file:///home/gmarik/path/to/plugin' From a97e88917ccfc36f93acae518e49e0f0240e7445 Mon Sep 17 00:00:00 2001 From: Jacobo de Vera Date: Mon, 28 Apr 2014 15:03:38 +0200 Subject: [PATCH 41/72] Bump version to 0.10.1 --- autoload/vundle.vim | 2 +- changelog.md | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/autoload/vundle.vim b/autoload/vundle.vim index 2657121..efd8156 100644 --- a/autoload/vundle.vim +++ b/autoload/vundle.vim @@ -2,7 +2,7 @@ " Author: gmarik " HomePage: http://github.com/gmarik/Vundle.vim " Readme: http://github.com/gmarik/Vundle.vim/blob/master/README.md -" Version: 0.9 +" Version: 0.10.1 " Plugin Commands com! -nargs=+ -bar Plugin diff --git a/changelog.md b/changelog.md index a537da7..8c3a36e 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,9 @@ Change Log ========== F = Feature, B = Bug Fix, D = Doc Change +### Version 0.10.1 +- B: #451 Escape spaces when handling rtp directories + ### Version 0.10 - F: #415 Support plugin pinning (for non-git repos & preventing updates) - F: #440 Detect plugin name collisions From 0afe058353b891c592758d2863ca9f47a70588cf Mon Sep 17 00:00:00 2001 From: Lucas Hoffmann Date: Fri, 25 Apr 2014 11:30:50 +0200 Subject: [PATCH 42/72] change function g:shellesc_cd into vundle#installer#shellesc_cd --- autoload/vundle/installer.vim | 10 +++++----- autoload/vundle/scripts.vim | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/autoload/vundle/installer.vim b/autoload/vundle/installer.vim index dd8247b..614b64b 100644 --- a/autoload/vundle/installer.vim +++ b/autoload/vundle/installer.vim @@ -331,7 +331,7 @@ endf " --------------------------------------------------------------------------- func! s:get_current_origin_url(bundle) abort let cmd = 'cd '.vundle#installer#shellesc(a:bundle.path()).' && git config --get remote.origin.url' - let cmd = g:shellesc_cd(cmd) + let cmd = vundle#installer#shellesc_cd(cmd) let out = s:strip(s:system(cmd)) return out endf @@ -345,7 +345,7 @@ endf " --------------------------------------------------------------------------- func! s:get_current_sha(bundle) let cmd = 'cd '.vundle#installer#shellesc(a:bundle.path()).' && git rev-parse HEAD' - let cmd = g:shellesc_cd(cmd) + let cmd = vundle#installer#shellesc_cd(cmd) let out = s:system(cmd)[0:15] return out endf @@ -382,7 +382,7 @@ func! s:make_sync_command(bang, bundle) abort \ 'git submodule update --init --recursive', \ ] let cmd = join(cmd_parts, ' && ') - let cmd = g:shellesc_cd(cmd) + let cmd = vundle#installer#shellesc_cd(cmd) let initial_sha = '' return [cmd, initial_sha] endif @@ -398,7 +398,7 @@ func! s:make_sync_command(bang, bundle) abort \ 'git submodule update --init --recursive', \ ] let cmd = join(cmd_parts, ' && ') - let cmd = g:shellesc_cd(cmd) + let cmd = vundle#installer#shellesc_cd(cmd) let initial_sha = s:get_current_sha(a:bundle) else @@ -479,7 +479,7 @@ endf " cmd -- the command to be fixed (string) " return -- the fixed command (string) " --------------------------------------------------------------------------- -func! g:shellesc_cd(cmd) abort +func! vundle#installer#shellesc_cd(cmd) abort if ((has('win32') || has('win64')) && empty(matchstr(&shell, 'sh'))) let cmd = substitute(a:cmd, '^cd ','cd /d ','') " add /d switch to change drives return cmd diff --git a/autoload/vundle/scripts.vim b/autoload/vundle/scripts.vim index 2129903..d7409a1 100644 --- a/autoload/vundle/scripts.vim +++ b/autoload/vundle/scripts.vim @@ -72,7 +72,7 @@ func! s:create_changelog() abort \ ' && git log --pretty=format:"%s %an, %ar" --graph '. \ initial_sha.'..'.updated_sha - let cmd = g:shellesc_cd(cmd) + let cmd = vundle#installer#shellesc_cd(cmd) let updates = system(cmd) From a9176778795147b3c7f30a2d18424df224d7f29d Mon Sep 17 00:00:00 2001 From: Jacobo de Vera Date: Fri, 25 Apr 2014 22:33:13 +0200 Subject: [PATCH 43/72] Limit default rtp rearrangement Rearranging rtp so that **all** default directories appear first has the undesired side effect of not allowing plugins to override default syntax files. This changeset limits the rearrangement of the rtp to simply making sure the first directory in the default runtimepath appears first in also in the runtimepath after Vundle has finished manipulating it. This should keep the original bugs fixed and should eliminate the aforementioned undesired side effect. Fixes #430 Fixes #456 --- autoload/vundle/config.vim | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/autoload/vundle/config.vim b/autoload/vundle/config.vim index 46d694e..5ecb30b 100644 --- a/autoload/vundle/config.vim +++ b/autoload/vundle/config.vim @@ -166,15 +166,12 @@ func! s:rtp_add_defaults() set rtp&vim let default = &rtp let &rtp = current - for item in reverse(split(default, ',')) - let item = fnameescape(item) - exec 'set rtp-=' . item - if fnamemodify(item, ":t") == 'after' - exec 'set rtp+=' . item - else - exec 'set rtp^=' . item - endif - endfor + let default_rtp_items = split(default, ',') + if !empty(default_rtp_items) + let first_item = fnameescape(default_rtp_items[0]) + exec 'set rtp-=' . first_item + exec 'set rtp^=' . first_item + endif endf From 40e23f79f137a86c1deb3371e9955ce238054e36 Mon Sep 17 00:00:00 2001 From: Jacobo de Vera Date: Mon, 28 Apr 2014 15:52:41 +0200 Subject: [PATCH 44/72] Bump version to 0.10.2 --- README.md | 14 +++++++------- autoload/vundle.vim | 2 +- changelog.md | 5 +++++ 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 7f25cab..b8a7fdb 100644 --- a/README.md +++ b/README.md @@ -149,10 +149,10 @@ see [Vundle contributors](https://github.com/gmarik/Vundle.vim/graphs/contributo [help tags]:http://vimdoc.sourceforge.net/htmldoc/helphelp.html#:helptags [runtime path]:http://vimdoc.sourceforge.net/htmldoc/options.html#%27runtimepath%27 -[configure]:https://github.com/gmarik/Vundle.vim/blob/master/doc/vundle.txt#L126-L233 -[install]:https://github.com/gmarik/Vundle.vim/blob/master/doc/vundle.txt#L234-L254 -[update]:https://github.com/gmarik/Vundle.vim/blob/master/doc/vundle.txt#L255-L265 -[search]:https://github.com/gmarik/Vundle.vim/blob/master/doc/vundle.txt#L266-L295 -[clean]:https://github.com/gmarik/Vundle.vim/blob/master/doc/vundle.txt#L303-L318 -[interactive mode]:https://github.com/gmarik/Vundle.vim/blob/master/doc/vundle.txt#L319-L360 -[interface change]:https://github.com/gmarik/Vundle.vim/blob/master/doc/vundle.txt#L372-L396 +[configure]:https://github.com/gmarik/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L126-L233 +[install]:https://github.com/gmarik/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L234-L254 +[update]:https://github.com/gmarik/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L255-L265 +[search]:https://github.com/gmarik/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L266-L295 +[clean]:https://github.com/gmarik/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L303-L318 +[interactive mode]:https://github.com/gmarik/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L319-L360 +[interface change]:https://github.com/gmarik/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L372-L396 diff --git a/autoload/vundle.vim b/autoload/vundle.vim index efd8156..2939048 100644 --- a/autoload/vundle.vim +++ b/autoload/vundle.vim @@ -2,7 +2,7 @@ " Author: gmarik " HomePage: http://github.com/gmarik/Vundle.vim " Readme: http://github.com/gmarik/Vundle.vim/blob/master/README.md -" Version: 0.10.1 +" Version: 0.10.2 " Plugin Commands com! -nargs=+ -bar Plugin diff --git a/changelog.md b/changelog.md index 8c3a36e..20c645b 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,11 @@ Change Log ========== F = Feature, B = Bug Fix, D = Doc Change +### Version 0.10.1 + +- B: #430 Put user script directories before system directories in rtp +- B: #455 Rename functions that start with `g:` + lowercase letter (Vim patch 7.4.264) + ### Version 0.10.1 - B: #451 Escape spaces when handling rtp directories From c46dc75e3c4b17c49d018e720721fe76f6225640 Mon Sep 17 00:00:00 2001 From: Jacobo de Vera Date: Mon, 28 Apr 2014 17:49:47 +0200 Subject: [PATCH 45/72] Correct new version in changelog.md --- changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 20c645b..b620840 100644 --- a/changelog.md +++ b/changelog.md @@ -2,7 +2,7 @@ Change Log ========== F = Feature, B = Bug Fix, D = Doc Change -### Version 0.10.1 +### Version 0.10.2 - B: #430 Put user script directories before system directories in rtp - B: #455 Rename functions that start with `g:` + lowercase letter (Vim patch 7.4.264) From 8db3bcb5921103f0eb6de361c8b25cc03cb350b5 Mon Sep 17 00:00:00 2001 From: Andrea Cedraro Date: Sat, 26 Apr 2014 15:29:33 +0200 Subject: [PATCH 46/72] Change reference of `Bundle` to `Plugin` in the docs --- doc/vundle.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/vundle.txt b/doc/vundle.txt index 63c0b1c..198584b 100644 --- a/doc/vundle.txt +++ b/doc/vundle.txt @@ -139,7 +139,7 @@ follow on the same line as the command. Example: > Plugin 'git_URI' -The `Bundle` command can optionally take a second argument after the URI. It +The `Plugin` command can optionally take a second argument after the URI. It has to be a dictionary, separated from the URI by a comma. Each key-value pair in the dictionary is a configuration option. From 1953dcd2eeeb0124b7f0c7f8623bfad46509f47d Mon Sep 17 00:00:00 2001 From: gmarik Date: Wed, 16 Jul 2014 21:46:17 -0400 Subject: [PATCH 47/72] Clarify Readme. - closes #281 --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b8a7fdb..13d4eb6 100644 --- a/README.md +++ b/README.md @@ -78,10 +78,10 @@ "filetype plugin on " " Brief help - " :PluginList - list configured plugins - " :PluginInstall(!) - install (update) plugins - " :PluginSearch(!) foo - search (or refresh cache first) for foo - " :PluginClean(!) - confirm (or auto-approve) removal of unused plugins + " :PluginList - lists configured plugins + " :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate + " :PluginSearch foo - searches for foo; append `!` to refresh local cache + " :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal " " see :h vundle for more details or wiki for FAQ " Put your non-Plugin stuff after this line From dbc36fcaae8b03345672c5411d17cda22aceb652 Mon Sep 17 00:00:00 2001 From: Devin Weaver Date: Tue, 26 Aug 2014 11:00:55 -0400 Subject: [PATCH 48/72] Update minirc to Plugin namespace --- test/minirc.vim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/minirc.vim b/test/minirc.vim index 3c24395..7b48d13 100644 --- a/test/minirc.vim +++ b/test/minirc.vim @@ -2,7 +2,8 @@ set nocompatible syntax on filetype off set rtp+=~/.vim/bundle/Vundle.vim/ -call vundle#rc() -Bundle 'gmarik/Vundle.vim' +call vundle#begin() +Plugin 'gmarik/Vundle.vim' +call vundle#end() filetype plugin indent on From 55db8cc492ac5bafbd7302026839c8980cf6e7a7 Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Mon, 8 Sep 2014 15:45:39 +0800 Subject: [PATCH 49/72] Use svg instead of png to get better image quality --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 13d4eb6..fcd5f68 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ [Vundle] is undergoing an [interface change], please stay up to date to get latest changes. -[![Gitter-chat](https://badges.gitter.im/gmarik/Vundle.vim.png)](https://gitter.im/gmarik/Vundle.vim) for discussion and support. +[![Gitter-chat](https://badges.gitter.im/gmarik/Vundle.vim.svg)](https://gitter.im/gmarik/Vundle.vim) for discussion and support. ![Vundle-installer](http://i.imgur.com/Rueh7Cc.png) From a864467285fc419c5f652c740137fbfb8ffeaa32 Mon Sep 17 00:00:00 2001 From: Jacobo de Vera Date: Fri, 20 Feb 2015 07:01:53 +0100 Subject: [PATCH 50/72] Add explicit note for Fish users to check the FAQ --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 13d4eb6..900253c 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,8 @@ If you are using Windows, go directly to [Windows setup]. If you run into any issues, please consult the [FAQ]. See [Tips] for some advanced configurations. + Using non-POSIX shells, such as the popular Fish shell, requires additional setup. Please check the [FAQ]. + 2. Set up [Vundle]: `$ git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim` From 1df432aecfc0dacd93a1da0938830206f418fd66 Mon Sep 17 00:00:00 2001 From: Shahaf Arad Date: Mon, 16 Feb 2015 20:03:37 +0200 Subject: [PATCH 51/72] Allow updating specific plugins. --- autoload/vundle.vim | 6 +++--- autoload/vundle/installer.vim | 18 +++++++++++++++--- autoload/vundle/scripts.vim | 7 ++++++- doc/vundle.txt | 18 ++++++++++++++++-- 4 files changed, 40 insertions(+), 9 deletions(-) diff --git a/autoload/vundle.vim b/autoload/vundle.vim index 2939048..887ecdd 100644 --- a/autoload/vundle.vim +++ b/autoload/vundle.vim @@ -8,8 +8,8 @@ com! -nargs=+ -bar Plugin \ call vundle#config#bundle() -com! -nargs=? -bang -complete=custom,vundle#scripts#complete PluginInstall -\ call vundle#installer#new('!' == '', ) +com! -nargs=* -bang -complete=custom,vundle#scripts#complete PluginInstall +\ call vundle#installer#new('!' == '', ) com! -nargs=? -bang -complete=custom,vundle#scripts#complete PluginSearch \ call vundle#scripts#all('!' == '', ) @@ -24,7 +24,7 @@ com! -nargs=0 PluginDocs \ call vundle#installer#helptags(g:bundles) " Aliases -com! PluginUpdate PluginInstall! +com! -nargs=* -complete=custom,vundle#scripts#complete PluginUpdate PluginInstall! " Vundle Aliases com! -nargs=? -bang -complete=custom,vundle#scripts#complete VundleInstall PluginInstall diff --git a/autoload/vundle/installer.vim b/autoload/vundle/installer.vim index 614b64b..6797d1d 100644 --- a/autoload/vundle/installer.vim +++ b/autoload/vundle/installer.vim @@ -6,9 +6,21 @@ " ... -- any number of bundle specifications (separate arguments) " --------------------------------------------------------------------------- func! vundle#installer#new(bang, ...) abort - let bundles = (a:1 == '') ? - \ g:bundles : - \ map(copy(a:000), 'vundle#config#bundle(v:val, {})') + " No specific plugins are specified. Operate on all plugins. + if a:0 == 0 + let bundles = g:bundles + " Specific plugins are specified for update. Update them. + elseif (a:bang) + let bundles = filter(copy(g:bundles), 'index(a:000, v:val.name) > -1') + " Specific plugins are specified for installation. Install them. + else + let bundles = map(copy(a:000), 'vundle#config#bundle(v:val, {})') + endif + + if empty(bundles) + echoerr 'No bundles were selected for operation' + return + endif let names = vundle#scripts#bundle_names(map(copy(bundles), 'v:val.name_spec')) call vundle#scripts#view('Installer',['" Installing plugins to '.expand(g:bundle_dir, 1)], names + ['Helptags']) diff --git a/autoload/vundle/scripts.vim b/autoload/vundle/scripts.vim index d7409a1..f160e01 100644 --- a/autoload/vundle/scripts.vim +++ b/autoload/vundle/scripts.vim @@ -39,7 +39,12 @@ endf " candidates, see also :h command-completion-custom " --------------------------------------------------------------------------- func! vundle#scripts#complete(a,c,d) - return join(s:load_scripts(0),"\n") + " Return only installed plugins if updating + if match(a:c, '\v^Plugin%(Install!|Update)') == 0 + return join(map(copy(g:bundles), 'v:val.name'), "\n") + else + return join(s:load_scripts(0),"\n") + endif endf diff --git a/doc/vundle.txt b/doc/vundle.txt index 198584b..9a2670a 100644 --- a/doc/vundle.txt +++ b/doc/vundle.txt @@ -244,8 +244,16 @@ PluginInstall allows installation of plugins by name: > :PluginInstall unite.vim -Installs and activates unite.vim. You can use Tab to auto-complete known -script names. Note that the installation just described isn't permanent. To +Installs and activates unite.vim. + +PluginInstall also allows installation of several plugins separated by space. +> + :PluginInstall tpope/vim-surround tpope/vim-fugitive + +Installs both tpope/vim-surround and tpope/vim-fugitive from GitHub. + +You can use Tab to auto-complete known script names. +Note that the installation just described isn't permanent. To finish, you must put `Plugin 'unite.vim'` at the appropriate place in your `.vimrc` to tell Vundle to load the plugin at startup. @@ -263,6 +271,12 @@ Installs or updates the configured plugins. Press 'u' after updates complete to see the change log of all updated bundles. Press 'l' (lowercase 'L') to see the log of commands if any errors occurred. +To update specific plugins, write their names separated by space: +> + :PluginInstall! vim-surround vim-fugitive +or > + :PluginUpdate vim-surround vim-fugitive + 3.5 SEARCHING PLUGINS ~ *vundle-plugins-search* *:PluginSearch* > From 92a66df592c3562fb39714a3531d8494279b1f6a Mon Sep 17 00:00:00 2001 From: Jacobo de Vera Date: Mon, 2 Mar 2015 22:02:44 +0100 Subject: [PATCH 52/72] Complete installed plugins also for VundleUpdate --- autoload/vundle.vim | 1 + autoload/vundle/scripts.vim | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/autoload/vundle.vim b/autoload/vundle.vim index 887ecdd..dded571 100644 --- a/autoload/vundle.vim +++ b/autoload/vundle.vim @@ -32,6 +32,7 @@ com! -nargs=? -bang -complete=custom,vundle#scripts#complete VundleSearch Plugi com! -nargs=? -bang VundleClean PluginClean com! -nargs=0 VundleDocs PluginDocs com! VundleUpdate PluginInstall! +com! -nargs=* -complete=custom,vundle#scripts#complete VundleUpdate PluginInstall! " Deprecated Commands com! -nargs=+ Bundle call vundle#config#bundle() diff --git a/autoload/vundle/scripts.vim b/autoload/vundle/scripts.vim index f160e01..4a066fb 100644 --- a/autoload/vundle/scripts.vim +++ b/autoload/vundle/scripts.vim @@ -36,13 +36,15 @@ endf " " a, c, d -- see :h command-completion-custom " return -- all valid plugin names from vim-scripts.org as completion -" candidates, see also :h command-completion-custom +" candidates, or all installed plugin names when running an 'Update +" variant'. see also :h command-completion-custom " --------------------------------------------------------------------------- func! vundle#scripts#complete(a,c,d) - " Return only installed plugins if updating - if match(a:c, '\v^Plugin%(Install!|Update)') == 0 + if match(a:c, '\v^%(Plugin|Vundle)%(Install!|Update)') == 0 + " Only installed plugins if updating return join(map(copy(g:bundles), 'v:val.name'), "\n") else + " Or all known plugins otherwise return join(s:load_scripts(0),"\n") endif endf From 7d9b10874e374f0db4ae47aa55e49033174bbf50 Mon Sep 17 00:00:00 2001 From: Lucas Hoffmann Date: Mon, 28 Apr 2014 12:14:18 +0200 Subject: [PATCH 53/72] Allow multiple calls to VundleChangelog. The command `silent pedit ...` was causing trouble if the user had `set hidden`. Now we `bdelete` the changelog buffer before editing it anew. --- autoload/vundle/scripts.vim | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/autoload/vundle/scripts.vim b/autoload/vundle/scripts.vim index 4a066fb..f9f2355 100644 --- a/autoload/vundle/scripts.vim +++ b/autoload/vundle/scripts.vim @@ -70,6 +70,7 @@ endf " user. " --------------------------------------------------------------------------- func! s:create_changelog() abort + let changelog = ['Updated Plugins:'] for bundle_data in g:updated_bundles let initial_sha = bundle_data[0] let updated_sha = bundle_data[1] @@ -83,18 +84,19 @@ func! s:create_changelog() abort let updates = system(cmd) - call add(g:vundle_changelog, '') - call add(g:vundle_changelog, 'Updated Plugin: '.bundle.name) + call add(changelog, '') + call add(changelog, 'Updated Plugin: '.bundle.name) if bundle.uri =~ "https://github.com" - call add(g:vundle_changelog, 'Compare at: '.bundle.uri[0:-5].'/compare/'.initial_sha.'...'.updated_sha) + call add(changelog, 'Compare at: '.bundle.uri[0:-5].'/compare/'.initial_sha.'...'.updated_sha) endif for update in split(updates, '\n') let update = substitute(update, '\s\+$', '', '') - call add(g:vundle_changelog, ' '.update) + call add(changelog, ' '.update) endfor endfor + return changelog endf @@ -102,14 +104,15 @@ endf " View the change log after an update or installation. " --------------------------------------------------------------------------- func! s:view_changelog() - call s:create_changelog() - - if !exists('g:vundle_changelog_file') - let g:vundle_changelog_file = tempname() + if !exists('s:changelog_file') + let s:changelog_file = tempname() endif - call writefile(g:vundle_changelog, g:vundle_changelog_file) - execute 'silent pedit ' . g:vundle_changelog_file + if bufloaded(s:changelog_file) + execute 'silent bdelete' s:changelog_file + endif + call writefile(s:create_changelog(), s:changelog_file) + execute 'silent pedit' s:changelog_file wincmd P | wincmd H endf From cad5f50a64ddae6a0c6c068b260d48904f12694c Mon Sep 17 00:00:00 2001 From: Lucas Hoffmann Date: Tue, 3 Mar 2015 10:40:30 +0100 Subject: [PATCH 54/72] Remove unneeded variable setting. The variable is script local to autoload/vundle/scripts.vim since #468. --- autoload/vundle.vim | 1 - 1 file changed, 1 deletion(-) diff --git a/autoload/vundle.vim b/autoload/vundle.vim index dded571..6a3df33 100644 --- a/autoload/vundle.vim +++ b/autoload/vundle.vim @@ -64,7 +64,6 @@ func! vundle#rc(...) abort let g:bundle_dir = len(a:000) > 0 ? expand(a:1, 1) : expand('$HOME/.vim/bundle', 1) let g:updated_bundles = [] let g:vundle_log = [] - let g:vundle_changelog = ['Updated Plugins:'] call vundle#config#init() endf From 088295df77925ee339aacc0e2f2789b0e8f143e8 Mon Sep 17 00:00:00 2001 From: Lucas Hoffmann Date: Tue, 3 Mar 2015 10:50:28 +0100 Subject: [PATCH 55/72] Refactor global variables into script local variables. These variables only occur in one file each. By making them script local variables this is "documented" in the code. At the same time the global namespace is polluted less. Changed: g:bundle_names -> s:bundle_names g:vundle_last_status -> s:last_status g:vundle_log_file -> s:log_file g:vundle_view -> s:view --- autoload/vundle/config.vim | 8 ++++---- autoload/vundle/installer.vim | 6 +++--- autoload/vundle/scripts.vim | 14 +++++++------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/autoload/vundle/config.vim b/autoload/vundle/config.vim index 5ecb30b..a17eeb1 100644 --- a/autoload/vundle/config.vim +++ b/autoload/vundle/config.vim @@ -43,7 +43,7 @@ func! vundle#config#init() if !exists('g:bundles') | let g:bundles = [] | endif call s:rtp_rm_a() let g:bundles = [] - let g:bundle_names = {} + let s:bundle_names = {} endf @@ -91,14 +91,14 @@ endf " return -- 0 if the bundle's name has been seen before, 1 otherwise " --------------------------------------------------------------------------- funct! s:check_bundle_name(bundle) - if has_key(g:bundle_names, a:bundle.name) + if has_key(s:bundle_names, a:bundle.name) echoerr 'Vundle error: Name collision for Plugin ' . a:bundle.name_spec . - \ '. Plugin ' . g:bundle_names[a:bundle.name] . + \ '. Plugin ' . s:bundle_names[a:bundle.name] . \ ' previously used the name "' . a:bundle.name . '"' . \ '. Skipping Plugin ' . a:bundle.name_spec . '.' return 0 endif - let g:bundle_names[a:bundle.name] = a:bundle.name_spec + let s:bundle_names[a:bundle.name] = a:bundle.name_spec return 1 endf diff --git a/autoload/vundle/installer.vim b/autoload/vundle/installer.vim index 6797d1d..ffc44ba 100644 --- a/autoload/vundle/installer.vim +++ b/autoload/vundle/installer.vim @@ -55,11 +55,11 @@ func! s:process(bang, cmd) exec ':norm '.a:cmd - if 'error' == g:vundle_last_status + if 'error' == s:last_status let msg = 'With errors; press l to view log' endif - if 'updated' == g:vundle_last_status && empty(msg) + if 'updated' == s:last_status && empty(msg) let msg = 'Plugins updated; press u to view changelog' endif @@ -118,7 +118,7 @@ func! vundle#installer#run(func_name, name, ...) abort throw 'whoops, unknown status:'.status endif - let g:vundle_last_status = status + let s:last_status = status return status endf diff --git a/autoload/vundle/scripts.vim b/autoload/vundle/scripts.vim index f9f2355..4e492fa 100644 --- a/autoload/vundle/scripts.vim +++ b/autoload/vundle/scripts.vim @@ -54,12 +54,12 @@ endf " View the logfile after an update or installation. " --------------------------------------------------------------------------- func! s:view_log() - if !exists('g:vundle_log_file') - let g:vundle_log_file = tempname() + if !exists('s:log_file') + let s:log_file = tempname() endif - call writefile(g:vundle_log, g:vundle_log_file) - execute 'silent pedit ' . g:vundle_log_file + call writefile(g:vundle_log, s:log_file) + execute 'silent pedit ' . s:log_file wincmd P | wincmd H endf @@ -139,15 +139,15 @@ endf " strings) " --------------------------------------------------------------------------- func! vundle#scripts#view(title, headers, results) - if exists('g:vundle_view') && bufloaded(g:vundle_view) - exec g:vundle_view.'bd!' + if exists('s:view') && bufloaded(s:view) + exec s:view.'bd!' endif exec 'silent pedit [Vundle] '.a:title wincmd P | wincmd H - let g:vundle_view = bufnr('%') + let s:view = bufnr('%') " " make buffer modifiable " to append without errors From 5f27abb9580d0b21933f95e7f741194718b5db1e Mon Sep 17 00:00:00 2001 From: Lucas Hoffmann Date: Tue, 3 Mar 2015 10:56:24 +0100 Subject: [PATCH 56/72] Allow multiple calls to VundleLog. If it was loaded, unload the log buffer before editing it. Otherwise the editing command can "hang" if the user has `set hidden`. This problem was originally discovered with the VundleChangelog command and the analogous fix was applied in 7d9b10. See github issue #468 for more. --- autoload/vundle/scripts.vim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/autoload/vundle/scripts.vim b/autoload/vundle/scripts.vim index 4e492fa..8f17632 100644 --- a/autoload/vundle/scripts.vim +++ b/autoload/vundle/scripts.vim @@ -58,6 +58,9 @@ func! s:view_log() let s:log_file = tempname() endif + if bufloaded(s:log_file) + execute 'silent bdelete' s:log_file + endif call writefile(g:vundle_log, s:log_file) execute 'silent pedit ' . s:log_file From 356f245fbefa631aa54d2f8a65c05063b278dfe2 Mon Sep 17 00:00:00 2001 From: Lucas Hoffmann Date: Tue, 3 Mar 2015 11:10:16 +0100 Subject: [PATCH 57/72] Refactor global variables into autoload variables. All global variables that are not part of the public API (mentioned in the documentation) are turned into autoload variables. This is intended to give all global variables defined by Vundle.vim a common prefix. The variable g:default_git_proto is part of the public API and is therefor not changed. This is the only exception. Changed: g:bundle_dir -> vundle#bundle_dir g:bundles -> vundle#bundles g:updated_bundles -> vundle#updated_bundles g:vundle_lazy_load -> vundle#lazy_load g:vundle_log -> vundle#log Unchanged: g:default_git_proto --- autoload/vundle.vim | 12 ++++++------ autoload/vundle/config.vim | 20 ++++++++++---------- autoload/vundle/installer.vim | 33 +++++++++++++++++---------------- autoload/vundle/scripts.vim | 8 ++++---- 4 files changed, 37 insertions(+), 36 deletions(-) diff --git a/autoload/vundle.vim b/autoload/vundle.vim index 6a3df33..f186236 100644 --- a/autoload/vundle.vim +++ b/autoload/vundle.vim @@ -21,7 +21,7 @@ com! -nargs=? -bang PluginClean \ call vundle#installer#clean('!' == '') com! -nargs=0 PluginDocs -\ call vundle#installer#helptags(g:bundles) +\ call vundle#installer#helptags(g:vundle#bundles) " Aliases com! -nargs=* -complete=custom,vundle#scripts#complete PluginUpdate PluginInstall! @@ -61,22 +61,22 @@ endif " :Plugin command in the vimrc. It is not possible to do this automatically " because when loading the vimrc file no plugins where loaded yet. func! vundle#rc(...) abort - let g:bundle_dir = len(a:000) > 0 ? expand(a:1, 1) : expand('$HOME/.vim/bundle', 1) - let g:updated_bundles = [] - let g:vundle_log = [] + let g:vundle#bundle_dir = len(a:000) > 0 ? expand(a:1, 1) : expand('$HOME/.vim/bundle', 1) + let g:vundle#updated_bundles = [] + let g:vundle#log = [] call vundle#config#init() endf " Alternative to vundle#rc, offers speed up by modifying rtp only when end() " called later. func! vundle#begin(...) abort - let g:vundle_lazy_load = 1 + let g:vundle#lazy_load = 1 call call('vundle#rc', a:000) endf " Finishes putting plugins on the rtp. func! vundle#end(...) abort - unlet g:vundle_lazy_load + unlet g:vundle#lazy_load call vundle#config#activate_bundles() endf diff --git a/autoload/vundle/config.vim b/autoload/vundle/config.vim index a17eeb1..8467b9f 100644 --- a/autoload/vundle/config.vim +++ b/autoload/vundle/config.vim @@ -10,11 +10,11 @@ func! vundle#config#bundle(arg, ...) if !s:check_bundle_name(bundle) return endif - if exists('g:vundle_lazy_load') && g:vundle_lazy_load - call add(g:bundles, bundle) + if exists('g:vundle#lazy_load') && g:vundle#lazy_load + call add(g:vundle#bundles, bundle) else call s:rtp_rm_a() - call add(g:bundles, bundle) + call add(g:vundle#bundles, bundle) call s:rtp_add_a() call s:rtp_add_defaults() endif @@ -40,9 +40,9 @@ endf " once. " --------------------------------------------------------------------------- func! vundle#config#init() - if !exists('g:bundles') | let g:bundles = [] | endif + if !exists('g:vundle#bundles') | let g:vundle#bundles = [] | endif call s:rtp_rm_a() - let g:bundles = [] + let g:vundle#bundles = [] let s:bundle_names = {} endf @@ -55,11 +55,11 @@ endf func! vundle#config#require(bundles) abort for b in a:bundles call s:rtp_add(b.rtpath) - call s:rtp_add(g:bundle_dir) + call s:rtp_add(g:vundle#bundle_dir) " TODO: it has to be relative rtpath, not bundle.name exec 'runtime! '.b.name.'/plugin/*.vim' exec 'runtime! '.b.name.'/after/*.vim' - call s:rtp_rm(g:bundle_dir) + call s:rtp_rm(g:vundle#bundle_dir) endfor call s:rtp_add_defaults() endf @@ -180,7 +180,7 @@ endf " runtimepath. " --------------------------------------------------------------------------- func! s:rtp_rm_a() - let paths = map(copy(g:bundles), 'v:val.rtpath') + let paths = map(copy(g:vundle#bundles), 'v:val.rtpath') let prepends = join(paths, ',') let appends = join(paths, '/after,').'/after' exec 'set rtp-='.fnameescape(prepends) @@ -193,7 +193,7 @@ endf " runtimepath. " --------------------------------------------------------------------------- func! s:rtp_add_a() - let paths = map(copy(g:bundles), 'v:val.rtpath') + let paths = map(copy(g:vundle#bundles), 'v:val.rtpath') let prepends = join(paths, ',') let appends = join(paths, '/after,').'/after' exec 'set rtp^='.fnameescape(prepends) @@ -262,7 +262,7 @@ let s:bundle = {} " return -- the target location to clone this bundle to " --------------------------------------------------------------------------- func! s:bundle.path() - return s:expand_path(g:bundle_dir.'/'.self.name) + return s:expand_path(g:vundle#bundle_dir.'/'.self.name) endf diff --git a/autoload/vundle/installer.vim b/autoload/vundle/installer.vim index ffc44ba..472271a 100644 --- a/autoload/vundle/installer.vim +++ b/autoload/vundle/installer.vim @@ -1,6 +1,7 @@ " --------------------------------------------------------------------------- -" Try to clone all new bundles given (or all bundles in g:bundles by default) -" to g:bundle_dir. If a:bang is 1 it will also update all plugins (git pull). +" Try to clone all new bundles given (or all bundles in g:vundle#bundles by +" default) to g:vundle#bundle_dir. If a:bang is 1 it will also update all +" plugins (git pull). " " bang -- 1 or 0 " ... -- any number of bundle specifications (separate arguments) @@ -8,10 +9,10 @@ func! vundle#installer#new(bang, ...) abort " No specific plugins are specified. Operate on all plugins. if a:0 == 0 - let bundles = g:bundles + let bundles = g:vundle#bundles " Specific plugins are specified for update. Update them. elseif (a:bang) - let bundles = filter(copy(g:bundles), 'index(a:000, v:val.name) > -1') + let bundles = filter(copy(g:vundle#bundles), 'index(a:000, v:val.name) > -1') " Specific plugins are specified for installation. Install them. else let bundles = map(copy(a:000), 'vundle#config#bundle(v:val, {})') @@ -23,7 +24,7 @@ func! vundle#installer#new(bang, ...) abort endif let names = vundle#scripts#bundle_names(map(copy(bundles), 'v:val.name_spec')) - call vundle#scripts#view('Installer',['" Installing plugins to '.expand(g:bundle_dir, 1)], names + ['Helptags']) + call vundle#scripts#view('Installer',['" Installing plugins to '.expand(g:vundle#bundle_dir, 1)], names + ['Helptags']) " This calls 'add' as a normal mode command. This is a buffer local mapping " defined in vundle#scripts#view(). The mapping will call a buffer local @@ -163,10 +164,10 @@ endf " return -- the return value from s:sync() " --------------------------------------------------------------------------- func! vundle#installer#install(bang, name) abort - if !isdirectory(g:bundle_dir) | call mkdir(g:bundle_dir, 'p') | endif + if !isdirectory(g:vundle#bundle_dir) | call mkdir(g:vundle#bundle_dir, 'p') | endif let n = substitute(a:name,"['".'"]\+','','g') - let matched = filter(copy(g:bundles), 'v:val.name_spec == n') + let matched = filter(copy(g:vundle#bundles), 'v:val.name_spec == n') if len(matched) > 0 let b = matched[0] @@ -179,12 +180,12 @@ endf " --------------------------------------------------------------------------- -" Call :helptags for all bundles in g:bundles. +" Call :helptags for all bundles in g:vundle#bundles. " " return -- 'error' if an error occurred, else return 'helptags' " --------------------------------------------------------------------------- func! vundle#installer#docs() abort - let error_count = vundle#installer#helptags(g:bundles) + let error_count = vundle#installer#helptags(g:vundle#bundles) if error_count > 0 return 'error' endif @@ -222,10 +223,10 @@ endf " bang -- not used " --------------------------------------------------------------------------- func! vundle#installer#list(bang) abort - let bundles = vundle#scripts#bundle_names(map(copy(g:bundles), 'v:val.name_spec')) + let bundles = vundle#scripts#bundle_names(map(copy(g:vundle#bundles), 'v:val.name_spec')) call vundle#scripts#view('list', ['" My Plugins'], bundles) redraw - echo len(g:bundles).' plugins configured' + echo len(g:vundle#bundles).' plugins configured' endf @@ -237,10 +238,10 @@ endf " should be removed unconditionally " --------------------------------------------------------------------------- func! vundle#installer#clean(bang) abort - let bundle_dirs = map(copy(g:bundles), 'v:val.path()') + let bundle_dirs = map(copy(g:vundle#bundles), 'v:val.path()') let all_dirs = (v:version > 702 || (v:version == 702 && has("patch51"))) - \ ? split(globpath(g:bundle_dir, '*', 1), "\n") - \ : split(globpath(g:bundle_dir, '*'), "\n") + \ ? split(globpath(g:vundle#bundle_dir, '*', 1), "\n") + \ : split(globpath(g:vundle#bundle_dir, '*'), "\n") let x_dirs = filter(all_dirs, '0 > index(bundle_dirs, v:val)') if empty(x_dirs) @@ -465,7 +466,7 @@ func! s:sync(bang, bundle) abort return 'todate' endif - call add(g:updated_bundles, [initial_sha, updated_sha, a:bundle]) + call add(g:vundle#updated_bundles, [initial_sha, updated_sha, a:bundle]) return 'updated' endf @@ -527,7 +528,7 @@ func! s:log(str, ...) abort let lines = split(a:str, '\n', 1) let time = strftime(fmt) for line in lines - call add(g:vundle_log, '['. time .'] '. prefix . line) + call add(g:vundle#log, '['. time .'] '. prefix . line) endfor return a:str endf diff --git a/autoload/vundle/scripts.vim b/autoload/vundle/scripts.vim index 8f17632..5d56476 100644 --- a/autoload/vundle/scripts.vim +++ b/autoload/vundle/scripts.vim @@ -42,7 +42,7 @@ endf func! vundle#scripts#complete(a,c,d) if match(a:c, '\v^%(Plugin|Vundle)%(Install!|Update)') == 0 " Only installed plugins if updating - return join(map(copy(g:bundles), 'v:val.name'), "\n") + return join(map(copy(g:vundle#bundles), 'v:val.name'), "\n") else " Or all known plugins otherwise return join(s:load_scripts(0),"\n") @@ -61,7 +61,7 @@ func! s:view_log() if bufloaded(s:log_file) execute 'silent bdelete' s:log_file endif - call writefile(g:vundle_log, s:log_file) + call writefile(g:vundle#log, s:log_file) execute 'silent pedit ' . s:log_file wincmd P | wincmd H @@ -74,7 +74,7 @@ endf " --------------------------------------------------------------------------- func! s:create_changelog() abort let changelog = ['Updated Plugins:'] - for bundle_data in g:updated_bundles + for bundle_data in g:vundle#updated_bundles let initial_sha = bundle_data[0] let updated_sha = bundle_data[1] let bundle = bundle_data[2] @@ -258,7 +258,7 @@ endf " specifications) of all plugins from vim-scripts.org " --------------------------------------------------------------------------- func! s:load_scripts(bang) - let f = expand(g:bundle_dir.'/.vundle/script-names.vim-scripts.org.json', 1) + let f = expand(g:vundle#bundle_dir.'/.vundle/script-names.vim-scripts.org.json', 1) if a:bang || !filereadable(f) if 0 != s:fetch_scripts(f) return [] From 16237bbb73f1f03b494d3ade77fd0ab947776dfb Mon Sep 17 00:00:00 2001 From: Lucas Hoffmann Date: Tue, 3 Mar 2015 11:20:43 +0100 Subject: [PATCH 58/72] Set default values for autoload variables. The setting of the default values for the autoload variables is moved out of any function. One reason being that these settings do not depend on the argument of the function. The second being that Vim will source the autoload script if an undefined autoload variable is referenced and the file is expected to define the variable (see :help autoload). --- autoload/vundle.vim | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/autoload/vundle.vim b/autoload/vundle.vim index f186236..e458618 100644 --- a/autoload/vundle.vim +++ b/autoload/vundle.vim @@ -61,9 +61,9 @@ endif " :Plugin command in the vimrc. It is not possible to do this automatically " because when loading the vimrc file no plugins where loaded yet. func! vundle#rc(...) abort - let g:vundle#bundle_dir = len(a:000) > 0 ? expand(a:1, 1) : expand('$HOME/.vim/bundle', 1) - let g:vundle#updated_bundles = [] - let g:vundle#log = [] + if a:0 > 0 + let g:vundle#bundle_dir = expand(a:1, 1) + endif call vundle#config#init() endf @@ -80,4 +80,11 @@ func! vundle#end(...) abort call vundle#config#activate_bundles() endf +" Initialize some global variables used by Vundle. +let vundle#bundle_dir = expand('$HOME/.vim/bundle', 1) +let vundle#bundles = [] +let vundle#lazy_load = 0 +let vundle#log = [] +let vundle#updated_bundles = [] + " vim: set expandtab sts=2 ts=2 sw=2 tw=78 norl: From 2506347586621114ccb6fedb7f93a560fc19c691 Mon Sep 17 00:00:00 2001 From: Shahaf Arad Date: Fri, 13 Mar 2015 20:00:47 +0200 Subject: [PATCH 59/72] Prevent insecure plugin names. Plugins' names which contain '../', '$HOME', '%:h:h', '..\', etc. can be dangerous. Use a sensible whitelist for plugin names and prevent its expansion. --- autoload/vundle/config.vim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/autoload/vundle/config.vim b/autoload/vundle/config.vim index 8467b9f..0e02b11 100644 --- a/autoload/vundle/config.vim +++ b/autoload/vundle/config.vim @@ -97,6 +97,9 @@ funct! s:check_bundle_name(bundle) \ ' previously used the name "' . a:bundle.name . '"' . \ '. Skipping Plugin ' . a:bundle.name_spec . '.' return 0 + elseif a:bundle.name !~ '\v^[A-Za-z0-9_-]%(\.?[A-Za-z0-9_-])*$' + echoerr 'Invalid plugin name: ' . a:bundle.name + return 0 endif let s:bundle_names[a:bundle.name] = a:bundle.name_spec return 1 @@ -262,7 +265,7 @@ let s:bundle = {} " return -- the target location to clone this bundle to " --------------------------------------------------------------------------- func! s:bundle.path() - return s:expand_path(g:vundle#bundle_dir.'/'.self.name) + return s:expand_path(g:vundle#bundle_dir.'/') . self.name endf From 1ae7e9138c0ddd40a1a7502f6e0dd897681166cb Mon Sep 17 00:00:00 2001 From: Daniel Levenson Date: Sun, 26 Jul 2015 14:57:40 -0400 Subject: [PATCH 60/72] Update repository references. Saves a 301 redirect and removes a tad bit of confusion when `git clone`-ing Vundle when installing. --- README.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 337e0b5..defb752 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -## [Help Maintain Vundle](https://github.com/gmarik/Vundle.vim/issues/383) +## [Help Maintain Vundle](https://github.com/VundleVim/Vundle.vim/issues/383) ## About @@ -20,7 +20,7 @@ [Vundle] is undergoing an [interface change], please stay up to date to get latest changes. -[![Gitter-chat](https://badges.gitter.im/gmarik/Vundle.vim.svg)](https://gitter.im/gmarik/Vundle.vim) for discussion and support. +[![Gitter-chat](https://badges.gitter.im/VundleVim/Vundle.vim.svg)](https://gitter.im/VundleVim/Vundle.vim) for discussion and support. ![Vundle-installer](http://i.imgur.com/Rueh7Cc.png) @@ -38,7 +38,7 @@ 2. Set up [Vundle]: - `$ git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim` + `$ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim` 3. Configure Plugins: @@ -55,7 +55,7 @@ "call vundle#begin('~/some/path/here') " let Vundle manage Vundle, required - Plugin 'gmarik/Vundle.vim' + Plugin 'VundleVim/Vundle.vim' " The following are examples of different formats supported. " Keep Plugin commands between vundle#begin/end. @@ -97,19 +97,19 @@ ## Docs -See the [`:h vundle`](https://github.com/gmarik/Vundle.vim/blob/master/doc/vundle.txt) Vimdoc for more details. +See the [`:h vundle`](https://github.com/VundleVim/Vundle.vim/blob/master/doc/vundle.txt) Vimdoc for more details. ## Changelog -See the [changelog](https://github.com/gmarik/Vundle.vim/blob/master/changelog.md). +See the [changelog](https://github.com/VundleVim/Vundle.vim/blob/master/changelog.md). ## People Using Vundle -see [Examples](https://github.com/gmarik/Vundle.vim/wiki/Examples) +see [Examples](https://github.com/VundleVim/Vundle.vim/wiki/Examples) ## Contributors -see [Vundle contributors](https://github.com/gmarik/Vundle.vim/graphs/contributors) +see [Vundle contributors](https://github.com/VundleVim/Vundle.vim/graphs/contributors) *Thank you!* @@ -139,10 +139,10 @@ see [Vundle contributors](https://github.com/gmarik/Vundle.vim/graphs/contributo * search by description as well * make it rock! -[Vundle]:http://github.com/gmarik/Vundle.vim -[Windows setup]:https://github.com/gmarik/Vundle.vim/wiki/Vundle-for-Windows -[FAQ]:https://github.com/gmarik/Vundle.vim/wiki -[Tips]:https://github.com/gmarik/Vundle.vim/wiki/Tips-and-Tricks +[Vundle]:http://github.com/VundleVim/Vundle.vim +[Windows setup]:https://github.com/VundleVim/Vundle.vim/wiki/Vundle-for-Windows +[FAQ]:https://github.com/VundleVim/Vundle.vim/wiki +[Tips]:https://github.com/VundleVim/Vundle.vim/wiki/Tips-and-Tricks [Vim]:http://www.vim.org [Git]:http://git-scm.com [`git clone`]:http://gitref.org/creating/#clone @@ -151,10 +151,10 @@ see [Vundle contributors](https://github.com/gmarik/Vundle.vim/graphs/contributo [help tags]:http://vimdoc.sourceforge.net/htmldoc/helphelp.html#:helptags [runtime path]:http://vimdoc.sourceforge.net/htmldoc/options.html#%27runtimepath%27 -[configure]:https://github.com/gmarik/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L126-L233 -[install]:https://github.com/gmarik/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L234-L254 -[update]:https://github.com/gmarik/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L255-L265 -[search]:https://github.com/gmarik/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L266-L295 -[clean]:https://github.com/gmarik/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L303-L318 -[interactive mode]:https://github.com/gmarik/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L319-L360 -[interface change]:https://github.com/gmarik/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L372-L396 +[configure]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L126-L233 +[install]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L234-L254 +[update]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L255-L265 +[search]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L266-L295 +[clean]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L303-L318 +[interactive mode]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L319-L360 +[interface change]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L372-L396 From fb9dff181eb30246d7218c29f5cd35079f3b7212 Mon Sep 17 00:00:00 2001 From: Nate Fischer Date: Fri, 10 Jul 2015 11:46:08 -0700 Subject: [PATCH 61/72] Vundle log, changelog, and scripts-view are no longer modifiable and the buffers will not persist after they're closed. --- autoload/vundle/scripts.vim | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/autoload/vundle/scripts.vim b/autoload/vundle/scripts.vim index 5d56476..6a72998 100644 --- a/autoload/vundle/scripts.vim +++ b/autoload/vundle/scripts.vim @@ -63,6 +63,10 @@ func! s:view_log() endif call writefile(g:vundle#log, s:log_file) execute 'silent pedit ' . s:log_file + set bufhidden=wipe + setl buftype=nofile + setl noswapfile + setl ro noma wincmd P | wincmd H endf @@ -116,6 +120,10 @@ func! s:view_changelog() endif call writefile(s:create_changelog(), s:changelog_file) execute 'silent pedit' s:changelog_file + set bufhidden=wipe + setl buftype=nofile + setl noswapfile + setl ro noma wincmd P | wincmd H endf @@ -160,6 +168,7 @@ func! vundle#scripts#view(title, headers, results) setl buftype=nofile setl noswapfile + set bufhidden=wipe setl cursorline setl nonu ro noma From 11fdc428fe741f4f6974624ad76ab7c2b503b73e Mon Sep 17 00:00:00 2001 From: Nate Fischer Date: Mon, 28 Sep 2015 15:48:59 -0700 Subject: [PATCH 62/72] Update repository references throughout documentation. Also, fixed an incorrect URL and updated references to ':Bundle' commands to ':Plugin' commands --- CONTRIBUTING.md | 14 +++++++------- autoload/vundle.vim | 4 ++-- doc/vundle.txt | 10 +++++----- test/minirc.vim | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2162ffc..ec31f8f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,15 +14,15 @@ Issues Before submitting an issue, be sure to check the following places for answers. -1. Vundle docs at [`:h vundle`](https://github.com/gmarik/Vundle.vim/blob/master/doc/vundle.txt). +1. Vundle docs at [`:h vundle`](https://github.com/VundleVim/Vundle.vim/blob/master/doc/vundle.txt). -2. The [FAQ](https://github.com/gmarik/Vundle.vim/search). +2. The [FAQ](https://github.com/VundleVim/Vundle.vim/wiki). -3. [Search](https://github.com/gmarik/Vundle.vim/search) the repository for related issues. +3. [Search](https://github.com/VundleVim/Vundle.vim/search) the repository for related issues. ## Try To Eliminate Your Vimrc -In order to make sure it isn't just `.vimrc` replace your own config file with the [minimal vimrc](https://github.com/gmarik/Vundle.vim/blob/master/test/minirc.vim). Clear out bundles and then try to reproduce. +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. 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. @@ -46,7 +46,7 @@ To better respond to issues please follow these general guidelines when explaini I am using Vim on Kubuntu 13.04 64 bit and I get the following error... (add further explanation here) -To reproduce the bug, use the vimrc file below and run `:BundleInstall`... (continue with steps) +To reproduce the bug, use the vimrc file below and run `:PluginInstall`... (continue with steps) Vimrc: ``` @@ -55,8 +55,8 @@ syntax on filetype off set rtp+=~/.vim/bundle/Vundle.vim/ call vundle#rc() -Bundle 'gmarik/Vundle.vim' -Bundle 'relevant/plugin' +Plugin 'VundleVim/Vundle.vim' +Plugin 'relevant/plugin' filetype plugin indent on .... more user configs here... diff --git a/autoload/vundle.vim b/autoload/vundle.vim index e458618..148ff3e 100644 --- a/autoload/vundle.vim +++ b/autoload/vundle.vim @@ -1,7 +1,7 @@ " Vundle is a shortcut for Vim Bundle and Is a simple plugin manager for Vim " Author: gmarik -" HomePage: http://github.com/gmarik/Vundle.vim -" Readme: http://github.com/gmarik/Vundle.vim/blob/master/README.md +" HomePage: http://github.com/VundleVim/Vundle.vim +" Readme: http://github.com/VundleVim/Vundle.vim/blob/master/README.md " Version: 0.10.2 " Plugin Commands diff --git a/doc/vundle.txt b/doc/vundle.txt index 9a2670a..81a5f66 100644 --- a/doc/vundle.txt +++ b/doc/vundle.txt @@ -54,15 +54,15 @@ more information. *vundle-windows* If you are using Windows, see instructions on the Wiki - https://github.com/gmarik/Vundle.vim/wiki/Vundle-for-Windows. + https://github.com/VundleVim/Vundle.vim/wiki/Vundle-for-Windows. *vundle-faq* If you run into any issues, please consult the FAQ at - https://github.com/gmarik/Vundle.vim/wiki + https://github.com/VundleVim/Vundle.vim/wiki 2. Setup Vundle: > - git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim + git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim < 3. Configure bundles: @@ -79,7 +79,7 @@ more information. "call vundle#begin('~/some/path/here') " let Vundle manage Vundle, required - Plugin 'gmarik/Vundle.vim' + Plugin 'VundleVim/Vundle.vim' " The following are examples of different formats supported. " Keep Plugin commands between vundle#begin/end. @@ -208,7 +208,7 @@ GitHub ------ GitHub is used when a user/repo is passed to `Plugin`. > - Plugin 'gmarik/Vundle.vim' => https://github.com/gmarik/Vundle.vim + Plugin 'VundleVim/Vundle.vim' => https://github.com/VundleVim/Vundle.vim Vim Scripts ----------- diff --git a/test/minirc.vim b/test/minirc.vim index 7b48d13..f4ece70 100644 --- a/test/minirc.vim +++ b/test/minirc.vim @@ -3,7 +3,7 @@ syntax on filetype off set rtp+=~/.vim/bundle/Vundle.vim/ call vundle#begin() -Plugin 'gmarik/Vundle.vim' +Plugin 'VundleVim/Vundle.vim' call vundle#end() filetype plugin indent on From 0d330dbeedeeea1a67ba4fa344e5de174e1d1cc1 Mon Sep 17 00:00:00 2001 From: Chip Hogg Date: Thu, 6 Aug 2015 14:53:04 -0400 Subject: [PATCH 63/72] Add 'vundlelog' filetype + settings/highlighting --- autoload/vundle/scripts.vim | 1 + ftplugin/vundlelog.vim | 15 +++++++++++++++ syntax/vundlelog.vim | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 ftplugin/vundlelog.vim create mode 100644 syntax/vundlelog.vim diff --git a/autoload/vundle/scripts.vim b/autoload/vundle/scripts.vim index 6a72998..8da0622 100644 --- a/autoload/vundle/scripts.vim +++ b/autoload/vundle/scripts.vim @@ -124,6 +124,7 @@ func! s:view_changelog() setl buftype=nofile setl noswapfile setl ro noma + setfiletype vundlelog wincmd P | wincmd H endf diff --git a/ftplugin/vundlelog.vim b/ftplugin/vundlelog.vim new file mode 100644 index 0000000..0f338eb --- /dev/null +++ b/ftplugin/vundlelog.vim @@ -0,0 +1,15 @@ +" --------------------------------------------------------------------------- +" Standard ftplugin boilerplate; see ':help ftplugin'. +" --------------------------------------------------------------------------- +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + + +" --------------------------------------------------------------------------- +" Settings for the Vundle update log buffer. +" --------------------------------------------------------------------------- +setlocal textwidth=0 +setlocal nowrap +setlocal noswapfile diff --git a/syntax/vundlelog.vim b/syntax/vundlelog.vim new file mode 100644 index 0000000..64e81e3 --- /dev/null +++ b/syntax/vundlelog.vim @@ -0,0 +1,36 @@ +" --------------------------------------------------------------------------- +" Syntax highlighting for the line which identifies the plugin. +" --------------------------------------------------------------------------- +syntax match VundlePluginName '\v(^Updated Plugin: )@<=.*$' +highlight link VundlePluginName Keyword + +" --------------------------------------------------------------------------- +" Syntax highlighting for the 'compare at' line of each plugin. +" --------------------------------------------------------------------------- +syntax region VundleCompareLine start='\v^Compare at: https:' end='\v\n' + \ contains=VundleCompareUrl +syntax match VundleCompareUrl '\vhttps:\S+' +highlight link VundleCompareLine Comment +highlight link VundleCompareUrl Underlined + +" --------------------------------------------------------------------------- +" Syntax highlighting for individual commits. +" --------------------------------------------------------------------------- +" The main commit line. +" Note that this regex is intimately related to the one for VundleCommitTree, +" and the two should be changed in sync. +syntax match VundleCommitLine '\v(^ [|*]( *[\\|/\*])* )@<=[^*|].*$' + \ contains=VundleCommitMerge,VundleCommitUser,VundleCommitTime +highlight link VundleCommitLine String +" Sub-regions inside the commit message. +syntax match VundleCommitMerge '\v Merge pull request #\d+.*' +syntax match VundleCommitUser '\v( )@<=\S+( \S+)*(, \d+ \w+ ago$)@=' +syntax match VundleCommitTime '\v(, )@<=\d+ \w+ ago$' +highlight link VundleCommitMerge Ignore +highlight link VundleCommitUser Identifier +highlight link VundleCommitTime Comment +" The git history DAG markers are outside of the main commit line region. +" Note that this regex is intimately related to the one for VundleCommitLine, +" and the two should be changed in sync. +syntax match VundleCommitTree '\v(^ )@<=[|*]( *[\\|/\*])*' +highlight link VundleCommitTree Label From 670efe2dbb9d51062235e1588689fd6cafe442b0 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Mon, 26 Oct 2015 16:59:56 +0800 Subject: [PATCH 64/72] readme_zh_ch --- README_ZH_CN.md | 160 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 160 insertions(+) create mode 100644 README_ZH_CN.md diff --git a/README_ZH_CN.md b/README_ZH_CN.md new file mode 100644 index 0000000..ba75a9f --- /dev/null +++ b/README_ZH_CN.md @@ -0,0 +1,160 @@ +## [Help Maintain Vundle](https://github.com/VundleVim/Vundle.vim/issues/383) + +## 关于 + +[Vundle] 是 _Vim bundle_ 的简称,是一个 [Vim] 插件管理器. + +[Vundle] 允许你做... + +* 同时在`.vimrc`中跟踪和[管理](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L126-L233)插件 +* [安装](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L234-L254)特定格式的插件(a.k.a. scripts/bundle) +* [更新](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L255-L265)特定格式插件 +* 通过插件名称[搜索](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L266-L295)[Vim scripts](http://vim-scripts.org/vim/scripts.html)中的插件 +* [清理](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L303-L318)未使用的插件 +* 可以通过*单一按键*完成以上操作,详见[interactive mode](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L319-L360) + +[Vundle] 自动完成... + +* 管理已安装插件的[runtime path](http://vimdoc.sourceforge.net/htmldoc/options.html#%27runtimepath%27) +* 安装和更新后,重新生成[帮助标签](http://vimdoc.sourceforge.net/htmldoc/helphelp.html#:helptags) + +[Vundle] 正在经历一个 [interface change], 请通过以下方式获取最新信息. + +[![Gitter-chat](https://badges.gitter.im/VundleVim/Vundle.vim.svg)](https://gitter.im/VundleVim/Vundle.vim) : 讨论和技术支持. + +![Vundle-installer](http://i.imgur.com/Rueh7Cc.png) + +## Quick Start + +1. Introduction: + + Installation requires [Git] and triggers [`git clone`] for each configured repository to `~/.vim/bundle/` by default. + Curl is required for search. + + If you are using Windows, go directly to [Windows setup]. If you run into any issues, please consult the [FAQ]. + See [Tips] for some advanced configurations. + + Using non-POSIX shells, such as the popular Fish shell, requires additional setup. Please check the [FAQ]. + +2. Set up [Vundle]: + + `$ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim` + +3. Configure Plugins: + + Put this at the top of your `.vimrc` to use Vundle. Remove plugins you don't need, they are for illustration purposes. + + ```vim + set nocompatible " be iMproved, required + filetype off " required + + " set the runtime path to include Vundle and initialize + set rtp+=~/.vim/bundle/Vundle.vim + call vundle#begin() + " alternatively, pass a path where Vundle should install plugins + "call vundle#begin('~/some/path/here') + + " let Vundle manage Vundle, required + Plugin 'VundleVim/Vundle.vim' + + " The following are examples of different formats supported. + " Keep Plugin commands between vundle#begin/end. + " plugin on GitHub repo + Plugin 'tpope/vim-fugitive' + " plugin from http://vim-scripts.org/vim/scripts.html + Plugin 'L9' + " Git plugin not hosted on GitHub + Plugin 'git://git.wincent.com/command-t.git' + " git repos on your local machine (i.e. when working on your own plugin) + Plugin 'file:///home/gmarik/path/to/plugin' + " The sparkup vim script is in a subdirectory of this repo called vim. + " Pass the path to set the runtimepath properly. + Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} + " Avoid a name conflict with L9 + Plugin 'user/L9', {'name': 'newL9'} + + " All of your Plugins must be added before the following line + call vundle#end() " required + filetype plugin indent on " required + " To ignore plugin indent changes, instead use: + "filetype plugin on + " + " Brief help + " :PluginList - lists configured plugins + " :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate + " :PluginSearch foo - searches for foo; append `!` to refresh local cache + " :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal + " + " see :h vundle for more details or wiki for FAQ + " Put your non-Plugin stuff after this line + ``` + +4. Install Plugins: + + Launch `vim` and run `:PluginInstall` + + To install from command line: `vim +PluginInstall +qall` + +## Docs + +See the [`:h vundle`](https://github.com/VundleVim/Vundle.vim/blob/master/doc/vundle.txt) Vimdoc for more details. + +## Changelog + +See the [changelog](https://github.com/VundleVim/Vundle.vim/blob/master/changelog.md). + +## People Using Vundle + +see [Examples](https://github.com/VundleVim/Vundle.vim/wiki/Examples) + +## Contributors + +see [Vundle contributors](https://github.com/VundleVim/Vundle.vim/graphs/contributors) + +*Thank you!* + +## Inspiration & Ideas + +* [pathogen.vim](http://github.com/tpope/vim-pathogen/) +* [Bundler](https://github.com/bundler/bundler) +* [Scott Bronson](http://github.com/bronson) + +## Also + +* Vundle was developed and tested with [Vim] 7.3 on OS X, Linux and Windows +* Vundle tries to be as [KISS](http://en.wikipedia.org/wiki/KISS_principle) as possible + +## TODO: +[Vundle] is a work in progress, so any ideas and patches are appreciated. + +* ✓ activate newly added bundles on `.vimrc` reload or after `:PluginInstall` +* ✓ use preview window for search results +* ✓ Vim documentation +* ✓ put Vundle in `bundles/` too (will fix Vundle help) +* ✓ tests +* ✓ improve error handling +* allow specifying revision/version? +* handle dependencies +* show description in search results +* search by description as well +* make it rock! + +[Vundle]:http://github.com/VundleVim/Vundle.vim +[Windows setup]:https://github.com/VundleVim/Vundle.vim/wiki/Vundle-for-Windows +[FAQ]:https://github.com/VundleVim/Vundle.vim/wiki +[Tips]:https://github.com/VundleVim/Vundle.vim/wiki/Tips-and-Tricks +[Vim]:http://www.vim.org +[Git]:http://git-scm.com +[`git clone`]:http://gitref.org/creating/#clone + +[Vim scripts]:http://vim-scripts.org/vim/scripts.html +[help tags]:http://vimdoc.sourceforge.net/htmldoc/helphelp.html#:helptags +[runtime path]:http://vimdoc.sourceforge.net/htmldoc/options.html#%27runtimepath%27 + +[configure]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L126-L233 +[install]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L234-L254 +[update]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L255-L265 +[search]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L266-L295 +[clean]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L303-L318 +[interactive mode]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L319-L360 +[interface change]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L372-L396 From b421bce931edbeb0239c5df66502e0538eb545ca Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Mon, 26 Oct 2015 18:29:07 +0800 Subject: [PATCH 65/72] readme_zh_ch --- README_ZH_CN.md | 118 ++++++++++++++++++++++++------------------------ 1 file changed, 60 insertions(+), 58 deletions(-) diff --git a/README_ZH_CN.md b/README_ZH_CN.md index ba75a9f..8280875 100644 --- a/README_ZH_CN.md +++ b/README_ZH_CN.md @@ -1,4 +1,4 @@ -## [Help Maintain Vundle](https://github.com/VundleVim/Vundle.vim/issues/383) +## [帮助维护Vundle](https://github.com/VundleVim/Vundle.vim/issues/383) ## 关于 @@ -20,119 +20,121 @@ [Vundle] 正在经历一个 [interface change], 请通过以下方式获取最新信息. -[![Gitter-chat](https://badges.gitter.im/VundleVim/Vundle.vim.svg)](https://gitter.im/VundleVim/Vundle.vim) : 讨论和技术支持. +讨论和技术支持:[![Gitter-chat](https://badges.gitter.im/VundleVim/Vundle.vim.svg)](https://gitter.im/VundleVim/Vundle.vim) ![Vundle-installer](http://i.imgur.com/Rueh7Cc.png) -## Quick Start +## 快速开始 -1. Introduction: +1. 介绍: - Installation requires [Git] and triggers [`git clone`] for each configured repository to `~/.vim/bundle/` by default. - Curl is required for search. + 安装需要[Git](http://git-scm.com/),触发[`git clone`](http://gitref.org/creating/#clone),默认将每一个指定特定格式插件的仓库复制到`~/.vim/bundle/`. + 搜索需要Curl支持. - If you are using Windows, go directly to [Windows setup]. If you run into any issues, please consult the [FAQ]. - See [Tips] for some advanced configurations. + Windows用户请直接访问[Windows setup]. 如果有任何问题, 请参考 [FAQ]. + 查看 [Tips] 获取相关高级配置. - Using non-POSIX shells, such as the popular Fish shell, requires additional setup. Please check the [FAQ]. + 使用 non-POSIX shells, 比如比较流行对 Fish shell, 需要额外对步骤. 请查看 [FAQ]. -2. Set up [Vundle]: +2. 初始安装 [Vundle]: `$ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim` -3. Configure Plugins: +3. 配置插件 : - Put this at the top of your `.vimrc` to use Vundle. Remove plugins you don't need, they are for illustration purposes. + 请将以下加在 `.vimrc` 方可使用Vundle. 删掉你不需要的插件, 这些只是用做示例. ```vim - set nocompatible " be iMproved, required - filetype off " required + set nocompatible " 去除VI一致性,必须 + filetype off " 必须 - " set the runtime path to include Vundle and initialize + " 设置包括vundle和初始化相关的runtime path set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() - " alternatively, pass a path where Vundle should install plugins + " 另一种选择, 指定一个vundle安装插件的路径 "call vundle#begin('~/some/path/here') - " let Vundle manage Vundle, required + " 让vundle管理插件版本,必须 Plugin 'VundleVim/Vundle.vim' - " The following are examples of different formats supported. - " Keep Plugin commands between vundle#begin/end. - " plugin on GitHub repo + " 以下范例用来支持不同格式的插件安装. + " 请将安装插的命令放在vundle#begin和vundle#end之间. + " Github上的插件 + " 格式为 Plugin '用户名/插件仓库名' Plugin 'tpope/vim-fugitive' - " plugin from http://vim-scripts.org/vim/scripts.html + " 来自 http://vim-scripts.org/vim/scripts.html 的插件 + " Plugin '插件名称' 实际上是 Plugin 'vim-scripts/插件仓库名' 只是此处的用户名可以省略 Plugin 'L9' - " Git plugin not hosted on GitHub + " 由Git支持但不再github上的插件仓库 Plugin 'git clone 后面的地址' Plugin 'git://git.wincent.com/command-t.git' - " git repos on your local machine (i.e. when working on your own plugin) + " 本地的Git仓库(例如自己的插件) Plugin 'file:///+本地插件仓库绝对路径' Plugin 'file:///home/gmarik/path/to/plugin' - " The sparkup vim script is in a subdirectory of this repo called vim. - " Pass the path to set the runtimepath properly. + " 插件在仓库的子目录中. + " 正确指定路径用以设置runtimepath. 以下范例插件在sparkup/vim目录下 Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} - " Avoid a name conflict with L9 + " 避免插件名冲突,例如L9已存在,则可以指定 Plugin 'user/L9', {'name': 'newL9'} - " All of your Plugins must be added before the following line - call vundle#end() " required - filetype plugin indent on " required - " To ignore plugin indent changes, instead use: + " 你的所有插件需要在下面这行之前 + call vundle#end() " 必须 + filetype plugin indent on " 必须 加载vim自带和插件相应的语法和文件类型相关脚本 + " 忽视插件改变缩进,可以使用以下替代: "filetype plugin on " - " Brief help - " :PluginList - lists configured plugins - " :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate - " :PluginSearch foo - searches for foo; append `!` to refresh local cache - " :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal + " 简要帮助文档 + " :PluginList - 列出所有已配置的插件 + " :PluginInstall - 安装插件,追加 `!` 用以更新或使用 :PluginUpdate + " :PluginSearch foo - 搜索 foo ; 追加 `!` 清除本地缓存 + " :PluginClean - 清除未使用插件,需要确认; 追加 `!` 自动批准移除未使用插件 " - " see :h vundle for more details or wiki for FAQ - " Put your non-Plugin stuff after this line + " 查阅 :h vundle 获取更多细节和wiki以及FAQ + " 将你自己对非插件片段放在这行之后 ``` -4. Install Plugins: +4. 安装插件: - Launch `vim` and run `:PluginInstall` + 运行 `vim` 再运行 `:PluginInstall` - To install from command line: `vim +PluginInstall +qall` + 通过命令行直接安装 `vim +PluginInstall +qall` ## Docs -See the [`:h vundle`](https://github.com/VundleVim/Vundle.vim/blob/master/doc/vundle.txt) Vimdoc for more details. +查阅 [`:h vundle`](https://github.com/VundleVim/Vundle.vim/blob/master/doc/vundle.txt) Vimdoc 以获取更多细节. -## Changelog +## 更新日志 -See the [changelog](https://github.com/VundleVim/Vundle.vim/blob/master/changelog.md). +查阅 [changelog](https://github.com/VundleVim/Vundle.vim/blob/master/changelog.md). -## People Using Vundle +## 在使用此插件的用户的VIMRC -see [Examples](https://github.com/VundleVim/Vundle.vim/wiki/Examples) +查阅 [Examples](https://github.com/VundleVim/Vundle.vim/wiki/Examples) -## Contributors +## 维护者 -see [Vundle contributors](https://github.com/VundleVim/Vundle.vim/graphs/contributors) +查阅 [Vundle contributors](https://github.com/VundleVim/Vundle.vim/graphs/contributors) -*Thank you!* +*感谢!* -## Inspiration & Ideas +## 灵感 & 思路 * [pathogen.vim](http://github.com/tpope/vim-pathogen/) * [Bundler](https://github.com/bundler/bundler) * [Scott Bronson](http://github.com/bronson) -## Also +## 另外 -* Vundle was developed and tested with [Vim] 7.3 on OS X, Linux and Windows -* Vundle tries to be as [KISS](http://en.wikipedia.org/wiki/KISS_principle) as possible +* Vundle 已测试环境为: [Vim] 7.3 on OS X, Linux and Windows +* Vundle 尝试尽可能保持至简模式 [KISS](http://en.wikipedia.org/wiki/KISS_principle) ## TODO: -[Vundle] is a work in progress, so any ideas and patches are appreciated. +[Vundle] 是一个正在进步对项目, 所以很多设计思路和补丁是需要借鉴的. -* ✓ activate newly added bundles on `.vimrc` reload or after `:PluginInstall` -* ✓ use preview window for search results +* ✓ 在重新载入或者执行`:PluginInstall`之后激活`.vimrc`中新添加的插件 +* ✓ 使用预览窗口显示搜索结果 * ✓ Vim documentation -* ✓ put Vundle in `bundles/` too (will fix Vundle help) -* ✓ tests -* ✓ improve error handling +* ✓ 同时将Vundle 放置在 `bundles/` 中 (将修复 Vundle 帮助) +* ✓ 测试 +* ✓ 提升错误处理能力 * allow specifying revision/version? * handle dependencies * show description in search results From 232cb927171bab08046739e73c5c167ee8b1e1eb Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Tue, 27 Oct 2015 19:29:26 +0800 Subject: [PATCH 66/72] finished readme --- README_ZH_CN.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README_ZH_CN.md b/README_ZH_CN.md index 8280875..61ffb00 100644 --- a/README_ZH_CN.md +++ b/README_ZH_CN.md @@ -135,11 +135,11 @@ * ✓ 同时将Vundle 放置在 `bundles/` 中 (将修复 Vundle 帮助) * ✓ 测试 * ✓ 提升错误处理能力 -* allow specifying revision/version? -* handle dependencies -* show description in search results -* search by description as well -* make it rock! +* 支持手动指定版本(待考虑) +* 版本依赖 +* 搜索结果中显示描述 +* 同时支持通过描述搜索 +* 使其更加稳定! [Vundle]:http://github.com/VundleVim/Vundle.vim [Windows setup]:https://github.com/VundleVim/Vundle.vim/wiki/Vundle-for-Windows From b2d0e5b162a9cb86b33bde97f8478373b604ff1d Mon Sep 17 00:00:00 2001 From: Nate Fischer Date: Mon, 2 Nov 2015 19:08:34 -0800 Subject: [PATCH 67/72] Setting Vundle key mappings to be silent. --- autoload/vundle/scripts.vim | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/autoload/vundle/scripts.vim b/autoload/vundle/scripts.vim index 6a72998..fb548bb 100644 --- a/autoload/vundle/scripts.vim +++ b/autoload/vundle/scripts.vim @@ -196,25 +196,25 @@ func! vundle#scripts#view(title, headers, results) com! -buffer -nargs=0 VundleChangelog call s:view_changelog() - nnoremap q :silent bd! - nnoremap D :exec 'Delete'.getline('.') + nnoremap q :silent bd! + nnoremap D :exec 'Delete'.getline('.') - nnoremap add :exec 'Install'.getline('.') - nnoremap add! :exec 'Install'.substitute(getline('.'), '^Plugin ', 'Plugin! ', '') + nnoremap add :exec 'Install'.getline('.') + nnoremap add! :exec 'Install'.substitute(getline('.'), '^Plugin ', 'Plugin! ', '') - nnoremap i :exec 'InstallAndRequire'.getline('.') - nnoremap I :exec 'InstallAndRequire'.substitute(getline('.'), '^Plugin ', 'Plugin! ', '') + nnoremap i :exec 'InstallAndRequire'.getline('.') + nnoremap I :exec 'InstallAndRequire'.substitute(getline('.'), '^Plugin ', 'Plugin! ', '') - nnoremap l :VundleLog - nnoremap u :VundleChangelog - nnoremap h :h vundle - nnoremap ? :norm h + nnoremap l :VundleLog + nnoremap u :VundleChangelog + nnoremap h :h vundle + nnoremap ? :h vundle - nnoremap c :PluginClean - nnoremap C :PluginClean! + nnoremap c :PluginClean + nnoremap C :PluginClean! nnoremap s :PluginSearch - nnoremap R :call vundle#scripts#reload() + nnoremap R :call vundle#scripts#reload() " goto first line after headers exec ':'.(len(a:headers) + 1) From 52f34431014addefd6b7875b37a520b83095564a Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Sat, 30 Jan 2016 09:24:05 +0800 Subject: [PATCH 68/72] Update example in readme --- README.md | 5 +++-- README_ZH_CN.md | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index defb752..27adba2 100644 --- a/README.md +++ b/README.md @@ -70,8 +70,9 @@ " The sparkup vim script is in a subdirectory of this repo called vim. " Pass the path to set the runtimepath properly. Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} - " Avoid a name conflict with L9 - Plugin 'user/L9', {'name': 'newL9'} + " Install L9 and avoid a Naming conflict if you've already installed a + " different version somewhere else. + Plugin 'ascenator/L9', {'name': 'newL9'} " All of your Plugins must be added before the following line call vundle#end() " required diff --git a/README_ZH_CN.md b/README_ZH_CN.md index 61ffb00..c393fbf 100644 --- a/README_ZH_CN.md +++ b/README_ZH_CN.md @@ -72,8 +72,8 @@ " 插件在仓库的子目录中. " 正确指定路径用以设置runtimepath. 以下范例插件在sparkup/vim目录下 Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} - " 避免插件名冲突,例如L9已存在,则可以指定 - Plugin 'user/L9', {'name': 'newL9'} + " 安装L9,如果已经安装过这个插件,可利用以下格式避免命名冲突 + Plugin 'ascenator/L9', {'name': 'newL9'} " 你的所有插件需要在下面这行之前 call vundle#end() " 必须 From a30caf734a338e1388a9c13b31dd4667913eb7db Mon Sep 17 00:00:00 2001 From: Vincent Tam Date: Sun, 21 Feb 2016 20:50:37 +0800 Subject: [PATCH 69/72] A traditional Chinese version of the README This is done based on the simplified Chinese version at commit 232cb92. Traditional Chinese is used by people in Taiwan, Hong Kong and Macao. --- README_ZH_TW.md | 162 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 162 insertions(+) create mode 100644 README_ZH_TW.md diff --git a/README_ZH_TW.md b/README_ZH_TW.md new file mode 100644 index 0000000..3bd85d2 --- /dev/null +++ b/README_ZH_TW.md @@ -0,0 +1,162 @@ +## [幫助維護Vundle](https://github.com/VundleVim/Vundle.vim/issues/383) + +## 關於 + +[Vundle] 是 _Vim bundle_ 的簡稱,是一個 [Vim] 插件管理器. + +[Vundle] 允許你做... + +* 同時在`.vimrc`中跟蹤和[管理](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L126-L233)插件 +* [安裝](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L234-L254)特定格式的插件(a.k.a. scripts/bundle) +* [更新](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L255-L265)特定格式插件 +* 通過插件名稱[搜索](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L266-L295)[Vim scripts](http://vim-scripts.org/vim/scripts.html)中的插件 +* [清理](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L303-L318)未使用的插件 +* 可以通過*單一按鍵*完成以上操作,詳見[interactive mode](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L319-L360) + +[Vundle] 自動完成... + +* 管理已安裝插件的[runtime path](http://vimdoc.sourceforge.net/htmldoc/options.html#%27runtimepath%27) +* 安裝和更新後,重新生成[幫助標簽](http://vimdoc.sourceforge.net/htmldoc/helphelp.html#:helptags) + +[Vundle] 正在經歷一個 [interface change], 請通過以下方式獲取最新信息. + +討論和技術支持:[![Gitter-chat](https://badges.gitter.im/VundleVim/Vundle.vim.svg)](https://gitter.im/VundleVim/Vundle.vim) + +![Vundle-installer](http://i.imgur.com/Rueh7Cc.png) + +## 快速開始 + +1. 介紹: + + 安裝需要[Git](http://git-scm.com/),觸發[`git clone`](http://gitref.org/creating/#clone),默認將每一個指定特定格式插件的倉庫復制到`~/.vim/bundle/`. + 搜索需要Curl支持. + + Windows用戶請直接訪問[Windows setup]. 如果有任何問題, 請參考 [FAQ]. + 查看 [Tips] 獲取相關高級配置. + + 使用 non-POSIX shells, 比如比較流行對 Fish shell, 需要額外對步驟. 請查看 [FAQ]. + +2. 初始安裝 [Vundle]: + + `$ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim` + +3. 配置插件 : + + 請將以下加在 `.vimrc` 方可使用Vundle. 刪掉你不需要的插件, 這些只是用做示例. + + ```vim + set nocompatible " 去除VI一致性,必須 + filetype off " 必須 + + " 設置包括vundle和初始化相關的runtime path + set rtp+=~/.vim/bundle/Vundle.vim + call vundle#begin() + " 另一種選擇, 指定一個vundle安裝插件的路徑 + "call vundle#begin('~/some/path/here') + + " 讓vundle管理插件版本,必須 + Plugin 'VundleVim/Vundle.vim' + + " 以下範例用來支持不同格式的插件安裝. + " 請將安裝插的命令放在vundle#begin和vundle#end之間. + " Github上的插件 + " 格式為 Plugin '用戶名/插件倉庫名' + Plugin 'tpope/vim-fugitive' + " 來自 http://vim-scripts.org/vim/scripts.html 的插件 + " Plugin '插件名稱' 實際上是 Plugin 'vim-scripts/插件倉庫名' 只是此處的用戶名可以省略 + Plugin 'L9' + " 由Git支持但不再github上的插件倉庫 Plugin 'git clone 後面的地址' + Plugin 'git://git.wincent.com/command-t.git' + " 本地的Git倉庫(例如自己的插件) Plugin 'file:///+本地插件倉庫絕對路徑' + Plugin 'file:///home/gmarik/path/to/plugin' + " 插件在倉庫的子目錄中. + " 正確指定路徑用以設置runtimepath. 以下範例插件在sparkup/vim目錄下 + Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} + " 避免插件名沖突,例如L9已存在,則可以指定 + Plugin 'user/L9', {'name': 'newL9'} + + " 你的所有插件需要在下面這行之前 + call vundle#end() " 必須 + filetype plugin indent on " 必須 加載vim自帶和插件相應的語法和文件類型相關腳本 + " 忽視插件改變縮進,可以使用以下替代: + "filetype plugin on + " + " 簡要幫助文檔 + " :PluginList - 列出所有已配置的插件 + " :PluginInstall - 安裝插件,追加 `!` 用以更新或使用 :PluginUpdate + " :PluginSearch foo - 搜索 foo ; 追加 `!` 清除本地緩存 + " :PluginClean - 清除未使用插件,需要確認; 追加 `!` 自動批准移除未使用插件 + " + " 查閱 :h vundle 獲取更多細節和wiki以及FAQ + " 將你自己對非插件片段放在這行之後 + ``` + +4. 安裝插件: + + 運行 `vim` 再運行 `:PluginInstall` + + 通過命令行直接安裝 `vim +PluginInstall +qall` + +## Docs + +查閱 [`:h vundle`](https://github.com/VundleVim/Vundle.vim/blob/master/doc/vundle.txt) Vimdoc 以獲取更多細節. + +## 更新日志 + +查閱 [changelog](https://github.com/VundleVim/Vundle.vim/blob/master/changelog.md). + +## 在使用此插件的用戶的VIMRC + +查閱 [Examples](https://github.com/VundleVim/Vundle.vim/wiki/Examples) + +## 維護者 + +查閱 [Vundle contributors](https://github.com/VundleVim/Vundle.vim/graphs/contributors) + +*感謝!* + +## 靈感 & 思路 + +* [pathogen.vim](http://github.com/tpope/vim-pathogen/) +* [Bundler](https://github.com/bundler/bundler) +* [Scott Bronson](http://github.com/bronson) + +## 另外 + +* Vundle 已測試環境為: [Vim] 7.3 on OS X, Linux and Windows +* Vundle 嘗試盡可能保持至簡模式 [KISS](http://en.wikipedia.org/wiki/KISS_principle) + +## TODO: +[Vundle] 是一個正在進步對項目, 所以很多設計思路和補丁是需要借鑒的. + +* ✓ 在重新載入或者執行`:PluginInstall`之後激活`.vimrc`中新添加的插件 +* ✓ 使用預覽窗口顯示搜索結果 +* ✓ Vim documentation +* ✓ 同時將Vundle 放置在 `bundles/` 中 (將修復 Vundle 幫助) +* ✓ 測試 +* ✓ 提升錯誤處理能力 +* 支持手動指定版本(待考慮) +* 版本依賴 +* 搜索結果中顯示描述 +* 同時支持通過描述搜索 +* 使其更加穩定! + +[Vundle]:http://github.com/VundleVim/Vundle.vim +[Windows setup]:https://github.com/VundleVim/Vundle.vim/wiki/Vundle-for-Windows +[FAQ]:https://github.com/VundleVim/Vundle.vim/wiki +[Tips]:https://github.com/VundleVim/Vundle.vim/wiki/Tips-and-Tricks +[Vim]:http://www.vim.org +[Git]:http://git-scm.com +[`git clone`]:http://gitref.org/creating/#clone + +[Vim scripts]:http://vim-scripts.org/vim/scripts.html +[help tags]:http://vimdoc.sourceforge.net/htmldoc/helphelp.html#:helptags +[runtime path]:http://vimdoc.sourceforge.net/htmldoc/options.html#%27runtimepath%27 + +[configure]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L126-L233 +[install]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L234-L254 +[update]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L255-L265 +[search]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L266-L295 +[clean]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L303-L318 +[interactive mode]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L319-L360 +[interface change]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L372-L396 From 96bb8e5cc561d4d516619e6a3c975768d413516a Mon Sep 17 00:00:00 2001 From: Vincent Tam Date: Sun, 21 Feb 2016 20:54:42 +0800 Subject: [PATCH 70/72] Corrected a missing word --- README_ZH_TW.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_ZH_TW.md b/README_ZH_TW.md index 3bd85d2..6ae18ff 100644 --- a/README_ZH_TW.md +++ b/README_ZH_TW.md @@ -101,7 +101,7 @@ 查閱 [`:h vundle`](https://github.com/VundleVim/Vundle.vim/blob/master/doc/vundle.txt) Vimdoc 以獲取更多細節. -## 更新日志 +## 更新日誌 查閱 [changelog](https://github.com/VundleVim/Vundle.vim/blob/master/changelog.md). From 6a3469c4ca0fb186a28b0f0e58a4ecf6eaed819a Mon Sep 17 00:00:00 2001 From: Vincent Tam Date: Tue, 23 Feb 2016 00:42:51 +0800 Subject: [PATCH 71/72] Removed BOM and CR They are added by Notepad on M$ Windows. --- README_ZH_TW.md | 324 ++++++++++++++++++++++++------------------------ 1 file changed, 162 insertions(+), 162 deletions(-) diff --git a/README_ZH_TW.md b/README_ZH_TW.md index 6ae18ff..e2e01ff 100644 --- a/README_ZH_TW.md +++ b/README_ZH_TW.md @@ -1,162 +1,162 @@ -## [幫助維護Vundle](https://github.com/VundleVim/Vundle.vim/issues/383) - -## 關於 - -[Vundle] 是 _Vim bundle_ 的簡稱,是一個 [Vim] 插件管理器. - -[Vundle] 允許你做... - -* 同時在`.vimrc`中跟蹤和[管理](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L126-L233)插件 -* [安裝](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L234-L254)特定格式的插件(a.k.a. scripts/bundle) -* [更新](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L255-L265)特定格式插件 -* 通過插件名稱[搜索](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L266-L295)[Vim scripts](http://vim-scripts.org/vim/scripts.html)中的插件 -* [清理](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L303-L318)未使用的插件 -* 可以通過*單一按鍵*完成以上操作,詳見[interactive mode](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L319-L360) - -[Vundle] 自動完成... - -* 管理已安裝插件的[runtime path](http://vimdoc.sourceforge.net/htmldoc/options.html#%27runtimepath%27) -* 安裝和更新後,重新生成[幫助標簽](http://vimdoc.sourceforge.net/htmldoc/helphelp.html#:helptags) - -[Vundle] 正在經歷一個 [interface change], 請通過以下方式獲取最新信息. - -討論和技術支持:[![Gitter-chat](https://badges.gitter.im/VundleVim/Vundle.vim.svg)](https://gitter.im/VundleVim/Vundle.vim) - -![Vundle-installer](http://i.imgur.com/Rueh7Cc.png) - -## 快速開始 - -1. 介紹: - - 安裝需要[Git](http://git-scm.com/),觸發[`git clone`](http://gitref.org/creating/#clone),默認將每一個指定特定格式插件的倉庫復制到`~/.vim/bundle/`. - 搜索需要Curl支持. - - Windows用戶請直接訪問[Windows setup]. 如果有任何問題, 請參考 [FAQ]. - 查看 [Tips] 獲取相關高級配置. - - 使用 non-POSIX shells, 比如比較流行對 Fish shell, 需要額外對步驟. 請查看 [FAQ]. - -2. 初始安裝 [Vundle]: - - `$ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim` - -3. 配置插件 : - - 請將以下加在 `.vimrc` 方可使用Vundle. 刪掉你不需要的插件, 這些只是用做示例. - - ```vim - set nocompatible " 去除VI一致性,必須 - filetype off " 必須 - - " 設置包括vundle和初始化相關的runtime path - set rtp+=~/.vim/bundle/Vundle.vim - call vundle#begin() - " 另一種選擇, 指定一個vundle安裝插件的路徑 - "call vundle#begin('~/some/path/here') - - " 讓vundle管理插件版本,必須 - Plugin 'VundleVim/Vundle.vim' - - " 以下範例用來支持不同格式的插件安裝. - " 請將安裝插的命令放在vundle#begin和vundle#end之間. - " Github上的插件 - " 格式為 Plugin '用戶名/插件倉庫名' - Plugin 'tpope/vim-fugitive' - " 來自 http://vim-scripts.org/vim/scripts.html 的插件 - " Plugin '插件名稱' 實際上是 Plugin 'vim-scripts/插件倉庫名' 只是此處的用戶名可以省略 - Plugin 'L9' - " 由Git支持但不再github上的插件倉庫 Plugin 'git clone 後面的地址' - Plugin 'git://git.wincent.com/command-t.git' - " 本地的Git倉庫(例如自己的插件) Plugin 'file:///+本地插件倉庫絕對路徑' - Plugin 'file:///home/gmarik/path/to/plugin' - " 插件在倉庫的子目錄中. - " 正確指定路徑用以設置runtimepath. 以下範例插件在sparkup/vim目錄下 - Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} - " 避免插件名沖突,例如L9已存在,則可以指定 - Plugin 'user/L9', {'name': 'newL9'} - - " 你的所有插件需要在下面這行之前 - call vundle#end() " 必須 - filetype plugin indent on " 必須 加載vim自帶和插件相應的語法和文件類型相關腳本 - " 忽視插件改變縮進,可以使用以下替代: - "filetype plugin on - " - " 簡要幫助文檔 - " :PluginList - 列出所有已配置的插件 - " :PluginInstall - 安裝插件,追加 `!` 用以更新或使用 :PluginUpdate - " :PluginSearch foo - 搜索 foo ; 追加 `!` 清除本地緩存 - " :PluginClean - 清除未使用插件,需要確認; 追加 `!` 自動批准移除未使用插件 - " - " 查閱 :h vundle 獲取更多細節和wiki以及FAQ - " 將你自己對非插件片段放在這行之後 - ``` - -4. 安裝插件: - - 運行 `vim` 再運行 `:PluginInstall` - - 通過命令行直接安裝 `vim +PluginInstall +qall` - -## Docs - -查閱 [`:h vundle`](https://github.com/VundleVim/Vundle.vim/blob/master/doc/vundle.txt) Vimdoc 以獲取更多細節. - -## 更新日誌 - -查閱 [changelog](https://github.com/VundleVim/Vundle.vim/blob/master/changelog.md). - -## 在使用此插件的用戶的VIMRC - -查閱 [Examples](https://github.com/VundleVim/Vundle.vim/wiki/Examples) - -## 維護者 - -查閱 [Vundle contributors](https://github.com/VundleVim/Vundle.vim/graphs/contributors) - -*感謝!* - -## 靈感 & 思路 - -* [pathogen.vim](http://github.com/tpope/vim-pathogen/) -* [Bundler](https://github.com/bundler/bundler) -* [Scott Bronson](http://github.com/bronson) - -## 另外 - -* Vundle 已測試環境為: [Vim] 7.3 on OS X, Linux and Windows -* Vundle 嘗試盡可能保持至簡模式 [KISS](http://en.wikipedia.org/wiki/KISS_principle) - -## TODO: -[Vundle] 是一個正在進步對項目, 所以很多設計思路和補丁是需要借鑒的. - -* ✓ 在重新載入或者執行`:PluginInstall`之後激活`.vimrc`中新添加的插件 -* ✓ 使用預覽窗口顯示搜索結果 -* ✓ Vim documentation -* ✓ 同時將Vundle 放置在 `bundles/` 中 (將修復 Vundle 幫助) -* ✓ 測試 -* ✓ 提升錯誤處理能力 -* 支持手動指定版本(待考慮) -* 版本依賴 -* 搜索結果中顯示描述 -* 同時支持通過描述搜索 -* 使其更加穩定! - -[Vundle]:http://github.com/VundleVim/Vundle.vim -[Windows setup]:https://github.com/VundleVim/Vundle.vim/wiki/Vundle-for-Windows -[FAQ]:https://github.com/VundleVim/Vundle.vim/wiki -[Tips]:https://github.com/VundleVim/Vundle.vim/wiki/Tips-and-Tricks -[Vim]:http://www.vim.org -[Git]:http://git-scm.com -[`git clone`]:http://gitref.org/creating/#clone - -[Vim scripts]:http://vim-scripts.org/vim/scripts.html -[help tags]:http://vimdoc.sourceforge.net/htmldoc/helphelp.html#:helptags -[runtime path]:http://vimdoc.sourceforge.net/htmldoc/options.html#%27runtimepath%27 - -[configure]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L126-L233 -[install]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L234-L254 -[update]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L255-L265 -[search]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L266-L295 -[clean]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L303-L318 -[interactive mode]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L319-L360 -[interface change]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L372-L396 +## [幫助維護Vundle](https://github.com/VundleVim/Vundle.vim/issues/383) + +## 關於 + +[Vundle] 是 _Vim bundle_ 的簡稱,是一個 [Vim] 插件管理器. + +[Vundle] 允許你做... + +* 同時在`.vimrc`中跟蹤和[管理](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L126-L233)插件 +* [安裝](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L234-L254)特定格式的插件(a.k.a. scripts/bundle) +* [更新](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L255-L265)特定格式插件 +* 通過插件名稱[搜索](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L266-L295)[Vim scripts](http://vim-scripts.org/vim/scripts.html)中的插件 +* [清理](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L303-L318)未使用的插件 +* 可以通過*單一按鍵*完成以上操作,詳見[interactive mode](https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L319-L360) + +[Vundle] 自動完成... + +* 管理已安裝插件的[runtime path](http://vimdoc.sourceforge.net/htmldoc/options.html#%27runtimepath%27) +* 安裝和更新後,重新生成[幫助標簽](http://vimdoc.sourceforge.net/htmldoc/helphelp.html#:helptags) + +[Vundle] 正在經歷一個 [interface change], 請通過以下方式獲取最新信息. + +討論和技術支持:[![Gitter-chat](https://badges.gitter.im/VundleVim/Vundle.vim.svg)](https://gitter.im/VundleVim/Vundle.vim) + +![Vundle-installer](http://i.imgur.com/Rueh7Cc.png) + +## 快速開始 + +1. 介紹: + + 安裝需要[Git](http://git-scm.com/),觸發[`git clone`](http://gitref.org/creating/#clone),默認將每一個指定特定格式插件的倉庫復制到`~/.vim/bundle/`. + 搜索需要Curl支持. + + Windows用戶請直接訪問[Windows setup]. 如果有任何問題, 請參考 [FAQ]. + 查看 [Tips] 獲取相關高級配置. + + 使用 non-POSIX shells, 比如比較流行對 Fish shell, 需要額外對步驟. 請查看 [FAQ]. + +2. 初始安裝 [Vundle]: + + `$ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim` + +3. 配置插件 : + + 請將以下加在 `.vimrc` 方可使用Vundle. 刪掉你不需要的插件, 這些只是用做示例. + + ```vim + set nocompatible " 去除VI一致性,必須 + filetype off " 必須 + + " 設置包括vundle和初始化相關的runtime path + set rtp+=~/.vim/bundle/Vundle.vim + call vundle#begin() + " 另一種選擇, 指定一個vundle安裝插件的路徑 + "call vundle#begin('~/some/path/here') + + " 讓vundle管理插件版本,必須 + Plugin 'VundleVim/Vundle.vim' + + " 以下範例用來支持不同格式的插件安裝. + " 請將安裝插的命令放在vundle#begin和vundle#end之間. + " Github上的插件 + " 格式為 Plugin '用戶名/插件倉庫名' + Plugin 'tpope/vim-fugitive' + " 來自 http://vim-scripts.org/vim/scripts.html 的插件 + " Plugin '插件名稱' 實際上是 Plugin 'vim-scripts/插件倉庫名' 只是此處的用戶名可以省略 + Plugin 'L9' + " 由Git支持但不再github上的插件倉庫 Plugin 'git clone 後面的地址' + Plugin 'git://git.wincent.com/command-t.git' + " 本地的Git倉庫(例如自己的插件) Plugin 'file:///+本地插件倉庫絕對路徑' + Plugin 'file:///home/gmarik/path/to/plugin' + " 插件在倉庫的子目錄中. + " 正確指定路徑用以設置runtimepath. 以下範例插件在sparkup/vim目錄下 + Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} + " 避免插件名沖突,例如L9已存在,則可以指定 + Plugin 'user/L9', {'name': 'newL9'} + + " 你的所有插件需要在下面這行之前 + call vundle#end() " 必須 + filetype plugin indent on " 必須 加載vim自帶和插件相應的語法和文件類型相關腳本 + " 忽視插件改變縮進,可以使用以下替代: + "filetype plugin on + " + " 簡要幫助文檔 + " :PluginList - 列出所有已配置的插件 + " :PluginInstall - 安裝插件,追加 `!` 用以更新或使用 :PluginUpdate + " :PluginSearch foo - 搜索 foo ; 追加 `!` 清除本地緩存 + " :PluginClean - 清除未使用插件,需要確認; 追加 `!` 自動批准移除未使用插件 + " + " 查閱 :h vundle 獲取更多細節和wiki以及FAQ + " 將你自己對非插件片段放在這行之後 + ``` + +4. 安裝插件: + + 運行 `vim` 再運行 `:PluginInstall` + + 通過命令行直接安裝 `vim +PluginInstall +qall` + +## Docs + +查閱 [`:h vundle`](https://github.com/VundleVim/Vundle.vim/blob/master/doc/vundle.txt) Vimdoc 以獲取更多細節. + +## 更新日誌 + +查閱 [changelog](https://github.com/VundleVim/Vundle.vim/blob/master/changelog.md). + +## 在使用此插件的用戶的VIMRC + +查閱 [Examples](https://github.com/VundleVim/Vundle.vim/wiki/Examples) + +## 維護者 + +查閱 [Vundle contributors](https://github.com/VundleVim/Vundle.vim/graphs/contributors) + +*感謝!* + +## 靈感 & 思路 + +* [pathogen.vim](http://github.com/tpope/vim-pathogen/) +* [Bundler](https://github.com/bundler/bundler) +* [Scott Bronson](http://github.com/bronson) + +## 另外 + +* Vundle 已測試環境為: [Vim] 7.3 on OS X, Linux and Windows +* Vundle 嘗試盡可能保持至簡模式 [KISS](http://en.wikipedia.org/wiki/KISS_principle) + +## TODO: +[Vundle] 是一個正在進步對項目, 所以很多設計思路和補丁是需要借鑒的. + +* ✓ 在重新載入或者執行`:PluginInstall`之後激活`.vimrc`中新添加的插件 +* ✓ 使用預覽窗口顯示搜索結果 +* ✓ Vim documentation +* ✓ 同時將Vundle 放置在 `bundles/` 中 (將修復 Vundle 幫助) +* ✓ 測試 +* ✓ 提升錯誤處理能力 +* 支持手動指定版本(待考慮) +* 版本依賴 +* 搜索結果中顯示描述 +* 同時支持通過描述搜索 +* 使其更加穩定! + +[Vundle]:http://github.com/VundleVim/Vundle.vim +[Windows setup]:https://github.com/VundleVim/Vundle.vim/wiki/Vundle-for-Windows +[FAQ]:https://github.com/VundleVim/Vundle.vim/wiki +[Tips]:https://github.com/VundleVim/Vundle.vim/wiki/Tips-and-Tricks +[Vim]:http://www.vim.org +[Git]:http://git-scm.com +[`git clone`]:http://gitref.org/creating/#clone + +[Vim scripts]:http://vim-scripts.org/vim/scripts.html +[help tags]:http://vimdoc.sourceforge.net/htmldoc/helphelp.html#:helptags +[runtime path]:http://vimdoc.sourceforge.net/htmldoc/options.html#%27runtimepath%27 + +[configure]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L126-L233 +[install]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L234-L254 +[update]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L255-L265 +[search]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L266-L295 +[clean]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L303-L318 +[interactive mode]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L319-L360 +[interface change]:https://github.com/VundleVim/Vundle.vim/blob/v0.10.2/doc/vundle.txt#L372-L396 From cc25a06266edd4ba49690af38ee2aa3744affca2 Mon Sep 17 00:00:00 2001 From: Vincent Tam Date: Fri, 26 Feb 2016 20:41:02 +0800 Subject: [PATCH 72/72] A change corresponding to 52f3443 A traditional Chinese version of the updated `README_ZH_CN.md`. --- README_ZH_TW.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README_ZH_TW.md b/README_ZH_TW.md index e2e01ff..cdc1b78 100644 --- a/README_ZH_TW.md +++ b/README_ZH_TW.md @@ -72,8 +72,8 @@ " 插件在倉庫的子目錄中. " 正確指定路徑用以設置runtimepath. 以下範例插件在sparkup/vim目錄下 Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} - " 避免插件名沖突,例如L9已存在,則可以指定 - Plugin 'user/L9', {'name': 'newL9'} + " 安裝L9,如果已經安裝過這個插件,可利用以下格式避免命名衝突 + Plugin 'ascenator/L9', {'name': 'newL9'} " 你的所有插件需要在下面這行之前 call vundle#end() " 必須