Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renaming done to close #76 #86

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 25 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,65 +9,65 @@
1. Setup [Vundle]:

```
$ git clone http://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
$ git clone http://github.com/gmarik/vundle.git ~/.vim/vundle/vundle
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid confusion we could use ~/.vim/vundles/vundle instead

```

2. Configure bundles:
2. Configure vundles:

Sample `.vimrc`:

```vim
set nocompatible " be iMproved
filetype off " required!

set rtp+=~/.vim/bundle/vundle/
set rtp+=~/.vim/vundle/vundle/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

call vundle#rc()

" let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'
" required!
Vundle 'gmarik/vundle'

" My Bundles here:
" My Vundles here:
"
" original repos on github
Bundle 'tpope/vim-fugitive'
Bundle 'Lokaltog/vim-easymotion'
Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}
Vundle 'tpope/vim-fugitive'
Vundle 'Lokaltog/vim-easymotion'
Vundle 'rstacruz/sparkup', {'rtp': 'vim/'}
" vim-scripts repos
Bundle 'L9'
Bundle 'FuzzyFinder'
Bundle 'rails.vim'
Vundle 'L9'
Vundle 'FuzzyFinder'
Vundle 'rails.vim'
" non github repos
Bundle 'git://git.wincent.com/command-t.git'
Vundle 'git://git.wincent.com/command-t.git'
" ...

filetype plugin indent on " required!
filetype plugin indent on " required!
"
" 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
" :VundleList - list configured vundles
" :VundleInstall(!) - install(update) vundles
" :VundleSearch(!) foo - search(or refresh cache first) for foo
" :VundleClean(!) - confirm(or auto-approve) removal of unused vundles
"
" see :h vundle for more details or wiki for FAQ
" NOTE: comments after Bundle command are not allowed..
" NOTE: comments after Vundle command are not allowed..

```

3. Install configured bundles:
3. Install configured vundles:

Launch `vim`, run `:BundleInstall`.
Launch `vim`, run `:VundleInstall`.

*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/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] by name [all available vim scripts]
- [clean] unused scripts up
Expand Down Expand Up @@ -117,10 +117,10 @@ see [wiki](/gmarik/vundle/wiki)
## TODO:
[Vundle] is a work in progress so any ideas/patches appreciated

* √ activate newly added bundles on .vimrc reload or after :BundleInstall
* √ activate newly added vundles on .vimrc reload or after :VundleInstall
* √ use preview window for search results
* √ vim documentation
* √ put vundle to bundles/ too(will fix vundle help)
* √ put vundle to vundles/ too(will fix vundle help)
* √ tests
* √ improve error handling
* allow specify revision/version?
Expand Down
20 changes: 10 additions & 10 deletions autoload/vundle.vim
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@
" Readme: http://github.com/gmarik/vundle/blob/master/README.md
" Version: 0.8

com! -nargs=+ Bundle
\ call vundle#config#bundle(<args>)
com! -nargs=+ Vundle
\ call vundle#config#vundle(<args>)

com! -nargs=? -bang -complete=custom,vundle#scripts#complete BundleInstall
com! -nargs=? -bang -complete=custom,vundle#scripts#complete VundleInstall
\ call vundle#installer#new('!' == '<bang>', <q-args>)

com! -nargs=? -bang -complete=custom,vundle#scripts#complete BundleSearch
com! -nargs=? -bang -complete=custom,vundle#scripts#complete VundleSearch
\ call vundle#scripts#all('!'=='<bang>', <q-args>)

com! -nargs=? -bang -complete=custom,vundle#scripts#complete Bundles
com! -nargs=? -bang -complete=custom,vundle#scripts#complete Vundles
\ call vundle#scripts#all('!'=='<bang>', <q-args>)

com! -nargs=0 -bang BundleList
com! -nargs=0 -bang VundleList
\ call vundle#installer#list('!'=='<bang>')

com! -nargs=? -bang BundleClean
com! -nargs=? -bang VundleClean
\ call vundle#installer#clean('!' == '<bang>')

com! -nargs=0 BundleDocs
\ call vundle#installer#helptags(g:bundles)
com! -nargs=0 VundleDocs
\ call vundle#installer#helptags(g:vundles)


if (has('signs'))
Expand All @@ -36,7 +36,7 @@ endif


func! vundle#rc(...) abort
let g:bundle_dir = len(a:000) > 0 ? expand(a:1) : expand('$HOME/.vim/bundle')
let g:vundle_dir = len(a:000) > 0 ? expand(a:1) : expand('$HOME/.vim/vundle')
let g:vundle_log = []
call vundle#config#init()
endf
38 changes: 19 additions & 19 deletions autoload/vundle/config.vim
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
func! vundle#config#bundle(arg, ...)
let bundle = vundle#config#init_bundle(a:arg, a:000)
func! vundle#config#vundle(arg, ...)
let vundle = vundle#config#init_vundle(a:arg, a:000)
call s:rtp_rm_a()
call add(g:bundles, bundle)
call add(g:vundles, vundle)
call s:rtp_add_a()
endf

func! vundle#config#init()
if !exists('g:bundles') | let g:bundles = [] | endif
if !exists('g:vundles') | let g:vundles = [] | endif
call s:rtp_rm_a()
let g:bundles = []
let g:vundles = []
endf

func! vundle#config#require(bundles) abort
for b in a:bundles
func! vundle#config#require(vundles) abort
for b in a:vundles
call s:rtp_add(b.rtpath())
call s:rtp_add(g:bundle_dir)
" TODO: it has to be relative rtpath, not bundle.name
call s:rtp_add(g:vundle_dir)
" TODO: it has to be relative rtpath, not vundle.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_dir)
endfor
endf

func! vundle#config#init_bundle(name, opts)
func! vundle#config#init_vundle(name, opts)
let opts = extend(s:parse_options(a:opts), s:parse_name(substitute(a:name,"['".'"]\+','','g')))
return extend(opts, copy(s:bundle))
return extend(opts, copy(s:vundle))
endf

func! s:parse_options(opts)
Expand All @@ -48,7 +48,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
Expand All @@ -61,11 +61,11 @@ func! s:parse_name(arg)
endf

func! s:rtp_rm_a()
call filter(copy(g:bundles), 's:rtp_rm(v:val.rtpath())')
call filter(copy(g:vundles), 's:rtp_rm(v:val.rtpath())')
endf

func! s:rtp_add_a()
call filter(reverse(copy(g:bundles)), 's:rtp_add(v:val.rtpath())')
call filter(reverse(copy(g:vundles)), 's:rtp_add(v:val.rtpath())')
endf

func! s:rtp_rm(dir) abort
Expand All @@ -82,12 +82,12 @@ func! s:expand_path(path) abort
return simplify(expand(a:path))
endf

let s:bundle = {}
let s:vundle = {}

func! s:bundle.path()
return s:expand_path(g:bundle_dir.'/'.self.name)
func! s:vundle.path()
return s:expand_path(g:vundle_dir.'/'.self.name)
endf

func! s:bundle.rtpath()
func! s:vundle.rtpath()
return has_key(self, 'rtp') ? s:expand_path(self.path().'/'.self.rtp) : self.path()
endf
64 changes: 32 additions & 32 deletions autoload/vundle/installer.vim
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
func! vundle#installer#new(bang, ...) abort
let bundles = (a:1 == '') ?
\ g:bundles :
\ map(copy(a:000), 'vundle#config#init_bundle(v:val, {})')
let vundles = (a:1 == '') ?
\ g:vundles :
\ map(copy(a:000), 'vundle#config#init_vundle(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)], names + ['Helptags'])
let names = vundle#scripts#vundle_names(map(copy(vundles), 'v:val.name_spec'))
call vundle#scripts#view('Installer',['" Installing vundles to '.expand(g:vundle_dir)], names + ['Helptags'])

call s:process(a:bang, (a:bang ? 'add!' : 'add'))

call vundle#config#require(bundles)
call vundle#config#require(vundles)
endf


Expand Down Expand Up @@ -53,7 +53,7 @@ func! vundle#installer#run(func_name, name, ...) abort

redraw!

if 'updated' == status
if 'updated' == status
echo n.' installed'
elseif 'todate' == status
echo n.' already installed'
Expand All @@ -73,7 +73,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
Expand All @@ -83,57 +83,57 @@ endf

func! vundle#installer#install_and_require(bang, name) abort
let result = vundle#installer#install(a:bang, a:name)
let b = vundle#config#init_bundle(a:name, {})
let b = vundle#config#init_vundle(a:name, {})
call vundle#config#require([b])
return result
endf

func! vundle#installer#install(bang, name) abort
if !isdirectory(g:bundle_dir) | call mkdir(g:bundle_dir, 'p') | endif
if !isdirectory(g:vundle_dir) | call mkdir(g:vundle_dir, 'p') | endif

let b = vundle#config#init_bundle(a:name, {})
let b = vundle#config#init_vundle(a:name, {})

return s:sync(a:bang, b)
endf

func! vundle#installer#docs() abort
call vundle#installer#helptags(g:bundles)
call vundle#installer#helptags(g:vundles)
return 'updated'
endf

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)')
func! vundle#installer#helptags(vundles) abort
let vundle_dirs = map(copy(a:vundles),'v:val.rtpath()')
let help_dirs = filter(vundle_dirs, 's:has_doc(v:val)')

call s:log('')
call s:log('Helptags:')

call map(copy(help_dirs), 's:helptags(v:val)')

call s:log('Helptags: '.len(help_dirs).' bundles processed')
call s:log('Helptags: '.len(help_dirs).' vundles processed')

return help_dirs
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)
let vundles = vundle#scripts#vundle_names(map(copy(g:vundles), 'v:val.name_spec'))
call vundle#scripts#view('list', ['" My Vundles'], vundles)
redraw!
echo len(g:bundles).' bundles configured'
echo len(g:vundles).' vundles configured'
endf


func! vundle#installer#clean(bang) abort
let bundle_dirs = map(copy(g:bundles), 'v:val.path()')
let all_dirs = split(globpath(g:bundle_dir, '*'), "\n")
let x_dirs = filter(all_dirs, '0 > index(bundle_dirs, v:val)')
let vundle_dirs = map(copy(g:vundles), 'v:val.path()')
let all_dirs = split(globpath(g:vundle_dir, '*'), "\n")
let x_dirs = filter(all_dirs, '0 > index(vundle_dirs, v:val)')

if empty(x_dirs)
let headers = ['" All clean!']
let names = []
else
let headers = ['" Removing bundles:']
let names = vundle#scripts#bundle_names(map(copy(x_dirs), 'fnamemodify(v:val, ":t")'))
let headers = ['" Removing vundles:']
let names = vundle#scripts#vundle_names(map(copy(x_dirs), 'fnamemodify(v:val, ":t")'))
end

call vundle#scripts#view('clean', headers, names)
Expand All @@ -151,13 +151,13 @@ func! vundle#installer#delete(bang, dir_name) abort
\ 'rmdir /S /Q' :
\ 'rm -rf'

let bundle = vundle#config#init_bundle(a:dir_name, {})
let cmd .= ' '.shellescape(bundle.path())
let vundle = vundle#config#init_vundle(a:dir_name, {})
let cmd .= ' '.shellescape(vundle.path())

let out = s:system(cmd)

call s:log('')
call s:log('Bundle '.a:dir_name)
call s:log('Vundle '.a:dir_name)
call s:log('$ '.cmd)
call s:log('> '.out)

Expand All @@ -184,23 +184,23 @@ func! s:helptags(rtp) abort
endtry
endf

func! s:sync(bang, bundle) abort
let git_dir = expand(a:bundle.path().'/.git/')
func! s:sync(bang, vundle) abort
let git_dir = expand(a:vundle.path().'/.git/')
if isdirectory(git_dir)
if !(a:bang) | return 'todate' | endif
let cmd = 'cd '.shellescape(a:bundle.path()).' && git pull'
let cmd = 'cd '.shellescape(a:vundle.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())
let cmd = 'git clone '.a:vundle.uri.' '.shellescape(a:vundle.path())
endif

let out = s:system(cmd)
call s:log('')
call s:log('Bundle '.a:bundle.name_spec)
call s:log('Vundle '.a:vundle.name_spec)
call s:log('$ '.cmd)
call s:log('> '.out)

Expand Down
Loading