comparison vendor/vim-autoload/pathogen.vim @ 595:0e72765944d4

Update vendors
author nanaya <me@myconan.net>
date Wed, 22 Mar 2017 00:27:53 +0900
parents 7fbadf8bd22e
children b305f2ce5f88
comparison
equal deleted inserted replaced
594:2ac0fa5ba73c 595:0e72765944d4
284 call s:warn('Change pathogen#runtime_append_all_bundles() to pathogen#infect()') 284 call s:warn('Change pathogen#runtime_append_all_bundles() to pathogen#infect()')
285 endif 285 endif
286 return pathogen#interpose(a:0 ? a:1 . '/{}' : 'bundle/{}') 286 return pathogen#interpose(a:0 ? a:1 . '/{}' : 'bundle/{}')
287 endfunction 287 endfunction
288 288
289 if exists(':Vedit')
290 finish
291 endif
292
293 let s:vopen_warning = 0
294
295 function! s:find(count,cmd,file,lcd)
296 let rtp = pathogen#join(1,pathogen#split(&runtimepath))
297 let file = pathogen#runtime_findfile(a:file,a:count)
298 if file ==# ''
299 return "echoerr 'E345: Can''t find file \"".a:file."\" in runtimepath'"
300 endif
301 if !s:vopen_warning
302 let s:vopen_warning = 1
303 let warning = '|echohl WarningMsg|echo "Install scriptease.vim to continue using :V'.a:cmd.'"|echohl NONE'
304 else
305 let warning = ''
306 endif
307 if a:lcd
308 let path = file[0:-strlen(a:file)-2]
309 execute 'lcd `=path`'
310 return a:cmd.' '.pathogen#fnameescape(a:file) . warning
311 else
312 return a:cmd.' '.pathogen#fnameescape(file) . warning
313 endif
314 endfunction
315
316 function! s:Findcomplete(A,L,P)
317 let sep = pathogen#slash()
318 let cheats = {
319 \'a': 'autoload',
320 \'d': 'doc',
321 \'f': 'ftplugin',
322 \'i': 'indent',
323 \'p': 'plugin',
324 \'s': 'syntax'}
325 if a:A =~# '^\w[\\/]' && has_key(cheats,a:A[0])
326 let request = cheats[a:A[0]].a:A[1:-1]
327 else
328 let request = a:A
329 endif
330 let pattern = substitute(request,'/\|\'.sep,'*'.sep,'g').'*'
331 let found = {}
332 for path in pathogen#split(&runtimepath)
333 let path = expand(path, ':p')
334 let matches = split(glob(path.sep.pattern),"\n")
335 call map(matches,'isdirectory(v:val) ? v:val.sep : v:val')
336 call map(matches,'expand(v:val, ":p")[strlen(path)+1:-1]')
337 for match in matches
338 let found[match] = 1
339 endfor
340 endfor
341 return sort(keys(found))
342 endfunction
343
344 command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Ve :execute s:find(<count>,'edit<bang>',<q-args>,0)
345 command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vedit :execute s:find(<count>,'edit<bang>',<q-args>,0)
346 command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vopen :execute s:find(<count>,'edit<bang>',<q-args>,1)
347 command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vsplit :execute s:find(<count>,'split',<q-args>,<bang>1)
348 command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vvsplit :execute s:find(<count>,'vsplit',<q-args>,<bang>1)
349 command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vtabedit :execute s:find(<count>,'tabedit',<q-args>,<bang>1)
350 command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vpedit :execute s:find(<count>,'pedit',<q-args>,<bang>1)
351 command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vread :execute s:find(<count>,'read',<q-args>,<bang>1)
352
353 " vim:set et sw=2 foldmethod=expr foldexpr=getline(v\:lnum)=~'^\"\ Section\:'?'>1'\:getline(v\:lnum)=~#'^fu'?'a1'\:getline(v\:lnum)=~#'^endf'?'s1'\:'=': 289 " vim:set et sw=2 foldmethod=expr foldexpr=getline(v\:lnum)=~'^\"\ Section\:'?'>1'\:getline(v\:lnum)=~#'^fu'?'a1'\:getline(v\:lnum)=~#'^endf'?'s1'\:'=':