51 Commits

Author SHA1 Message Date
Tim Pope 4d584ea8c8 pathogen.vim 2.4
* Use $VIMBLACKLIST to temporarily disable bundles.
* Allow disabling rest of vimrc by adding it to blacklist.
* Expand bundle/{a,b} as bundle/a and bundle/b.
* Experimental: Support "vimfiles" subdirectory.
* Work around weird lockup on ancient Vim.
* Restore disabling of paths ending in ~.
2015-12-25 19:06:34 -05:00
Tim Pope 8b27115203 Update instructions for disabling bundle 2015-12-25 19:06:06 -05:00
Tim Pope 890e013d96 Fix handling of after directories
Closes https://github.com/tpope/vim-pathogen/issues/167
2015-12-22 12:35:35 -05:00
Tim Pope 68ead6af17 Remove old fold markers 2015-12-21 20:33:12 -05:00
Tim Pope e2f96ded89 Experimental: Support "vimfiles" subdirectory
In hindsight, I think dumping runtime files and directories directly
into the root of the repository was a mistake, as it mixes them in with
cruft like .gitignore and the README, not to mention not to mention
unrelated files in repos with a purpose other than just Vim runtime
files.  Admittedly, transitioning to an alternate structure at this late
stage is unlikely, but I'm adding preliminary support for it anyways as
a hedge.

The name "vimfiles" is used by Vim itself in a few places and in my
opinion is the only name worth considering.  I think enabling plugins to
choose their own subdirectory would just add unnecessary configuration
and overhead.
2015-12-21 20:31:13 -05:00
Tim Pope a6004fd531 Separate "after" parameter during expansion 2015-12-21 18:35:24 -05:00
Lifepillar b4174e4d1a Fix typo in pathogen#surround()
Closes https://github.com/tpope/vim-pathogen/issues/157
2015-09-20 15:25:20 -04:00
Tim Pope b9fb0dfd81 Drop obsolete caveat about {} 2014-11-06 13:41:58 -05:00
Tim Pope 91e6378908 Strip trailing slashes in blacklist 2014-07-19 23:20:27 -04:00
koalaman ed01fca95c Update install commands to use && instead of ;
This way, if mkdir or cd fails, it'll stop rather than continuing to
download or clone in the wrong directory.
2014-05-29 17:45:08 -04:00
Tim Pope 1b644bf4b2 Take control of download URL
There have been multiple reports of failure with the existing URL,
though I can't reproduce.

Closes #128.
2014-05-26 20:44:16 -04:00
Tim Pope 336611a3d0 Fix curl command to support GitHub's new redirect
Closes #120.
2014-04-25 17:28:22 -04:00
Tim Pope bff90d72a1 Work around weird lockup on ancient Vim
Closes #118.
2014-04-01 23:42:58 -04:00
Tim Pope 099b918141 Expand bundle/{a,b} as bundle/a and bundle/b 2014-03-26 13:37:29 -04:00
Tim Pope 5b5bee9c44 Restore disabling of paths ending in ~ 2014-03-25 10:46:35 -04:00
Tim Pope 9a40364c60 Use $VIMBLACKLIST to temporarily disable bundles
VIMBLACKLIST=vim-fugitive,vim-dispatch vim
2014-03-24 12:17:15 -04:00
Tim Pope e1687eb4d9 Allow disabling rest of vimrc 2014-03-23 19:49:18 -04:00
Tim Pope f66e6f483f Try a fold expression 2014-03-21 16:27:00 -04:00
Tim Pope bd0c1abcce pathogen.vim 2.3
* Deprecation warnings.
* Introduce pathogen#interpose() to replace incubate().
* Fix glob issues with fish shell.
* Silence all errors in :helptags.
2014-03-21 15:02:02 -04:00
Tim Pope 50531a4102 Make pathogen#uniq unofficial 2014-03-21 15:01:14 -04:00
Tim Pope 2d3784070d Move s:warn down with deprecations 2014-03-21 14:46:14 -04:00
Tim Pope 60c6fd24cf Move unofficial/deprecated functions to separate sections 2014-03-21 14:03:00 -04:00
Tim Pope af23f56f42 Fix message 2014-03-20 17:48:55 -04:00
Tim Pope a341581743 Fix zero arity invocation of runtime_append_all_bundles 2014-03-20 16:59:45 -04:00
Tim Pope 0230129c50 Steer people to pathogen#infect() in deprecations 2014-03-20 15:16:53 -04:00
Tim Pope 5cb9a24de8 Swap out deprecated functions for their replacements 2014-03-20 15:14:33 -04:00
Tim Pope d7be5c7712 Start renaming pathogen_disabled to pathogen_blacklist 2014-03-20 03:09:46 -04:00
Tim Pope 0f43888aba Don't redundantly filter ~ suffixes
This is already handled by glob() due to the 'suffixes' option
2014-03-20 02:59:22 -04:00
Tim Pope 8c54b5ec0d Alias pathogen#interpose() to incubate()
We can do better than cutesy.
2014-03-20 00:32:28 -04:00
Tim Pope 3bc4b397b2 Typo fix 2014-03-19 19:12:28 -04:00
Tim Pope 543041b3ca Better check for help files in doc directory 2014-03-19 12:38:40 -04:00
Tim Pope f45c82a760 Document session options limitations
References #16.
2014-03-18 22:40:55 -04:00
Tim Pope c9ca3770db Use a dictionary to track done bundles 2014-03-17 23:08:24 -04:00
Tim Pope 698239024b Ignore non-string arguments to infect
Allow for an options dictionary to be passed in the future.
2014-03-17 22:34:30 -04:00
Tim Pope 16a1a84072 pathogen#slash() alias for pathogen#separator() 2014-03-17 17:58:20 -04:00
Will Gray 1270dceb1f Update comment to match readme 2013-07-13 22:33:54 -04:00
Tim Pope f1926ab673 Use fnameescape not =... 2013-03-21 13:18:03 -04:00
Tim Pope 0c3769d94e Always warn on deprecated API 2013-03-21 13:12:08 -04:00
Tim Pope 2c14c6095e Silence errors in :helptags
Closes #90.
2013-03-21 13:11:43 -04:00
Tim Pope 3111f06b70 Add a CONTRIBUTING file
Leave the README section in place, as we link to it from all over the
place.
2013-03-10 16:07:37 -04:00
Tim Pope a517eed987 Fix glob issues with fish shell
Closes #83.
2013-02-27 20:42:14 -05:00
Tim Pope 74ae96483b Fix typo 2013-02-27 20:41:50 -05:00
Tim Pope 12c3483515 Fix typo in README
Closes #86.
2013-02-16 21:38:16 -05:00
Tim Pope f195ac5e40 pathogen.vim 2.2
* Accept multiple arguments to pathogen#infect().
* Fix errors in deprecated methods.
2013-01-14 17:54:17 -05:00
Maksim Ryzhikov 1050a784cc Fix error in pathogen#runtime_append_all_bundles 2013-01-14 16:22:57 -05:00
Tim Pope 6cfc5e7759 Fix errors on attempt to warn
Closes #81.
2013-01-14 13:30:43 -05:00
Tim Pope 1b7f130f57 Revert "Point README at stable release"
This reverts commit 95c285e426.
2013-01-13 23:27:54 -05:00
Tim Pope 98659f0af7 Fix multiple arguments to pathogen#infect 2013-01-13 23:17:14 -05:00
Tim Pope a860d000e1 Reveal multiple arguments form of pathogen#infect 2013-01-13 23:09:15 -05:00
Tim Pope 92ca2e574b Accept multiple arguments to pathogen#infect() 2013-01-13 22:55:33 -05:00
Tim Pope 95c285e426 Point README at stable release 2013-01-13 21:06:33 -05:00
3 changed files with 244 additions and 196 deletions
+14
View File
@@ -0,0 +1,14 @@
If your [commit message sucks](http://stopwritingramblingcommitmessages.com/),
I'm not going to accept your pull request. I've explained very politely
dozens of times that
[my general guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
are absolute rules on my own repositories, so I may lack the energy to
explain it to you yet another time. And please, if I ask you to change
something, `git commit --amend`.
Beyond that, don't be shy about asking before patching. What takes you
hours might take me minutes simply because I have both domain knowledge
and a perverse knowledge of Vim script so vast that many would consider
it a symptom of mental illness. On the flip side, some ideas I'll
reject no matter how good the implementation is. "Send a patch" is an
edge case answer in my book.
+14 -8
View File
@@ -8,9 +8,8 @@ private directories.
Install to `~/.vim/autoload/pathogen.vim`. Or copy and paste:
mkdir -p ~/.vim/autoload ~/.vim/bundle; \
curl -Sso ~/.vim/autoload/pathogen.vim \
https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vim
mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
If you're using Windows, change all occurrences of `~/.vim` to `~\vimfiles`.
@@ -31,7 +30,7 @@ Now any plugins you wish to install can be extracted to a subdirectory
under `~/.vim/bundle`, and they will be added to the `'runtimepath'`.
Observe:
cd ~/.vim/bundle
cd ~/.vim/bundle && \
git clone git://github.com/tpope/vim-sensible.git
Now [sensible.vim](https://github.com/tpope/vim-sensible) is installed.
@@ -44,12 +43,11 @@ glob as an argument:
execute pathogen#infect('stuff/{}')
The `{}` indicates where the expansion should occur. Currently only a
trailing `{}` is supported.
The `{}` indicates where the expansion should occur.
You can also pass an absolute path instead. I keep the plugins I maintain under `~/src`, and this is how I add them:
execute pathogen#infect('~/src/vim/bundle/{}')
execute pathogen#infect('bundle/{}', '~/src/vim/bundle/{}')
Normally to generate documentation, Vim expects you to run `:helptags`
on each directory with documentation (e.g., `:helptags ~/.vim/doc`).
@@ -66,7 +64,7 @@ It's well documented.
## Runtime File Editing
`:Vopen`, `:Vedit`, `:Vsplit`, `:Vvsplit`, `:Vtabedit`, `:Vpedit`, and
`:Vread` have all moved to [scriptease.vim][]
`:Vread` have all moved to [scriptease.vim][].
[scriptease.vim]: https://github.com/tpope/vim-scriptease
@@ -103,6 +101,14 @@ If you really must use one:
:!mkdir ~/.vim/bundle/name
:UseVimball ~/.vim/bundle/name
> Why don't my plugins load when I use Vim sessions?
Vim sessions default to capturing all global options, which includes the
`'runtimepath'` that pathogen.vim manipulates. This can cause other problems
too, so I recommend turning that behavior off:
set sessionoptions-=options
## Contributing
If your [commit message sucks](http://stopwritingramblingcommitmessages.com/),
+216 -188
View File
@@ -1,60 +1,56 @@
" pathogen.vim - path option manipulation
" Maintainer: Tim Pope <http://tpo.pe/>
" Version: 2.1
" Version: 2.4
" Install in ~/.vim/autoload (or ~\vimfiles\autoload).
"
" For management of individually installed plugins in ~/.vim/bundle (or
" ~\vimfiles\bundle), adding `call pathogen#infect()` to the top of your
" ~\vimfiles\bundle), adding `execute pathogen#infect()` to the top of your
" .vimrc is the only other setup necessary.
"
" The API is documented inline below. For maximum ease of reading,
" :set foldmethod=marker
" The API is documented inline below.
if exists("g:loaded_pathogen") || &cp
finish
endif
let g:loaded_pathogen = 1
function! s:warn(msg)
if &verbose
echohl WarningMsg
echomsg a:msg
echohl NONE
" Point of entry for basic default usage. Give a relative path to invoke
" pathogen#interpose() (defaults to "bundle/{}"), or an absolute path to invoke
" pathogen#surround(). Curly braces are expanded with pathogen#expand():
" "bundle/{}" finds all subdirectories inside "bundle" inside all directories
" in the runtime path.
function! pathogen#infect(...) abort
for path in a:0 ? filter(reverse(copy(a:000)), 'type(v:val) == type("")') : ['bundle/{}']
if path =~# '^\%({\=[$~\\/]\|{\=\w:[\\/]\).*[{}*]'
call pathogen#surround(path)
elseif path =~# '^\%([$~\\/]\|\w:[\\/]\)'
call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')')
call pathogen#surround(path . '/{}')
elseif path =~# '[{}*]'
call pathogen#interpose(path)
else
call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')')
call pathogen#interpose(path . '/{}')
endif
endfor
call pathogen#cycle_filetype()
if pathogen#is_disabled($MYVIMRC)
return 'finish'
endif
return ''
endfunction
" Point of entry for basic default usage. Give a relative path to invoke
" pathogen#incubate() (defaults to "bundle/{}"), or an absolute path to invoke
" pathogen#surround(). For backwards compatibility purposes, a full path that
" does not end in {} or * is given to pathogen#runtime_prepend_subdirectories()
" instead.
function! pathogen#infect(...) abort " {{{1
let path = a:0 ? a:1 : 'bundle/{}'
if path =~# '^[^\\/]\+$'
call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')')
call pathogen#incubate(path . '/{}')
elseif path =~# '^[^\\/]\+[\\/]\%({}\|\*\)$'
call pathogen#incubate(path)
elseif path =~# '[\\/]\%({}\|\*\)$'
call pathogen#surround(path)
else
call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')')
call pathogen#surround(path . '/{}')
endif
call pathogen#cycle_filetype()
return ''
endfunction " }}}1
" Split a path into a list.
function! pathogen#split(path) abort " {{{1
function! pathogen#split(path) abort
if type(a:path) == type([]) | return a:path | endif
if empty(a:path) | return [] | endif
let split = split(a:path,'\\\@<!\%(\\\\\)*\zs,')
return map(split,'substitute(v:val,''\\\([\\,]\)'',''\1'',"g")')
endfunction " }}}1
endfunction
" Convert a list to a path.
function! pathogen#join(...) abort " {{{1
function! pathogen#join(...) abort
if type(a:1) == type(1) && a:1
let i = 1
let space = ' '
@@ -78,15 +74,147 @@ function! pathogen#join(...) abort " {{{1
let i += 1
endwhile
return substitute(path,'^,','','')
endfunction " }}}1
endfunction
" Convert a list to a path with escaped spaces for 'path', 'tag', etc.
function! pathogen#legacyjoin(...) abort " {{{1
function! pathogen#legacyjoin(...) abort
return call('pathogen#join',[1] + a:000)
endfunction " }}}1
endfunction
" Turn filetype detection off and back on again if it was already enabled.
function! pathogen#cycle_filetype() abort
if exists('g:did_load_filetypes')
filetype off
filetype on
endif
endfunction
" Check if a bundle is disabled. A bundle is considered disabled if its
" basename or full name is included in the list g:pathogen_blacklist or the
" comma delimited environment variable $VIMBLACKLIST.
function! pathogen#is_disabled(path) abort
if a:path =~# '\~$'
return 1
endif
let sep = pathogen#slash()
let blacklist = map(
\ get(g:, 'pathogen_blacklist', get(g:, 'pathogen_disabled', [])) +
\ pathogen#split($VIMBLACKLIST),
\ 'substitute(v:val, "[\\/]$", "", "")')
return index(blacklist, fnamemodify(a:path, ':t')) != -1 || index(blacklist, a:path) != -1
endfunction
" Prepend the given directory to the runtime path and append its corresponding
" after directory. Curly braces are expanded with pathogen#expand().
function! pathogen#surround(path) abort
let sep = pathogen#slash()
let rtp = pathogen#split(&rtp)
let path = fnamemodify(a:path, ':p:s?[\\/]\=$??')
let before = filter(pathogen#expand(path), '!pathogen#is_disabled(v:val)')
let after = filter(reverse(pathogen#expand(path, sep.'after')), '!pathogen#is_disabled(v:val[0:-7])')
call filter(rtp, 'index(before + after, v:val) == -1')
let &rtp = pathogen#join(before, rtp, after)
return &rtp
endfunction
" For each directory in the runtime path, add a second entry with the given
" argument appended. Curly braces are expanded with pathogen#expand().
function! pathogen#interpose(name) abort
let sep = pathogen#slash()
let name = a:name
if has_key(s:done_bundles, name)
return ""
endif
let s:done_bundles[name] = 1
let list = []
for dir in pathogen#split(&rtp)
if dir =~# '\<after$'
let list += reverse(filter(pathogen#expand(dir[0:-6].name, sep.'after'), '!pathogen#is_disabled(v:val[0:-7])')) + [dir]
else
let list += [dir] + filter(pathogen#expand(dir.sep.name), '!pathogen#is_disabled(v:val)')
endif
endfor
let &rtp = pathogen#join(pathogen#uniq(list))
return 1
endfunction
let s:done_bundles = {}
" Invoke :helptags on all non-$VIM doc directories in runtimepath.
function! pathogen#helptags() abort
let sep = pathogen#slash()
for glob in pathogen#split(&rtp)
for dir in map(split(glob(glob), "\n"), 'v:val.sep."/doc/".sep')
if (dir)[0 : strlen($VIMRUNTIME)] !=# $VIMRUNTIME.sep && filewritable(dir) == 2 && !empty(split(glob(dir.'*.txt'))) && (!filereadable(dir.'tags') || filewritable(dir.'tags'))
silent! execute 'helptags' pathogen#fnameescape(dir)
endif
endfor
endfor
endfunction
command! -bar Helptags :call pathogen#helptags()
" Execute the given command. This is basically a backdoor for --remote-expr.
function! pathogen#execute(...) abort
for command in a:000
execute command
endfor
return ''
endfunction
" Section: Unofficial
function! pathogen#is_absolute(path) abort
return a:path =~# (has('win32') ? '^\%([\\/]\|\w:\)[\\/]\|^[~$]' : '^[/~$]')
endfunction
" Given a string, returns all possible permutations of comma delimited braced
" alternatives of that string. pathogen#expand('/{a,b}/{c,d}') yields
" ['/a/c', '/a/d', '/b/c', '/b/d']. Empty braces are treated as a wildcard
" and globbed. Actual globs are preserved.
function! pathogen#expand(pattern, ...) abort
let after = a:0 ? a:1 : ''
if a:pattern =~# '{[^{}]\+}'
let [pre, pat, post] = split(substitute(a:pattern, '\(.\{-\}\){\([^{}]\+\)}\(.*\)', "\\1\001\\2\001\\3", ''), "\001", 1)
let found = map(split(pat, ',', 1), 'pre.v:val.post')
let results = []
for pattern in found
call extend(results, pathogen#expand(pattern))
endfor
elseif a:pattern =~# '{}'
let pat = matchstr(a:pattern, '^.*{}[^*]*\%($\|[\\/]\)')
let post = a:pattern[strlen(pat) : -1]
let results = map(split(glob(substitute(pat, '{}', '*', 'g')), "\n"), 'v:val.post')
else
let results = [a:pattern]
endif
let vf = pathogen#slash() . 'vimfiles'
call map(results, 'v:val =~# "\\*" ? v:val.after : isdirectory(v:val.vf.after) ? v:val.vf.after : isdirectory(v:val.after) ? v:val.after : ""')
return filter(results, '!empty(v:val)')
endfunction
" \ on Windows unless shellslash is set, / everywhere else.
function! pathogen#slash() abort
return !exists("+shellslash") || &shellslash ? '/' : '\'
endfunction
function! pathogen#separator() abort
return pathogen#slash()
endfunction
" Convenience wrapper around glob() which returns a list.
function! pathogen#glob(pattern) abort
let files = split(glob(a:pattern),"\n")
return map(files,'substitute(v:val,"[".pathogen#slash()."/]$","","")')
endfunction
" Like pathogen#glob(), only limit the results to directories.
function! pathogen#glob_directories(pattern) abort
return filter(pathogen#glob(a:pattern),'isdirectory(v:val)')
endfunction
" Remove duplicates from a list.
function! pathogen#uniq(list) abort " {{{1
function! pathogen#uniq(list) abort
let i = 0
let seen = {}
while i < len(a:list)
@@ -101,152 +229,10 @@ function! pathogen#uniq(list) abort " {{{1
endif
endwhile
return a:list
endfunction " }}}1
" \ on Windows unless shellslash is set, / everywhere else.
function! pathogen#separator() abort " {{{1
return !exists("+shellslash") || &shellslash ? '/' : '\'
endfunction " }}}1
" Convenience wrapper around glob() which returns a list.
function! pathogen#glob(pattern) abort " {{{1
let files = split(glob(a:pattern),"\n")
return map(files,'substitute(v:val,"[".pathogen#separator()."/]$","","")')
endfunction "}}}1
" Like pathogen#glob(), only limit the results to directories.
function! pathogen#glob_directories(pattern) abort " {{{1
return filter(pathogen#glob(a:pattern),'isdirectory(v:val)')
endfunction "}}}1
" Turn filetype detection off and back on again if it was already enabled.
function! pathogen#cycle_filetype() " {{{1
if exists('g:did_load_filetypes')
filetype off
filetype on
endif
endfunction " }}}1
" Check if a bundle is disabled. A bundle is considered disabled if it ends
" in a tilde or its basename or full name is included in the list
" g:pathogen_disabled.
function! pathogen#is_disabled(path) " {{{1
if a:path =~# '\~$'
return 1
elseif !exists("g:pathogen_disabled")
return 0
endif
let sep = pathogen#separator()
let blacklist = g:pathogen_disabled
return index(blacklist, strpart(a:path, strridx(a:path, sep)+1)) != -1 && index(blacklist, a:path) != 1
endfunction "}}}1
" Prepend the given directory to the runtime path and append its corresponding
" after directory. If the directory is already included, move it to the
" outermost position. Wildcards are added as is. Ending a path in /{} causes
" all subdirectories to be added (except those in g:pathogen_disabled).
function! pathogen#surround(path) abort " {{{1
let sep = pathogen#separator()
let rtp = pathogen#split(&rtp)
if a:path =~# '[\\/]{}$'
let path = fnamemodify(a:path[0:-4], ':p:s?[\\/]\=$??')
let before = filter(pathogen#glob_directories(path.sep.'*'), '!pathogen#is_disabled(v:val)')
let after = filter(reverse(pathogen#glob_directories(path.sep."*".sep."after")), '!pathogen#is_disabled(v:val[0:-7])')
call filter(rtp,'v:val[0:strlen(path)-1] !=# path')
else
let path = fnamemodify(a:path, ':p:s?[\\/]\=$??')
let before = [path]
let after = [path . sep . 'after']
call filter(rtp, 'index(before + after, v:val) == -1')
endif
let &rtp = pathogen#join(before, rtp, after)
return &rtp
endfunction " }}}1
" Prepend all subdirectories of path to the rtp, and append all 'after'
" directories in those subdirectories. Deprecated.
function! pathogen#runtime_prepend_subdirectories(path) " {{{1
call s:warn('Change pathogen#runtime_prepend_subdirectories('.string(source_path).') to pathogen#surround('.string(source_path.'/{}').')')
return pathogen#surround(a:path . pathogen#separator() . '{}')
endfunction " }}}1
" For each directory in the runtime path, add a second entry with the given
" argument appended. If the argument ends in '/{}', add a separate entry for
" each subdirectory. The default argument is 'bundle/{}', which means that
" .vim/bundle/*, $VIM/vimfiles/bundle/*, $VIMRUNTIME/bundle/*,
" $VIM/vim/files/bundle/*/after, and .vim/bundle/*/after will be added (on
" UNIX).
function! pathogen#incubate(...) abort " {{{1
let sep = pathogen#separator()
let name = a:0 ? a:1 : 'bundle/{}'
if "\n".s:done_bundles =~# "\\M\n".name."\n"
return ""
endif
let s:done_bundles .= name . "\n"
let list = []
for dir in pathogen#split(&rtp)
if dir =~# '\<after$'
if name =~# '{}$'
let list += filter(pathogen#glob_directories(substitute(dir,'after$',name[0:-3],'').'*[^~]'.sep.'after'), '!pathogen#is_disabled(v:val[0:-7])') + [dir]
else
let list += [dir, substitute(dir, 'after$', '', '') . name . sep . 'after']
endif
else
if name =~# '{}$'
let list += [dir] + filter(pathogen#glob_directories(dir.sep.name[0:-3].'*[^~]'), '!pathogen#is_disabled(v:val)')
else
let list += [dir . sep . name, dir]
endif
endif
endfor
let &rtp = pathogen#join(pathogen#uniq(list))
return 1
endfunction " }}}1
" Deprecated alias for pathogen#incubate().
function! pathogen#runtime_append_all_bundles(...) abort " {{{1
call s:warn('Change pathogen#runtime_append_all_bundles('.string(source_path).') to pathogen#incubate('.string(source_path.'/{}').')')
return call('pathogen#incubate', map(copy(a:000, 'v:val . "/{}"'))
endfunction
let s:done_bundles = ''
" }}}1
" Invoke :helptags on all non-$VIM doc directories in runtimepath.
function! pathogen#helptags() abort " {{{1
let sep = pathogen#separator()
for glob in pathogen#split(&rtp)
for dir in split(glob(glob), "\n")
if (dir.sep)[0 : strlen($VIMRUNTIME)] !=# $VIMRUNTIME.sep && filewritable(dir.sep.'doc') == 2 && !empty(filter(split(glob(dir.sep.'doc'.sep.'*'),"\n>"),'!isdirectory(v:val)')) && (!filereadable(dir.sep.'doc'.sep.'tags') || filewritable(dir.sep.'doc'.sep.'tags'))
helptags `=dir.'/doc'`
endif
endfor
endfor
endfunction " }}}1
command! -bar Helptags :call pathogen#helptags()
" Execute the given command. This is basically a backdoor for --remote-expr.
function! pathogen#execute(...) abort " {{{1
for command in a:000
execute command
endfor
return ''
endfunction " }}}1
" Like findfile(), but hardcoded to use the runtimepath.
function! pathogen#runtime_findfile(file,count) abort "{{{1
let rtp = pathogen#join(1,pathogen#split(&rtp))
let file = findfile(a:file,rtp,a:count)
if file ==# ''
return ''
else
return fnamemodify(file,':p')
endif
endfunction " }}}1
" Backport of fnameescape().
function! pathogen#fnameescape(string) abort " {{{1
function! pathogen#fnameescape(string) abort
if exists('*fnameescape')
return fnameescape(a:string)
elseif a:string ==# '-'
@@ -254,7 +240,49 @@ function! pathogen#fnameescape(string) abort " {{{1
else
return substitute(escape(a:string," \t\n*?[{`$\\%#'\"|!<"),'^[+>]','\\&','')
endif
endfunction " }}}1
endfunction
" Like findfile(), but hardcoded to use the runtimepath.
function! pathogen#runtime_findfile(file,count) abort
let rtp = pathogen#join(1,pathogen#split(&rtp))
let file = findfile(a:file,rtp,a:count)
if file ==# ''
return ''
else
return fnamemodify(file,':p')
endif
endfunction
" Section: Deprecated
function! s:warn(msg) abort
echohl WarningMsg
echomsg a:msg
echohl NONE
endfunction
" Prepend all subdirectories of path to the rtp, and append all 'after'
" directories in those subdirectories. Deprecated.
function! pathogen#runtime_prepend_subdirectories(path) abort
call s:warn('Change pathogen#runtime_prepend_subdirectories('.string(a:path).') to pathogen#infect('.string(a:path.'/{}').')')
return pathogen#surround(a:path . pathogen#slash() . '{}')
endfunction
function! pathogen#incubate(...) abort
let name = a:0 ? a:1 : 'bundle/{}'
call s:warn('Change pathogen#incubate('.(a:0 ? string(a:1) : '').') to pathogen#infect('.string(name).')')
return pathogen#interpose(name)
endfunction
" Deprecated alias for pathogen#interpose().
function! pathogen#runtime_append_all_bundles(...) abort
if a:0
call s:warn('Change pathogen#runtime_append_all_bundles('.string(a:1).') to pathogen#infect('.string(a:1.'/{}').')')
else
call s:warn('Change pathogen#runtime_append_all_bundles() to pathogen#infect()')
endif
return pathogen#interpose(a:0 ? a:1 . '/{}' : 'bundle/{}')
endfunction
if exists(':Vedit')
finish
@@ -262,7 +290,7 @@ endif
let s:vopen_warning = 0
function! s:find(count,cmd,file,lcd) " {{{1
function! s:find(count,cmd,file,lcd)
let rtp = pathogen#join(1,pathogen#split(&runtimepath))
let file = pathogen#runtime_findfile(a:file,a:count)
if file ==# ''
@@ -281,10 +309,10 @@ function! s:find(count,cmd,file,lcd) " {{{1
else
return a:cmd.' '.pathogen#fnameescape(file) . warning
endif
endfunction " }}}1
endfunction
function! s:Findcomplete(A,L,P) " {{{1
let sep = pathogen#separator()
function! s:Findcomplete(A,L,P)
let sep = pathogen#slash()
let cheats = {
\'a': 'autoload',
\'d': 'doc',
@@ -309,7 +337,7 @@ function! s:Findcomplete(A,L,P) " {{{1
endfor
endfor
return sort(keys(found))
endfunction " }}}1
endfunction
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Ve :execute s:find(<count>,'edit<bang>',<q-args>,0)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vedit :execute s:find(<count>,'edit<bang>',<q-args>,0)
@@ -320,4 +348,4 @@ command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vtabed
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vpedit :execute s:find(<count>,'pedit',<q-args>,<bang>1)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vread :execute s:find(<count>,'read',<q-args>,<bang>1)
" vim:set et sw=2:
" vim:set et sw=2 foldmethod=expr foldexpr=getline(v\:lnum)=~'^\"\ Section\:'?'>1'\:getline(v\:lnum)=~#'^fu'?'a1'\:getline(v\:lnum)=~#'^endf'?'s1'\:'=':