blob: a55f1dccd3bbc51cc7175d242fc8cdb6b5e121c7 [file] [log] [blame]
Bram Moolenaar60a795a2005-09-16 21:55:43 +00001" zip.vim: Handles browsing zipfiles
2" AUTOLOAD PORTION
Bram Moolenaar00a927d2010-05-14 23:24:24 +02003" Date: Apr 12, 2010
4" Version: 23
Bram Moolenaar9964e462007-05-05 17:54:07 +00005" Maintainer: Charles E Campbell, Jr <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
6" License: Vim License (see vim's :help license)
Bram Moolenaar446cb832008-06-24 21:56:24 +00007" Copyright: Copyright (C) 2005-2008 Charles E. Campbell, Jr. {{{1
Bram Moolenaar60a795a2005-09-16 21:55:43 +00008" Permission is hereby granted to use and distribute this code,
9" with or without modifications, provided that this copyright
10" notice is copied with it. Like anything else that's free,
Bram Moolenaar446cb832008-06-24 21:56:24 +000011" zip.vim and zipPlugin.vim are provided *as is* and comes with
12" no warranty of any kind, either expressed or implied. By using
13" this plugin, you agree that in no event will the copyright
Bram Moolenaar60a795a2005-09-16 21:55:43 +000014" holder be liable for any damages resulting from the use
15" of this software.
16
17" ---------------------------------------------------------------------
Bram Moolenaar9964e462007-05-05 17:54:07 +000018" Load Once: {{{1
Bram Moolenaar00a927d2010-05-14 23:24:24 +020019if &cp || exists("g:loaded_zip")
Bram Moolenaar60a795a2005-09-16 21:55:43 +000020 finish
21endif
Bram Moolenaar00a927d2010-05-14 23:24:24 +020022let g:loaded_zip= "v23"
23if v:version < 702
24 echohl WarningMsg
25 echo "***warning*** this version of zip needs vim 7.2"
26 echohl Normal
27 finish
28endif
29let s:keepcpo= &cpo
30set cpo&vim
Bram Moolenaar60a795a2005-09-16 21:55:43 +000031
Bram Moolenaardb552d602006-03-23 22:59:57 +000032let s:zipfile_escape = ' ?&;\'
Bram Moolenaar9964e462007-05-05 17:54:07 +000033let s:ERROR = 2
34let s:WARNING = 1
35let s:NOTE = 0
36
37" ---------------------------------------------------------------------
38" Global Values: {{{1
39if !exists("g:zip_shq")
Bram Moolenaar446cb832008-06-24 21:56:24 +000040 if &shq != ""
41 let g:zip_shq= &shq
42 elseif has("unix")
Bram Moolenaar9964e462007-05-05 17:54:07 +000043 let g:zip_shq= "'"
44 else
45 let g:zip_shq= '"'
46 endif
47endif
Bram Moolenaarccc18222007-05-10 18:25:20 +000048if !exists("g:zip_zipcmd")
49 let g:zip_zipcmd= "zip"
50endif
51if !exists("g:zip_unzipcmd")
52 let g:zip_unzipcmd= "unzip"
53endif
Bram Moolenaar60a795a2005-09-16 21:55:43 +000054
55" ----------------
56" Functions: {{{1
57" ----------------
58
59" ---------------------------------------------------------------------
60" zip#Browse: {{{2
61fun! zip#Browse(zipfile)
62" call Dfunc("zip#Browse(zipfile<".a:zipfile.">)")
Bram Moolenaar36c31f72005-11-28 23:01:53 +000063 let repkeep= &report
64 set report=10
Bram Moolenaar60a795a2005-09-16 21:55:43 +000065
66 " sanity checks
Bram Moolenaare37d50a2008-08-06 17:06:04 +000067 if !exists("*fnameescape")
68 if &verbose > 1
69 echoerr "the zip plugin is not available (your vim doens't support fnameescape())"
70 endif
71 return
72 endif
Bram Moolenaarccc18222007-05-10 18:25:20 +000073 if !executable(g:zip_unzipcmd)
Bram Moolenaar9964e462007-05-05 17:54:07 +000074 redraw!
Bram Moolenaar60a795a2005-09-16 21:55:43 +000075 echohl Error | echo "***error*** (zip#Browse) unzip not available on your system"
Bram Moolenaar9964e462007-05-05 17:54:07 +000076" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
Bram Moolenaar36c31f72005-11-28 23:01:53 +000077 let &report= repkeep
Bram Moolenaar60a795a2005-09-16 21:55:43 +000078" call Dret("zip#Browse")
79 return
80 endif
81 if !filereadable(a:zipfile)
Bram Moolenaara5792f52005-11-23 21:25:05 +000082 if a:zipfile !~# '^\a\+://'
83 " if its an url, don't complain, let url-handlers such as vim do its thing
Bram Moolenaar9964e462007-05-05 17:54:07 +000084 redraw!
Bram Moolenaara5792f52005-11-23 21:25:05 +000085 echohl Error | echo "***error*** (zip#Browse) File not readable<".a:zipfile.">" | echohl None
Bram Moolenaar9964e462007-05-05 17:54:07 +000086" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
Bram Moolenaara5792f52005-11-23 21:25:05 +000087 endif
Bram Moolenaar36c31f72005-11-28 23:01:53 +000088 let &report= repkeep
Bram Moolenaara5792f52005-11-23 21:25:05 +000089" call Dret("zip#Browse : file<".a:zipfile."> not readable")
Bram Moolenaar60a795a2005-09-16 21:55:43 +000090 return
91 endif
Bram Moolenaardb552d602006-03-23 22:59:57 +000092" call Decho("passed sanity checks")
Bram Moolenaar60a795a2005-09-16 21:55:43 +000093 if &ma != 1
94 set ma
95 endif
Bram Moolenaarccc18222007-05-10 18:25:20 +000096 let b:zipfile= a:zipfile
Bram Moolenaar60a795a2005-09-16 21:55:43 +000097
98 setlocal noswapfile
99 setlocal buftype=nofile
100 setlocal bufhidden=hide
101 setlocal nobuflisted
102 setlocal nowrap
103 set ft=tar
104
105 " give header
Bram Moolenaarc236c162008-07-13 17:41:49 +0000106 let lastline= line("$")
107 call setline(lastline+1,'" zip.vim version '.g:loaded_zip)
108 call setline(lastline+2,'" Browsing zipfile '.a:zipfile)
109 call setline(lastline+3,'" Select a file with cursor and press ENTER')
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000110 $put =''
111 0d
112 $
113
Bram Moolenaare37d50a2008-08-06 17:06:04 +0000114" call Decho("exe silent r! ".g:zip_unzipcmd." -l -- ".s:Escape(a:zipfile,1))
115 exe "silent r! ".g:zip_unzipcmd." -l -- ".s:Escape(a:zipfile,1)
Bram Moolenaard68071d2006-05-02 22:08:30 +0000116 if v:shell_error != 0
Bram Moolenaar9964e462007-05-05 17:54:07 +0000117 redraw!
Bram Moolenaarc236c162008-07-13 17:41:49 +0000118 echohl WarningMsg | echo "***warning*** (zip#Browse) ".fnameescape(a:zipfile)." is not a zip file" | echohl None
Bram Moolenaar9964e462007-05-05 17:54:07 +0000119" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
Bram Moolenaard68071d2006-05-02 22:08:30 +0000120 silent %d
121 let eikeep= &ei
122 set ei=BufReadCmd,FileReadCmd
Bram Moolenaarc236c162008-07-13 17:41:49 +0000123 exe "r ".fnameescape(a:zipfile)
Bram Moolenaard68071d2006-05-02 22:08:30 +0000124 let &ei= eikeep
125 1d
126" call Dret("zip#Browse")
127 return
128 endif
Bram Moolenaar910f66f2006-04-05 20:41:53 +0000129" call Decho("line 6: ".getline(6))
130 let namecol= stridx(getline(6),'Name') + 1
131" call Decho("namecol=".namecol)
132 4,$g/^\s*----/d
133 4,$g/^\s*\a/d
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000134 $d
Bram Moolenaar4c3f5362006-04-11 21:38:50 +0000135 if namecol > 0
136 exe 'silent 4,$s/^.*\%'.namecol.'c//'
137 endif
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000138
139 setlocal noma nomod ro
140 noremap <silent> <buffer> <cr> :call <SID>ZipBrowseSelect()<cr>
141
Bram Moolenaar36c31f72005-11-28 23:01:53 +0000142 let &report= repkeep
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000143" call Dret("zip#Browse")
144endfun
145
146" ---------------------------------------------------------------------
147" ZipBrowseSelect: {{{2
148fun! s:ZipBrowseSelect()
Bram Moolenaarccc18222007-05-10 18:25:20 +0000149" call Dfunc("ZipBrowseSelect() zipfile<".b:zipfile."> curfile<".expand("%").">")
Bram Moolenaar36c31f72005-11-28 23:01:53 +0000150 let repkeep= &report
151 set report=10
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000152 let fname= getline(".")
153
154 " sanity check
155 if fname =~ '^"'
Bram Moolenaar36c31f72005-11-28 23:01:53 +0000156 let &report= repkeep
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000157" call Dret("ZipBrowseSelect")
158 return
159 endif
160 if fname =~ '/$'
Bram Moolenaar9964e462007-05-05 17:54:07 +0000161 redraw!
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000162 echohl Error | echo "***error*** (zip#Browse) Please specify a file, not a directory" | echohl None
Bram Moolenaar9964e462007-05-05 17:54:07 +0000163" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
Bram Moolenaar36c31f72005-11-28 23:01:53 +0000164 let &report= repkeep
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000165" call Dret("ZipBrowseSelect")
166 return
167 endif
168
169" call Decho("fname<".fname.">")
170
171 " get zipfile to the new-window
Bram Moolenaarccc18222007-05-10 18:25:20 +0000172 let zipfile = b:zipfile
Bram Moolenaar910f66f2006-04-05 20:41:53 +0000173 let curfile= expand("%")
Bram Moolenaardb552d602006-03-23 22:59:57 +0000174" call Decho("zipfile<".zipfile.">")
175" call Decho("curfile<".curfile.">")
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000176
177 new
Bram Moolenaar446cb832008-06-24 21:56:24 +0000178 if !exists("g:zip_nomax") || g:zip_nomax == 0
179 wincmd _
180 endif
Bram Moolenaara5792f52005-11-23 21:25:05 +0000181 let s:zipfile_{winnr()}= curfile
Bram Moolenaarc236c162008-07-13 17:41:49 +0000182" call Decho("exe e ".fnameescape("zipfile:".zipfile.'::'.fname))
183 exe "e ".fnameescape("zipfile:".zipfile.'::'.fname)
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000184 filetype detect
185
Bram Moolenaar36c31f72005-11-28 23:01:53 +0000186 let &report= repkeep
Bram Moolenaara5792f52005-11-23 21:25:05 +0000187" call Dret("ZipBrowseSelect : s:zipfile_".winnr()."<".s:zipfile_{winnr()}.">")
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000188endfun
189
190" ---------------------------------------------------------------------
191" zip#Read: {{{2
192fun! zip#Read(fname,mode)
193" call Dfunc("zip#Read(fname<".a:fname.">,mode=".a:mode.")")
Bram Moolenaar36c31f72005-11-28 23:01:53 +0000194 let repkeep= &report
195 set report=10
196
Bram Moolenaard68071d2006-05-02 22:08:30 +0000197 if has("unix")
198 let zipfile = substitute(a:fname,'zipfile:\(.\{-}\)::[^\\].*$','\1','')
199 let fname = substitute(a:fname,'zipfile:.\{-}::\([^\\].*\)$','\1','')
200 else
201 let zipfile = substitute(a:fname,'^.\{-}zipfile:\(.\{-}\)::[^\\].*$','\1','')
202 let fname = substitute(a:fname,'^.\{-}zipfile:.\{-}::\([^\\].*\)$','\1','')
Bram Moolenaar9964e462007-05-05 17:54:07 +0000203 let fname = substitute(fname, '[', '[[]', 'g')
Bram Moolenaard68071d2006-05-02 22:08:30 +0000204 endif
205" call Decho("zipfile<".zipfile.">")
206" call Decho("fname <".fname.">")
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000207
Bram Moolenaare37d50a2008-08-06 17:06:04 +0000208" call Decho("exe r! ".g:zip_unzipcmd." -p -- ".s:Escape(zipfile,1)." ".s:Escape(fname,1))
209 exe "silent r! ".g:zip_unzipcmd." -p -- ".s:Escape(zipfile,1)." ".s:Escape(fname,1)
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000210
211 " cleanup
212 0d
213 set nomod
214
Bram Moolenaar36c31f72005-11-28 23:01:53 +0000215 let &report= repkeep
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000216" call Dret("zip#Read")
217endfun
218
219" ---------------------------------------------------------------------
220" zip#Write: {{{2
221fun! zip#Write(fname)
Bram Moolenaar910f66f2006-04-05 20:41:53 +0000222" call Dfunc("zip#Write(fname<".a:fname.">) zipfile_".winnr()."<".s:zipfile_{winnr()}.">")
Bram Moolenaar36c31f72005-11-28 23:01:53 +0000223 let repkeep= &report
224 set report=10
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000225
226 " sanity checks
Bram Moolenaarccc18222007-05-10 18:25:20 +0000227 if !executable(g:zip_zipcmd)
Bram Moolenaar9964e462007-05-05 17:54:07 +0000228 redraw!
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000229 echohl Error | echo "***error*** (zip#Write) sorry, your system doesn't appear to have the zip pgm" | echohl None
Bram Moolenaar9964e462007-05-05 17:54:07 +0000230" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
Bram Moolenaar36c31f72005-11-28 23:01:53 +0000231 let &report= repkeep
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000232" call Dret("zip#Write")
233 return
234 endif
235 if !exists("*mkdir")
Bram Moolenaar9964e462007-05-05 17:54:07 +0000236 redraw!
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000237 echohl Error | echo "***error*** (zip#Write) sorry, mkdir() doesn't work on your system" | echohl None
Bram Moolenaar9964e462007-05-05 17:54:07 +0000238" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
Bram Moolenaar36c31f72005-11-28 23:01:53 +0000239 let &report= repkeep
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000240" call Dret("zip#Write")
241 return
242 endif
243
244 let curdir= getcwd()
245 let tmpdir= tempname()
246" call Decho("orig tempname<".tmpdir.">")
247 if tmpdir =~ '\.'
248 let tmpdir= substitute(tmpdir,'\.[^.]*$','','e')
249 endif
250" call Decho("tmpdir<".tmpdir.">")
251 call mkdir(tmpdir,"p")
252
253 " attempt to change to the indicated directory
Bram Moolenaar9964e462007-05-05 17:54:07 +0000254 if s:ChgDir(tmpdir,s:ERROR,"(zip#Write) cannot cd to temporary directory")
Bram Moolenaar36c31f72005-11-28 23:01:53 +0000255 let &report= repkeep
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000256" call Dret("zip#Write")
257 return
Bram Moolenaar9964e462007-05-05 17:54:07 +0000258 endif
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000259" call Decho("current directory now: ".getcwd())
260
261 " place temporary files under .../_ZIPVIM_/
262 if isdirectory("_ZIPVIM_")
263 call s:Rmdir("_ZIPVIM_")
264 endif
265 call mkdir("_ZIPVIM_")
266 cd _ZIPVIM_
267" call Decho("current directory now: ".getcwd())
268
Bram Moolenaard68071d2006-05-02 22:08:30 +0000269 if has("unix")
270 let zipfile = substitute(a:fname,'zipfile:\(.\{-}\)::[^\\].*$','\1','')
271 let fname = substitute(a:fname,'zipfile:.\{-}::\([^\\].*\)$','\1','')
272 else
273 let zipfile = substitute(a:fname,'^.\{-}zipfile:\(.\{-}\)::[^\\].*$','\1','')
274 let fname = substitute(a:fname,'^.\{-}zipfile:.\{-}::\([^\\].*\)$','\1','')
275 endif
276" call Decho("zipfile<".zipfile.">")
277" call Decho("fname <".fname.">")
Bram Moolenaarc7486e02005-12-29 22:48:26 +0000278
279 if fname =~ '/'
280 let dirpath = substitute(fname,'/[^/]\+$','','e')
281 if executable("cygpath")
Bram Moolenaarc236c162008-07-13 17:41:49 +0000282 let dirpath = substitute(system("cygpath ".s:Escape(dirpath,0)),'\n','','e')
Bram Moolenaarc7486e02005-12-29 22:48:26 +0000283 endif
Bram Moolenaar910f66f2006-04-05 20:41:53 +0000284" call Decho("mkdir(dirpath<".dirpath.">,p)")
Bram Moolenaarc7486e02005-12-29 22:48:26 +0000285 call mkdir(dirpath,"p")
286 endif
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000287 if zipfile !~ '/'
288 let zipfile= curdir.'/'.zipfile
289 endif
290" call Decho("zipfile<".zipfile."> fname<".fname.">")
291
Bram Moolenaarc236c162008-07-13 17:41:49 +0000292 exe "w! ".fnameescape(fname)
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000293 if executable("cygpath")
Bram Moolenaarc236c162008-07-13 17:41:49 +0000294 let zipfile = substitute(system("cygpath ".s:Escape(zipfile,0)),'\n','','e')
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000295 endif
296
Bram Moolenaar9964e462007-05-05 17:54:07 +0000297 if (has("win32") || has("win95") || has("win64") || has("win16")) && &shell !~? 'sh$'
298 let fname = substitute(fname, '[', '[[]', 'g')
299 endif
300
Bram Moolenaare37d50a2008-08-06 17:06:04 +0000301" call Decho(g:zip_zipcmd." -u ".s:Escape(fnamemodify(zipfile,":p"),0)." ".s:Escape(fname,0))
302 call system(g:zip_zipcmd." -u ".s:Escape(fnamemodify(zipfile,":p"),0)." ".s:Escape(fname,0))
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000303 if v:shell_error != 0
Bram Moolenaar9964e462007-05-05 17:54:07 +0000304 redraw!
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000305 echohl Error | echo "***error*** (zip#Write) sorry, unable to update ".zipfile." with ".fname | echohl None
Bram Moolenaar9964e462007-05-05 17:54:07 +0000306" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
Bram Moolenaara5792f52005-11-23 21:25:05 +0000307
308 elseif s:zipfile_{winnr()} =~ '^\a\+://'
309 " support writing zipfiles across a network
310 let netzipfile= s:zipfile_{winnr()}
Bram Moolenaar9964e462007-05-05 17:54:07 +0000311" call Decho("handle writing <".zipfile."> across network as <".netzipfile.">")
Bram Moolenaara5792f52005-11-23 21:25:05 +0000312 1split|enew
313 let binkeep= &binary
314 let eikeep = &ei
315 set binary ei=all
Bram Moolenaarc236c162008-07-13 17:41:49 +0000316 exe "e! ".fnameescape(zipfile)
Bram Moolenaara5792f52005-11-23 21:25:05 +0000317 call netrw#NetWrite(netzipfile)
318 let &ei = eikeep
319 let &binary = binkeep
320 q!
321 unlet s:zipfile_{winnr()}
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000322 endif
323
324 " cleanup and restore current directory
325 cd ..
326 call s:Rmdir("_ZIPVIM_")
Bram Moolenaar9964e462007-05-05 17:54:07 +0000327 call s:ChgDir(curdir,s:WARNING,"(zip#Write) unable to return to ".curdir."!")
328 call s:Rmdir(tmpdir)
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000329 setlocal nomod
330
Bram Moolenaar36c31f72005-11-28 23:01:53 +0000331 let &report= repkeep
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000332" call Dret("zip#Write")
333endfun
334
335" ---------------------------------------------------------------------
Bram Moolenaarc236c162008-07-13 17:41:49 +0000336" s:Escape: {{{2
337fun! s:Escape(fname,isfilt)
338" call Dfunc("QuoteFileDir(fname<".a:fname."> isfilt=".a:isfilt.")")
339 if exists("*shellescape")
340 if a:isfilt
341 let qnameq= shellescape(a:fname,1)
342 else
343 let qnameq= shellescape(a:fname)
344 endif
Bram Moolenaar446cb832008-06-24 21:56:24 +0000345 else
346 let qnameq= g:zip_shq.escape(a:fname,g:zip_shq).g:zip_shq
347 endif
348" call Dret("QuoteFileDir <".qnameq.">")
349 return qnameq
Bram Moolenaar9964e462007-05-05 17:54:07 +0000350endfun
351
352" ---------------------------------------------------------------------
353" ChgDir: {{{2
354fun! s:ChgDir(newdir,errlvl,errmsg)
355" call Dfunc("ChgDir(newdir<".a:newdir."> errlvl=".a:errlvl." errmsg<".a:errmsg.">)")
356
Bram Moolenaar9964e462007-05-05 17:54:07 +0000357 try
Bram Moolenaare37d50a2008-08-06 17:06:04 +0000358 exe "cd ".fnameescape(a:newdir)
Bram Moolenaar9964e462007-05-05 17:54:07 +0000359 catch /^Vim\%((\a\+)\)\=:E344/
360 redraw!
361 if a:errlvl == s:NOTE
362 echo "***note*** ".a:errmsg
363 elseif a:errlvl == s:WARNING
364 echohl WarningMsg | echo "***warning*** ".a:errmsg | echohl NONE
365 elseif a:errlvl == s:ERROR
366 echohl Error | echo "***error*** ".a:errmsg | echohl NONE
367 endif
368" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
369" call Dret("ChgDir 1")
370 return 1
371 endtry
372
373" call Dret("ChgDir 0")
374 return 0
375endfun
376
377" ---------------------------------------------------------------------
Bram Moolenaarc236c162008-07-13 17:41:49 +0000378" s:Rmdir: {{{2
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000379fun! s:Rmdir(fname)
380" call Dfunc("Rmdir(fname<".a:fname.">)")
Bram Moolenaar9964e462007-05-05 17:54:07 +0000381 if (has("win32") || has("win95") || has("win64") || has("win16")) && &shell !~? 'sh$'
Bram Moolenaarc236c162008-07-13 17:41:49 +0000382 call system("rmdir /S/Q ".s:Escape(a:fname,0))
Bram Moolenaar9964e462007-05-05 17:54:07 +0000383 else
Bram Moolenaarc236c162008-07-13 17:41:49 +0000384 call system("/bin/rm -rf ".s:Escape(a:fname,0))
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000385 endif
386" call Dret("Rmdir")
387endfun
388
389" ------------------------------------------------------------------------
390" Modelines And Restoration: {{{1
391let &cpo= s:keepcpo
392unlet s:keepcpo
Bram Moolenaarccc18222007-05-10 18:25:20 +0000393" vim:ts=8 fdm=marker