vimballPlugin.vim (3163B)
1 " vimballPlugin : construct a file containing both paths and files 2 " Maintainer: This runtime file is looking for a new maintainer. 3 " Original Author: Charles E. Campbell 4 " Copyright: (c) 2004-2014 by Charles E. Campbell 5 " The VIM LICENSE applies to Vimball.vim, and Vimball.txt 6 " (see |copyright|) except use "Vimball" instead of "Vim". 7 " No warranty, express or implied. 8 " *** *** Use At-Your-Own-Risk! *** *** 9 " 10 " (Rom 2:1 WEB) Therefore you are without excuse, O man, whoever you are who 11 " judge. For in that which you judge another, you condemn yourself. For 12 " you who judge practice the same things. 13 " GetLatestVimScripts: 1502 1 :AutoInstall: vimball.vim 14 15 " --------------------------------------------------------------------- 16 " Load Once: {{{1 17 if &cp || exists("g:loaded_vimballPlugin") 18 finish 19 endif 20 let g:loaded_vimballPlugin = "v37" 21 let s:keepcpo = &cpo 22 set cpo&vim 23 24 " ------------------------------------------------------------------------------ 25 " Public Interface: {{{1 26 com! -range -complete=file -nargs=+ -bang MkVimball call vimball#MkVimball(<line1>,<line2>,<bang>0,<f-args>) 27 com! -nargs=? -complete=dir UseVimball call vimball#Vimball(1,<f-args>) 28 com! -nargs=0 VimballList call vimball#Vimball(0) 29 com! -nargs=* -complete=dir RmVimball call vimball#SaveSettings()|call vimball#RmVimball(<f-args>)|call vimball#RestoreSettings() 30 augroup Vimball 31 au! 32 au BufEnter *.vba,*.vba.gz,*.vba.bz2,*.vba.bz3,*.vba.zip,*.vba.xz 33 \ if getline(1) =~ '^" Vimball Archiver' | 34 \ setlocal bt=nofile fmr=[[[,]]] fdm=marker|if &ff != 'unix'|setlocal ma ff=unix noma|endif|if line('$') > 1|call vimball#ShowMesg(0, "Source this file to extract it! (:so %)")|endif | 35 \ endif 36 au SourceCmd *.vba.gz,*.vba.bz2,*.vba.bz3,*.vba.zip,*.vba.xz let s:origfile=expand("%")|if expand("%")!=expand("<afile>") | exe "1sp" fnameescape(expand("<afile>"))|endif|call vimball#Decompress(expand("<amatch>"))|so %|if s:origfile!=expand("<afile>")|close|endif 37 au SourceCmd *.vba if expand("%")!=expand("<afile>") | exe "1sp" fnameescape(expand("<afile>"))|call vimball#Vimball(1)|close|else|call vimball#Vimball(1)|endif 38 au BufEnter *.vmb,*.vmb.gz,*.vmb.bz2,*.vmb.bz3,*.vmb.zip,*.vmb.xz 39 \ if getline(1) =~ '^" Vimball Archiver' | 40 \ setlocal bt=nofile fmr=[[[,]]] fdm=marker|if &ff != 'unix'|setlocal ma ff=unix noma|endif|if line('$') > 1|call vimball#ShowMesg(0,"Source this file to extract it! (:so %)")|endif | 41 \ endif 42 au SourceCmd *.vmb.gz,*.vmb.bz2,*.vmb.bz3,*.vmb.zip,*.vmb.xz let s:origfile=expand("%")|if expand("%")!=expand("<afile>") | exe "1sp" fnameescape(expand("<afile>"))|endif|call vimball#Decompress(expand("<amatch>"))|so %|if s:origfile!=expand("<afile>")|close|endif 43 au SourceCmd *.vmb if expand("%")!=expand("<afile>") | exe "1sp" fnameescape(expand("<afile>"))|call vimball#Vimball(1)|close|else|call vimball#Vimball(1)|endif 44 augroup END 45 46 " ===================================================================== 47 " Restoration And Modelines: {{{1 48 " vim: fdm=marker 49 let &cpo= s:keepcpo 50 unlet s:keepcpo 51 52 " vim: ts=4: