diff --git a/README.md b/README.md index 0fcefa3..3e39a4d 100644 --- a/README.md +++ b/README.md @@ -1,49 +1,57 @@ ## About -[Vundle] is a short cut for **V**imb**undle** and is a [Vim] plugin manager. +[Vundle] is short for **V**imb**undle** and is a [Vim] plugin manager. ## Quick start 1. Setup [Vundle]: - git clone http://github.com/gmarik/vundle.git ~/.vim/bundle/vundle + + ``` + $ git clone http://github.com/gmarik/vundle.git ~/.vim/bundle/vundle + ``` 2. Configure bundles: - Sample `.vimrc`: + Sample `.vimrc`: + + ```vim + set nocompatible " be iMproved + filetype off " required! - set nocompatible " be iMproved - filetype off " required! + set rtp+=~/.vim/bundle/vundle/ + call vundle#rc() - set rtp+=~/.vim/bundle/vundle/ - call vundle#rc() + " let Vundle manage Vundle + Bundle 'gmarik/vundle' - " let Vundle manage Vundle - Bundle 'gmarik/vundle' + " 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' + " ... - " 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' - " ... + filetype plugin indent on " required! + " or + " filetype plugin on " to not use the indentation settings set by plugins + ``` - filetype plugin indent on " required! 3. Install configured bundles: - Launch `vim`, run `:BundleInstall`. + Launch `vim`, run `:BundleInstall`. - *Windows users* see [Vundle for Windows](https://github.com/gmarik/vundle/wiki/Vundle-for-Windows) + *Windows users* see [Vundle for Windows](https://github.com/gmarik/vundle/wiki/Vundle-for-Windows) - 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/`. ## Why Vundle @@ -69,17 +77,26 @@ see [`:h vundle`](vundle/blob/master/doc/vundle.txt#L1) vimdoc for more details. See [gmarik's vimrc](https://github.com/gmarik/vimfiles/blob/1f4f26d42f54443f1158e0009746a56b9a28b053/vimrc#L136) for working example. + If you have an interesting example, feel free to send a pull request with link to your config. Thx! + ## FAQ - **Q** Why am I asked for username/pass? - **A** This is the case of invalid name used with `Bundle`, which leads to attempt to clone nonexisting repo: + **A** This is the case of invalid name used with `Bundle`, which leads to attempt to clone nonexistent repo: + + ``` + git clone http://github.com/gmarik/non_existin_repo + Cloning into non_existin_repo... + Username: + Password: + fatal: Authentication failed + ``` + + +- **Q** My configuration is bundle dependant, so when I try to install plugins for the first time I get errors. How do I fix that? - git clone http://github.com/gmarik/non_existin_repo - Cloning into non_existin_repo... - Username: - Password: - fatal: Authentication failed + **A** [Fix your Chicken or Egg dilemma](http://gmarik.info/blog/2011/05/17/chicken-or-egg-dilemma) ## Contributors @@ -114,8 +131,8 @@ see [`:h vundle`](vundle/blob/master/doc/vundle.txt#L1) vimdoc for more details. * improve error handling * handle dependencies * allow specify revision/version? -* search by description aswell -* show descrption in search results +* search by description as well +* show description in search results * instead sourcing .vimrc before installation come up with another solution * make it rock! @@ -126,8 +143,8 @@ see [`:h vundle`](vundle/blob/master/doc/vundle.txt#L1) vimdoc for more details. [Git]:http://git-scm.com [all available vim scripts]:http://vim-scripts.org/vim/scripts.html -[install]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L98-112 -[update]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L114-119 -[search]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L121-143 -[clean]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L145-157 -[interactive mode]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L160-193 +[install]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L110-124 +[update]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L126-131 +[search]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L133-155 +[clean]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L157-169 +[interactive mode]:https://github.com/gmarik/vundle/blob/master/doc/vundle.txt#L172-205 diff --git a/autoload/vundle/config.vim b/autoload/vundle/config.vim index 546d2ff..92b90a5 100644 --- a/autoload/vundle/config.vim +++ b/autoload/vundle/config.vim @@ -63,7 +63,7 @@ func! s:parse_name(arg) let uri = 'https://github.com/'.split(arg, ':')[-1] let name = substitute(split(uri,'\/')[-1], '\.git\s*$','','i') elseif arg =~? '^\s*\(git@\|git://\)\S\+' - \ || arg =~? '(file|https\?)://' + \ || arg =~? '\(file\|https\?\)://' \ || arg =~? '\.git\s*$' \ || isdirectory(expand(arg)) let uri = arg @@ -93,6 +93,10 @@ func! s:rtp_add(dir) abort exec 'set rtp+='.fnameescape(expand(a:dir.'/after')) endf +func! s:expand_path(path) abort + return simplify(expand(a:path)) +endf + let s:bundle = {} func! s:bundle.nosync() @@ -107,12 +111,12 @@ func! s:bundle.path() " TODO: should lcd to tmpdir here " TODO: FIX this spagetti if self.nosync() && isdirectory(expand(self.uri)) - return expand(self.uri) + return s:expand_path(self.uri) endif - return join([g:vundle#bundle_dir, self.name], '/') + return s:expand_path(g:vundle#bundle_dir.'/'.self.name) endf func! s:bundle.rtpath() - return has_key(self, 'rtp') ? join([self.path(), self.rtp], '/') : self.path() + return has_key(self, 'rtp') ? s:expand_path(self.path().'/'.self.rtp) : self.path() endf diff --git a/autoload/vundle/installer.vim b/autoload/vundle/installer.vim index c6ed821..06bb26b 100644 --- a/autoload/vundle/installer.vim +++ b/autoload/vundle/installer.vim @@ -102,7 +102,11 @@ func! s:has_doc(rtp) abort endf func! s:helptags(rtp) abort - helptags `=a:rtp.'/doc/'` + try + helptags `=a:rtp.'/doc/'` + catch + echohl Error | echo "Error generating helptags in ".a:rtp | echohl None + endtry endf func! vundle#installer#sync(bang, bundle) abort @@ -110,6 +114,11 @@ func! vundle#installer#sync(bang, bundle) abort if a:bundle.installed() if !(a:bang) | return 0 | endif let cmd = 'cd '.shellescape(a:bundle.path()).' && git pull' + + if (has('win32') || has('win64')) + let cmd = substitute(cmd, '^cd ','cd /d ','') " add /d switch to change drives + let cmd = '"'.cmd.'"' " enclose in quotes + endif else let cmd = 'git clone '.a:bundle.uri.' '.shellescape(a:bundle.path()) endif diff --git a/doc/vundle.txt b/doc/vundle.txt index 6845d6c..1ef286a 100644 --- a/doc/vundle.txt +++ b/doc/vundle.txt @@ -55,6 +55,9 @@ in order to install/search [all available vim scripts] set rtp+=~/.vim/vundle.git/ call vundle#rc() + " let Vundle manage Vundle + Bundle 'gmarik/vundle' + " My Bundles here: " " original repos on github @@ -70,6 +73,8 @@ in order to install/search [all available vim scripts] " ... filetype plugin indent on " required! + " or + " filetype plugin on " to not use the indentation settings set by plugins 3) Install configured bundles: diff --git a/test/vimrc b/test/vimrc index 861f43a..896f260 100644 --- a/test/vimrc +++ b/test/vimrc @@ -6,14 +6,14 @@ syntax on silent exec 'e '.expand('') let branch = split(filter(split(system('git branch'),'\n'),'v:val[0]=="*"')[0],'\s\+')[1] +let root = '/tmp/'.branch.'/vundle_bundles' +"let src = 'http://github.com/gmarik/vundle.git' +let src = '~/.vim/bundle/vundle/.git' -let root = '/tmp/vundle_bundles_'.branch -if !isdirectory(expand(root.'/vundle')) - exec '!git clone -b '.branch.' http://github.com/gmarik/vundle.git '.root.'/vundle' +if !isdirectory(expand(root).'/vundle') + exec '!git clone '.src.' '.root.'/vundle' endif -filetype off - runtime macros/matchit.vim exec 'set rtp+='.root.'/vundle' @@ -35,7 +35,9 @@ Bundle 'altercation/vim-colors-solarized' Bundle 'nelstrom/vim-mac-classic-theme.git' " full uri -" Bundle 'git@github.com:gmarik/ingretu.git' +Bundle 'https://github.com/vim-scripts/vim-game-of-life' +" full uri +Bundle 'git@github.com:gmarik/ingretu.git' " short uri Bundle 'gh:gmarik/snipmate.vim.git' Bundle 'github:mattn/gist-vim.git'