blob: af56944ce314a36de0a4771cb39e1ef6451d5791 [file] [log] [blame]
Bram Moolenaar60a795a2005-09-16 21:55:43 +00001" zip.vim: Handles browsing zipfiles
2" AUTOLOAD PORTION
Bram Moolenaare37d50a2008-08-06 17:06:04 +00003" Date: Jul 30, 2008
4" Version: 22
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 Moolenaar60a795a2005-09-16 21:55:43 +000019let s:keepcpo= &cpo
20set cpo&vim
Bram Moolenaar9964e462007-05-05 17:54:07 +000021if &cp || exists("g:loaded_zip") || v:version < 700
Bram Moolenaar60a795a2005-09-16 21:55:43 +000022 finish
23endif
24
Bram Moolenaare37d50a2008-08-06 17:06:04 +000025let g:loaded_zip = "v22"
Bram Moolenaardb552d602006-03-23 22:59:57 +000026let s:zipfile_escape = ' ?&;\'
Bram Moolenaar9964e462007-05-05 17:54:07 +000027let s:ERROR = 2
28let s:WARNING = 1
29let s:NOTE = 0
30
31" ---------------------------------------------------------------------
32" Global Values: {{{1
33if !exists("g:zip_shq")
Bram Moolenaar446cb832008-06-24 21:56:24 +000034 if &shq != ""
35 let g:zip_shq= &shq
36 elseif has("unix")
Bram Moolenaar9964e462007-05-05 17:54:07 +000037 let g:zip_shq= "'"
38 else
39 let g:zip_shq= '"'
40 endif
41endif
Bram Moolenaarccc18222007-05-10 18:25:20 +000042if !exists("g:zip_zipcmd")
43 let g:zip_zipcmd= "zip"
44endif
45if !exists("g:zip_unzipcmd")
46 let g:zip_unzipcmd= "unzip"
47endif
Bram Moolenaar60a795a2005-09-16 21:55:43 +000048
49" ----------------
50" Functions: {{{1
51" ----------------
52
53" ---------------------------------------------------------------------
54" zip#Browse: {{{2
55fun! zip#Browse(zipfile)
56" call Dfunc("zip#Browse(zipfile<".a:zipfile.">)")
Bram Moolenaar36c31f72005-11-28 23:01:53 +000057 let repkeep= &report
58 set report=10
Bram Moolenaar60a795a2005-09-16 21:55:43 +000059
60 " sanity checks
Bram Moolenaare37d50a2008-08-06 17:06:04 +000061 if !exists("*fnameescape")
62 if &verbose > 1
63 echoerr "the zip plugin is not available (your vim doens't support fnameescape())"
64 endif
65 return
66 endif
Bram Moolenaarccc18222007-05-10 18:25:20 +000067 if !executable(g:zip_unzipcmd)
Bram Moolenaar9964e462007-05-05 17:54:07 +000068 redraw!
Bram Moolenaar60a795a2005-09-16 21:55:43 +000069 echohl Error | echo "***error*** (zip#Browse) unzip not available on your system"
Bram Moolenaar9964e462007-05-05 17:54:07 +000070" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
Bram Moolenaar36c31f72005-11-28 23:01:53 +000071 let &report= repkeep
Bram Moolenaar60a795a2005-09-16 21:55:43 +000072" call Dret("zip#Browse")
73 return
74 endif
75 if !filereadable(a:zipfile)
Bram Moolenaara5792f52005-11-23 21:25:05 +000076 if a:zipfile !~# '^\a\+://'
77 " if its an url, don't complain, let url-handlers such as vim do its thing
Bram Moolenaar9964e462007-05-05 17:54:07 +000078 redraw!
Bram Moolenaara5792f52005-11-23 21:25:05 +000079 echohl Error | echo "***error*** (zip#Browse) File not readable<".a:zipfile.">" | echohl None
Bram Moolenaar9964e462007-05-05 17:54:07 +000080" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
Bram Moolenaara5792f52005-11-23 21:25:05 +000081 endif
Bram Moolenaar36c31f72005-11-28 23:01:53 +000082 let &report= repkeep
Bram Moolenaara5792f52005-11-23 21:25:05 +000083" call Dret("zip#Browse : file<".a:zipfile."> not readable")
Bram Moolenaar60a795a2005-09-16 21:55:43 +000084 return
85 endif
Bram Moolenaardb552d602006-03-23 22:59:57 +000086" call Decho("passed sanity checks")
Bram Moolenaar60a795a2005-09-16 21:55:43 +000087 if &ma != 1
88 set ma
89 endif
Bram Moolenaarccc18222007-05-10 18:25:20 +000090 let b:zipfile= a:zipfile
Bram Moolenaar60a795a2005-09-16 21:55:43 +000091
92 setlocal noswapfile
93 setlocal buftype=nofile
94 setlocal bufhidden=hide
95 setlocal nobuflisted
96 setlocal nowrap
97 set ft=tar
98
99 " give header
Bram Moolenaarc236c162008-07-13 17:41:49 +0000100 let lastline= line("$")
101 call setline(lastline+1,'" zip.vim version '.g:loaded_zip)
102 call setline(lastline+2,'" Browsing zipfile '.a:zipfile)
103 call setline(lastline+3,'" Select a file with cursor and press ENTER')
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000104 $put =''
105 0d
106 $
107
Bram Moolenaare37d50a2008-08-06 17:06:04 +0000108" call Decho("exe silent r! ".g:zip_unzipcmd." -l -- ".s:Escape(a:zipfile,1))
109 exe "silent r! ".g:zip_unzipcmd." -l -- ".s:Escape(a:zipfile,1)
Bram Moolenaard68071d2006-05-02 22:08:30 +0000110 if v:shell_error != 0
Bram Moolenaar9964e462007-05-05 17:54:07 +0000111 redraw!
Bram Moolenaarc236c162008-07-13 17:41:49 +0000112 echohl WarningMsg | echo "***warning*** (zip#Browse) ".fnameescape(a:zipfile)." is not a zip file" | echohl None
Bram Moolenaar9964e462007-05-05 17:54:07 +0000113" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
Bram Moolenaard68071d2006-05-02 22:08:30 +0000114 silent %d
115 let eikeep= &ei
116 set ei=BufReadCmd,FileReadCmd
Bram Moolenaarc236c162008-07-13 17:41:49 +0000117 exe "r ".fnameescape(a:zipfile)
Bram Moolenaard68071d2006-05-02 22:08:30 +0000118 let &ei= eikeep
119 1d
120" call Dret("zip#Browse")
121 return
122 endif
Bram Moolenaar910f66f2006-04-05 20:41:53 +0000123" call Decho("line 6: ".getline(6))
124 let namecol= stridx(getline(6),'Name') + 1
125" call Decho("namecol=".namecol)
126 4,$g/^\s*----/d
127 4,$g/^\s*\a/d
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000128 $d
Bram Moolenaar4c3f5362006-04-11 21:38:50 +0000129 if namecol > 0
130 exe 'silent 4,$s/^.*\%'.namecol.'c//'
131 endif
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000132
133 setlocal noma nomod ro
134 noremap <silent> <buffer> <cr> :call <SID>ZipBrowseSelect()<cr>
135
Bram Moolenaar36c31f72005-11-28 23:01:53 +0000136 let &report= repkeep
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000137" call Dret("zip#Browse")
138endfun
139
140" ---------------------------------------------------------------------
141" ZipBrowseSelect: {{{2
142fun! s:ZipBrowseSelect()
Bram Moolenaarccc18222007-05-10 18:25:20 +0000143" call Dfunc("ZipBrowseSelect() zipfile<".b:zipfile."> curfile<".expand("%").">")
Bram Moolenaar36c31f72005-11-28 23:01:53 +0000144 let repkeep= &report
145 set report=10
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000146 let fname= getline(".")
147
148 " sanity check
149 if fname =~ '^"'
Bram Moolenaar36c31f72005-11-28 23:01:53 +0000150 let &report= repkeep
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000151" call Dret("ZipBrowseSelect")
152 return
153 endif
154 if fname =~ '/$'
Bram Moolenaar9964e462007-05-05 17:54:07 +0000155 redraw!
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000156 echohl Error | echo "***error*** (zip#Browse) Please specify a file, not a directory" | echohl None
Bram Moolenaar9964e462007-05-05 17:54:07 +0000157" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
Bram Moolenaar36c31f72005-11-28 23:01:53 +0000158 let &report= repkeep
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000159" call Dret("ZipBrowseSelect")
160 return
161 endif
162
163" call Decho("fname<".fname.">")
164
165 " get zipfile to the new-window
Bram Moolenaarccc18222007-05-10 18:25:20 +0000166 let zipfile = b:zipfile
Bram Moolenaar910f66f2006-04-05 20:41:53 +0000167 let curfile= expand("%")
Bram Moolenaardb552d602006-03-23 22:59:57 +0000168" call Decho("zipfile<".zipfile.">")
169" call Decho("curfile<".curfile.">")
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000170
171 new
Bram Moolenaar446cb832008-06-24 21:56:24 +0000172 if !exists("g:zip_nomax") || g:zip_nomax == 0
173 wincmd _
174 endif
Bram Moolenaara5792f52005-11-23 21:25:05 +0000175 let s:zipfile_{winnr()}= curfile
Bram Moolenaarc236c162008-07-13 17:41:49 +0000176" call Decho("exe e ".fnameescape("zipfile:".zipfile.'::'.fname))
177 exe "e ".fnameescape("zipfile:".zipfile.'::'.fname)
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000178 filetype detect
179
Bram Moolenaar36c31f72005-11-28 23:01:53 +0000180 let &report= repkeep
Bram Moolenaara5792f52005-11-23 21:25:05 +0000181" call Dret("ZipBrowseSelect : s:zipfile_".winnr()."<".s:zipfile_{winnr()}.">")
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000182endfun
183
184" ---------------------------------------------------------------------
185" zip#Read: {{{2
186fun! zip#Read(fname,mode)
187" call Dfunc("zip#Read(fname<".a:fname.">,mode=".a:mode.")")
Bram Moolenaar36c31f72005-11-28 23:01:53 +0000188 let repkeep= &report
189 set report=10
190
Bram Moolenaard68071d2006-05-02 22:08:30 +0000191 if has("unix")
192 let zipfile = substitute(a:fname,'zipfile:\(.\{-}\)::[^\\].*$','\1','')
193 let fname = substitute(a:fname,'zipfile:.\{-}::\([^\\].*\)$','\1','')
194 else
195 let zipfile = substitute(a:fname,'^.\{-}zipfile:\(.\{-}\)::[^\\].*$','\1','')
196 let fname = substitute(a:fname,'^.\{-}zipfile:.\{-}::\([^\\].*\)$','\1','')
Bram Moolenaar9964e462007-05-05 17:54:07 +0000197 let fname = substitute(fname, '[', '[[]', 'g')
Bram Moolenaard68071d2006-05-02 22:08:30 +0000198 endif
199" call Decho("zipfile<".zipfile.">")
200" call Decho("fname <".fname.">")
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000201
Bram Moolenaare37d50a2008-08-06 17:06:04 +0000202" call Decho("exe r! ".g:zip_unzipcmd." -p -- ".s:Escape(zipfile,1)." ".s:Escape(fname,1))
203 exe "silent r! ".g:zip_unzipcmd." -p -- ".s:Escape(zipfile,1)." ".s:Escape(fname,1)
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000204
205 " cleanup
206 0d
207 set nomod
208
Bram Moolenaar36c31f72005-11-28 23:01:53 +0000209 let &report= repkeep
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000210" call Dret("zip#Read")
211endfun
212
213" ---------------------------------------------------------------------
214" zip#Write: {{{2
215fun! zip#Write(fname)
Bram Moolenaar910f66f2006-04-05 20:41:53 +0000216" call Dfunc("zip#Write(fname<".a:fname.">) zipfile_".winnr()."<".s:zipfile_{winnr()}.">")
Bram Moolenaar36c31f72005-11-28 23:01:53 +0000217 let repkeep= &report
218 set report=10
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000219
220 " sanity checks
Bram Moolenaarccc18222007-05-10 18:25:20 +0000221 if !executable(g:zip_zipcmd)
Bram Moolenaar9964e462007-05-05 17:54:07 +0000222 redraw!
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000223 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 +0000224" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
Bram Moolenaar36c31f72005-11-28 23:01:53 +0000225 let &report= repkeep
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000226" call Dret("zip#Write")
227 return
228 endif
229 if !exists("*mkdir")
Bram Moolenaar9964e462007-05-05 17:54:07 +0000230 redraw!
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000231 echohl Error | echo "***error*** (zip#Write) sorry, mkdir() doesn't work on your system" | echohl None
Bram Moolenaar9964e462007-05-05 17:54:07 +0000232" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
Bram Moolenaar36c31f72005-11-28 23:01:53 +0000233 let &report= repkeep
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000234" call Dret("zip#Write")
235 return
236 endif
237
238 let curdir= getcwd()
239 let tmpdir= tempname()
240" call Decho("orig tempname<".tmpdir.">")
241 if tmpdir =~ '\.'
242 let tmpdir= substitute(tmpdir,'\.[^.]*$','','e')
243 endif
244" call Decho("tmpdir<".tmpdir.">")
245 call mkdir(tmpdir,"p")
246
247 " attempt to change to the indicated directory
Bram Moolenaar9964e462007-05-05 17:54:07 +0000248 if s:ChgDir(tmpdir,s:ERROR,"(zip#Write) cannot cd to temporary directory")
Bram Moolenaar36c31f72005-11-28 23:01:53 +0000249 let &report= repkeep
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000250" call Dret("zip#Write")
251 return
Bram Moolenaar9964e462007-05-05 17:54:07 +0000252 endif
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000253" call Decho("current directory now: ".getcwd())
254
255 " place temporary files under .../_ZIPVIM_/
256 if isdirectory("_ZIPVIM_")
257 call s:Rmdir("_ZIPVIM_")
258 endif
259 call mkdir("_ZIPVIM_")
260 cd _ZIPVIM_
261" call Decho("current directory now: ".getcwd())
262
Bram Moolenaard68071d2006-05-02 22:08:30 +0000263 if has("unix")
264 let zipfile = substitute(a:fname,'zipfile:\(.\{-}\)::[^\\].*$','\1','')
265 let fname = substitute(a:fname,'zipfile:.\{-}::\([^\\].*\)$','\1','')
266 else
267 let zipfile = substitute(a:fname,'^.\{-}zipfile:\(.\{-}\)::[^\\].*$','\1','')
268 let fname = substitute(a:fname,'^.\{-}zipfile:.\{-}::\([^\\].*\)$','\1','')
269 endif
270" call Decho("zipfile<".zipfile.">")
271" call Decho("fname <".fname.">")
Bram Moolenaarc7486e02005-12-29 22:48:26 +0000272
273 if fname =~ '/'
274 let dirpath = substitute(fname,'/[^/]\+$','','e')
275 if executable("cygpath")
Bram Moolenaarc236c162008-07-13 17:41:49 +0000276 let dirpath = substitute(system("cygpath ".s:Escape(dirpath,0)),'\n','','e')
Bram Moolenaarc7486e02005-12-29 22:48:26 +0000277 endif
Bram Moolenaar910f66f2006-04-05 20:41:53 +0000278" call Decho("mkdir(dirpath<".dirpath.">,p)")
Bram Moolenaarc7486e02005-12-29 22:48:26 +0000279 call mkdir(dirpath,"p")
280 endif
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000281 if zipfile !~ '/'
282 let zipfile= curdir.'/'.zipfile
283 endif
284" call Decho("zipfile<".zipfile."> fname<".fname.">")
285
Bram Moolenaarc236c162008-07-13 17:41:49 +0000286 exe "w! ".fnameescape(fname)
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000287 if executable("cygpath")
Bram Moolenaarc236c162008-07-13 17:41:49 +0000288 let zipfile = substitute(system("cygpath ".s:Escape(zipfile,0)),'\n','','e')
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000289 endif
290
Bram Moolenaar9964e462007-05-05 17:54:07 +0000291 if (has("win32") || has("win95") || has("win64") || has("win16")) && &shell !~? 'sh$'
292 let fname = substitute(fname, '[', '[[]', 'g')
293 endif
294
Bram Moolenaare37d50a2008-08-06 17:06:04 +0000295" call Decho(g:zip_zipcmd." -u ".s:Escape(fnamemodify(zipfile,":p"),0)." ".s:Escape(fname,0))
296 call system(g:zip_zipcmd." -u ".s:Escape(fnamemodify(zipfile,":p"),0)." ".s:Escape(fname,0))
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000297 if v:shell_error != 0
Bram Moolenaar9964e462007-05-05 17:54:07 +0000298 redraw!
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000299 echohl Error | echo "***error*** (zip#Write) sorry, unable to update ".zipfile." with ".fname | echohl None
Bram Moolenaar9964e462007-05-05 17:54:07 +0000300" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
Bram Moolenaara5792f52005-11-23 21:25:05 +0000301
302 elseif s:zipfile_{winnr()} =~ '^\a\+://'
303 " support writing zipfiles across a network
304 let netzipfile= s:zipfile_{winnr()}
Bram Moolenaar9964e462007-05-05 17:54:07 +0000305" call Decho("handle writing <".zipfile."> across network as <".netzipfile.">")
Bram Moolenaara5792f52005-11-23 21:25:05 +0000306 1split|enew
307 let binkeep= &binary
308 let eikeep = &ei
309 set binary ei=all
Bram Moolenaarc236c162008-07-13 17:41:49 +0000310 exe "e! ".fnameescape(zipfile)
Bram Moolenaara5792f52005-11-23 21:25:05 +0000311 call netrw#NetWrite(netzipfile)
312 let &ei = eikeep
313 let &binary = binkeep
314 q!
315 unlet s:zipfile_{winnr()}
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000316 endif
317
318 " cleanup and restore current directory
319 cd ..
320 call s:Rmdir("_ZIPVIM_")
Bram Moolenaar9964e462007-05-05 17:54:07 +0000321 call s:ChgDir(curdir,s:WARNING,"(zip#Write) unable to return to ".curdir."!")
322 call s:Rmdir(tmpdir)
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000323 setlocal nomod
324
Bram Moolenaar36c31f72005-11-28 23:01:53 +0000325 let &report= repkeep
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000326" call Dret("zip#Write")
327endfun
328
329" ---------------------------------------------------------------------
Bram Moolenaarc236c162008-07-13 17:41:49 +0000330" s:Escape: {{{2
331fun! s:Escape(fname,isfilt)
332" call Dfunc("QuoteFileDir(fname<".a:fname."> isfilt=".a:isfilt.")")
333 if exists("*shellescape")
334 if a:isfilt
335 let qnameq= shellescape(a:fname,1)
336 else
337 let qnameq= shellescape(a:fname)
338 endif
Bram Moolenaar446cb832008-06-24 21:56:24 +0000339 else
340 let qnameq= g:zip_shq.escape(a:fname,g:zip_shq).g:zip_shq
341 endif
342" call Dret("QuoteFileDir <".qnameq.">")
343 return qnameq
Bram Moolenaar9964e462007-05-05 17:54:07 +0000344endfun
345
346" ---------------------------------------------------------------------
347" ChgDir: {{{2
348fun! s:ChgDir(newdir,errlvl,errmsg)
349" call Dfunc("ChgDir(newdir<".a:newdir."> errlvl=".a:errlvl." errmsg<".a:errmsg.">)")
350
Bram Moolenaar9964e462007-05-05 17:54:07 +0000351 try
Bram Moolenaare37d50a2008-08-06 17:06:04 +0000352 exe "cd ".fnameescape(a:newdir)
Bram Moolenaar9964e462007-05-05 17:54:07 +0000353 catch /^Vim\%((\a\+)\)\=:E344/
354 redraw!
355 if a:errlvl == s:NOTE
356 echo "***note*** ".a:errmsg
357 elseif a:errlvl == s:WARNING
358 echohl WarningMsg | echo "***warning*** ".a:errmsg | echohl NONE
359 elseif a:errlvl == s:ERROR
360 echohl Error | echo "***error*** ".a:errmsg | echohl NONE
361 endif
362" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
363" call Dret("ChgDir 1")
364 return 1
365 endtry
366
367" call Dret("ChgDir 0")
368 return 0
369endfun
370
371" ---------------------------------------------------------------------
Bram Moolenaarc236c162008-07-13 17:41:49 +0000372" s:Rmdir: {{{2
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000373fun! s:Rmdir(fname)
374" call Dfunc("Rmdir(fname<".a:fname.">)")
Bram Moolenaar9964e462007-05-05 17:54:07 +0000375 if (has("win32") || has("win95") || has("win64") || has("win16")) && &shell !~? 'sh$'
Bram Moolenaarc236c162008-07-13 17:41:49 +0000376 call system("rmdir /S/Q ".s:Escape(a:fname,0))
Bram Moolenaar9964e462007-05-05 17:54:07 +0000377 else
Bram Moolenaarc236c162008-07-13 17:41:49 +0000378 call system("/bin/rm -rf ".s:Escape(a:fname,0))
Bram Moolenaar60a795a2005-09-16 21:55:43 +0000379 endif
380" call Dret("Rmdir")
381endfun
382
383" ------------------------------------------------------------------------
384" Modelines And Restoration: {{{1
385let &cpo= s:keepcpo
386unlet s:keepcpo
Bram Moolenaarccc18222007-05-10 18:25:20 +0000387" vim:ts=8 fdm=marker