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.
This commit is contained in:
Tim Pope
2015-12-21 20:31:13 -05:00
parent a6004fd531
commit e2f96ded89
+6 -4
View File
@@ -178,16 +178,18 @@ function! pathogen#expand(pattern, ...) abort
let found = map(split(pat, ',', 1), 'pre.v:val.post')
let results = []
for pattern in found
call extend(results, call('pathogen#expand', [pattern] + a:000))
call extend(results, pathogen#expand(pattern))
endfor
elseif a:pattern =~# '{}'
let pat = matchstr(a:pattern.after, '^.*{}[^*]*\%($\|[\\/]\)')
let post = (a:pattern.after)[strlen(pat) : -1]
let post = a:pattern[strlen(pat) : -1]
let results = map(split(glob(substitute(pat, '{}', '*', 'g')), "\n"), 'v:val.post')
else
let results = [a:pattern.after]
let results = [a:pattern]
endif
return results
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.