summaryrefslogtreecommitdiff
path: root/runtime/plugin
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2005-11-23 21:25:05 +0000
committerBram Moolenaar <Bram@vim.org>2005-11-23 21:25:05 +0000
commita5792f58905da28f0ab37e1c4c3cfd8171b2e602 (patch)
tree258ddcfde89bbf98b90d42dd6c297e1b22a20d09 /runtime/plugin
parentaf289d333a2985051948a53d510fa345df1ddeb3 (diff)
downloadvim-git-a5792f58905da28f0ab37e1c4c3cfd8171b2e602.tar.gz
updated for version 7.0158v7.0158
Diffstat (limited to 'runtime/plugin')
-rw-r--r--runtime/plugin/NetrwPlugin.vim156
-rw-r--r--runtime/plugin/NetrwSettings.vim157
-rw-r--r--runtime/plugin/netrwPlugin.vim12
-rw-r--r--runtime/plugin/tar.vim34
-rw-r--r--runtime/plugin/tarPlugin.vim36
-rw-r--r--runtime/plugin/zipPlugin.vim18
6 files changed, 346 insertions, 67 deletions
diff --git a/runtime/plugin/NetrwPlugin.vim b/runtime/plugin/NetrwPlugin.vim
new file mode 100644
index 000000000..f28c2eb03
--- /dev/null
+++ b/runtime/plugin/NetrwPlugin.vim
@@ -0,0 +1,156 @@
+" netrw.vim: Handles file transfer and remote directory listing across a network
+" PLUGIN PORTION
+" Last Change: Aug 31, 2005
+" Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
+" Version: 67
+" License: Vim License (see vim's :help license)
+" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
+" Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1
+" Permission is hereby granted to use and distribute this code,
+" with or without modifications, provided that this copyright
+" notice is copied with it. Like anything else that's free,
+" netrw.vim is provided *as is* and comes with no warranty
+" of any kind, either expressed or implied. By using this
+" plugin, you agree that in no event will the copyright
+" holder be liable for any damages resulting from the use
+" of this software.
+"
+" But be doers of the Word, and not only hearers, deluding your own selves {{{1
+" (James 1:22 RSV)
+" =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+
+" ---------------------------------------------------------------------
+" Load Once: {{{1
+if exists("g:loaded_netrw") || &cp
+ finish
+endif
+if v:version < 600
+ echoerr "***netrw*** doesn't support Vim version ".v:version
+ finish
+endif
+let g:loaded_netrw = "v67"
+if v:version < 700
+ let loaded_explorer = 1
+endif
+let s:keepcpo= &cpo
+set cpo&vim
+
+" ---------------------------------------------------------------------
+" Public Interface: {{{1
+
+" Local Browsing: {{{2
+augroup FileExplorer
+ au!
+ au BufEnter * call s:LocalBrowse(expand("<amatch>"))
+augroup END
+
+" Network Browsing Reading Writing: {{{2
+augroup Network
+ au!
+ if has("win32") || has("win95") || has("win64") || has("win16")
+ au BufReadCmd file://* exe "silent doau BufReadPre ".expand("<amatch>")|exe 'e '.substitute(expand("<amatch>"),"file:/*","","")|exe "silent doau BufReadPost ".expand("<amatch>")
+ else
+ au BufReadCmd file:///* exe "silent doau BufReadPre ".expand("<amatch>")|exe 'e /'.substitute(expand("<amatch>"),"file:/*","","")|exe "silent doau BufReadPost ".expand("<amatch>")
+ au BufReadCmd file://localhost/* exe "silent doau BufReadPre ".expand("<amatch>")|exe 'e /'.substitute(expand("<amatch>"),"file:/*","","")|exe "silent doau BufReadPost ".expand("<amatch>")
+ endif
+ au BufReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,rsync://*,sftp://* exe "silent doau BufReadPre ".expand("<amatch>")|exe "Nread 0r ".expand("<amatch>")|exe "silent doau BufReadPost ".expand("<amatch>")
+ au FileReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,rsync://*,sftp://* exe "silent doau BufReadPre ".expand("<amatch>")|exe "Nread " .expand("<amatch>")|exe "silent doau FileReadPost ".expand("<amatch>")
+ au BufWriteCmd ftp://*,rcp://*,scp://*,dav://*,rsync://*,sftp://* exe "silent doau BufWritePre ".expand("<amatch>")|exe "Nwrite " .expand("<amatch>")|exe "silent doau BufWritePost ".expand("<amatch>")
+ au FileWriteCmd ftp://*,rcp://*,scp://*,dav://*,rsync://*,sftp://* exe "silent doau BufWritePre ".expand("<amatch>")|exe "'[,']Nwrite " .expand("<amatch>")|exe "silent doau FileWritePost ".expand("<amatch>")
+augroup END
+
+" Commands: :Nread, :Nwrite, :NetUserPass {{{2
+com! -nargs=* Nread call netrw#NetSavePosn()<bar>call netrw#NetRead(<f-args>)<bar>call netrw#NetRestorePosn()
+com! -range=% -nargs=* Nwrite call netrw#NetSavePosn()<bar><line1>,<line2>call netrw#NetWrite(<f-args>)<bar>call netrw#NetRestorePosn()
+com! -nargs=* NetUserPass call NetUserPass(<f-args>)
+
+" Commands: :Explore, :Sexplore, Hexplore, Vexplore {{{2
+com! -nargs=? -bar -bang -count=0 Explore call netrw#Explore(<count>,0,0+<bang>0,<q-args>)
+com! -nargs=? -bar -bang -count=0 Sexplore call netrw#Explore(<count>,1,0+<bang>0,<q-args>)
+com! -nargs=? -bar -bang -count=0 Hexplore call netrw#Explore(<count>,1,2+<bang>0,<q-args>)
+com! -nargs=? -bar -bang -count=0 Vexplore call netrw#Explore(<count>,1,4+<bang>0,<q-args>)
+com! -nargs=? -bar -bang Nexplore call netrw#Explore(-1,0,0,<q-args>)
+com! -nargs=? -bar -bang Pexplore call netrw#Explore(-2,0,0,<q-args>)
+
+" Commands: NetrwSettings {{{2
+com! -nargs=0 NetrwSettings :call NetrwSettings#NetrwSettings()
+
+" ---------------------------------------------------------------------
+" LocalBrowse: {{{2
+fun! s:LocalBrowse(dirname)
+ " unfortunate interaction -- debugging calls can't be used here;
+ " the BufEnter event causes triggering when attempts to write to
+ " the DBG buffer are made.
+ if isdirectory(a:dirname)
+ call netrw#DirBrowse(a:dirname)
+ endif
+ " not a directory, ignore it
+endfun
+
+" ---------------------------------------------------------------------
+" NetrwStatusLine: {{{1
+fun! NetrwStatusLine()
+" let g:stlmsg= "Xbufnr=".w:netrw_explore_bufnr." bufnr=".bufnr(".")." Xline#".w:netrw_explore_line." line#".line(".")
+ if !exists("w:netrw_explore_bufnr") || w:netrw_explore_bufnr != bufnr(".") || !exists("w:netrw_explore_line") || w:netrw_explore_line != line(".") || !exists("w:netrw_explore_list")
+ let &stl= s:netrw_explore_stl
+ if exists("w:netrw_explore_bufnr")|unlet w:netrw_explore_bufnr|endif
+ if exists("w:netrw_explore_line")|unlet w:netrw_explore_line|endif
+ return ""
+ else
+ return "Match ".w:netrw_explore_mtchcnt." of ".w:netrw_explore_listlen
+ endif
+endfun
+
+" ------------------------------------------------------------------------
+" NetUserPass: set username and password for subsequent ftp transfer {{{1
+" Usage: :call NetUserPass() -- will prompt for userid and password
+" :call NetUserPass("uid") -- will prompt for password
+" :call NetUserPass("uid","password") -- sets global userid and password
+fun! NetUserPass(...)
+
+ " get/set userid
+ if a:0 == 0
+" call Dfunc("NetUserPass(a:0<".a:0.">)")
+ if !exists("g:netrw_uid") || g:netrw_uid == ""
+ " via prompt
+ let g:netrw_uid= input('Enter username: ')
+ endif
+ else " from command line
+" call Dfunc("NetUserPass(a:1<".a:1.">) {")
+ let g:netrw_uid= a:1
+ endif
+
+ " get password
+ if a:0 <= 1 " via prompt
+" call Decho("a:0=".a:0." case <=1:")
+ let g:netrw_passwd= inputsecret("Enter Password: ")
+ else " from command line
+" call Decho("a:0=".a:0." case >1: a:2<".a:2.">")
+ let g:netrw_passwd=a:2
+ endif
+" call Dret("NetUserPass")
+endfun
+
+" ------------------------------------------------------------------------
+" NetReadFixup: this sort of function is typically written by the user {{{1
+" to handle extra junk that their system's ftp dumps
+" into the transfer. This function is provided as an
+" example and as a fix for a Windows 95 problem: in my
+" experience, win95's ftp always dumped four blank lines
+" at the end of the transfer.
+if has("win95") && g:netrw_win95ftp
+ fun! NetReadFixup(method, line1, line2)
+" call Dfunc("NetReadFixup(method<".a:method."> line1=".a:line1." line2=".a:line2.")")
+ if method == 3 " ftp (no <.netrc>)
+ let fourblanklines= line2 - 3
+ silent fourblanklines.",".line2."g/^\s*/d"
+ endif
+" call Dret("NetReadFixup")
+ endfun
+endif
+
+let &cpo= s:keepcpo
+unlet s:keepcpo
+" ------------------------------------------------------------------------
+" Modelines: {{{1
+" vim:ts=8 fdm=marker
diff --git a/runtime/plugin/NetrwSettings.vim b/runtime/plugin/NetrwSettings.vim
new file mode 100644
index 000000000..eecdcd234
--- /dev/null
+++ b/runtime/plugin/NetrwSettings.vim
@@ -0,0 +1,157 @@
+" NetrwSettings.vim: makes netrw settings simpler
+" Last Change: Aug 16, 2005
+" Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
+" Version: 3
+" Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1
+" Permission is hereby granted to use and distribute this code,
+" with or without modifications, provided that this copyright
+" notice is copied with it. Like anything else that's free,
+" NetrwSettings.vim is provided *as is* and comes with no
+" warranty of any kind, either expressed or implied. By using
+" this plugin, you agree that in no event will the copyright
+" holder be liable for any damages resulting from the use
+" of this software.
+"
+" Mat 4:23 (WEB) Jesus went about in all Galilee, teaching in their {{{1
+" synagogues, preaching the gospel of the kingdom, and healing
+" every disease and every sickness among the people.
+" Load Once: {{{1
+if exists("g:loaded_NetrwSettings") || &cp
+ finish
+endif
+let g:loaded_NetrwSettings = "v3"
+
+" ---------------------------------------------------------------------
+" NetrwSettings: {{{1
+fun! NetrwSettings#NetrwSettings()
+ " this call is here largely just to insure that netrw has been loaded
+ call netrw#NetSavePosn()
+
+ above wincmd s
+ enew
+ setlocal noswapfile bh=wipe
+ set ft=vim
+ file Netrw\ Settings
+
+ " these variables have the following default effects when they don't
+ " exist (ie. have not been set by the user in his/her .vimrc)
+ if !exists("g:netrw_longlist")
+ let g:netrw_longlist= 0
+ let g:netrw_list_cmd= "ssh HOSTNAME ls -FLa"
+ endif
+ if !exists("g:netrw_silent")
+ let g:netrw_silent= 0
+ endif
+ if !exists("g:netrw_use_nt_rcp")
+ let g:netrw_use_nt_rcp= 0
+ endif
+ if !exists("g:netrw_ftp")
+ let g:netrw_ftp= 0
+ endif
+ if !exists("g:netrw_ignorenetrc")
+ let g:netrw_ignorenetrc= 0
+ endif
+
+ put ='+ ---------------------------------------------'
+ put ='+ NetrwSettings: (by Charles E. Campbell, Jr.)'
+ put ='+ Press ? with cursor atop any line for help '
+ put ='+ ---------------------------------------------'
+ let s:netrw_settings_stop= line(".")
+
+ put =''
+ put ='+ Netrw Protocol Commands'
+ put = 'let g:netrw_dav_cmd = '.g:netrw_dav_cmd
+ put = 'let g:netrw_fetch_cmd = '.g:netrw_fetch_cmd
+ put = 'let g:netrw_ftp_cmd = '.g:netrw_ftp_cmd
+ put = 'let g:netrw_http_cmd = '.g:netrw_http_cmd
+ put = 'let g:netrw_rcp_cmd = '.g:netrw_rcp_cmd
+ put = 'let g:netrw_rsync_cmd = '.g:netrw_rsync_cmd
+ put = 'let g:netrw_scp_cmd = '.g:netrw_scp_cmd
+ put = 'let g:netrw_sftp_cmd = '.g:netrw_sftp_cmd
+ let s:netrw_protocol_stop= line(".")
+ put = ''
+
+ put ='+Netrw Transfer Control'
+ put = 'let g:netrw_cygwin = '.g:netrw_cygwin
+ put = 'let g:netrw_ftp = '.g:netrw_ftp
+ put = 'let g:netrw_ftpmode = '.g:netrw_ftpmode
+ put = 'let g:netrw_ignorenetrc = '.g:netrw_ignorenetrc
+ put = 'let g:netrw_use_nt_rcp = '.g:netrw_use_nt_rcp
+ put = 'let g:netrw_win95ftp = '.g:netrw_win95ftp
+ let s:netrw_xfer_stop= line(".")
+
+ put = ''
+ put ='+ Netrw Browser Control'
+ put = 'let g:netrw_alto = '.g:netrw_alto
+ put = 'let g:netrw_altv = '.g:netrw_altv
+ put = 'let g:netrw_dirhistmax = '.g:netrw_dirhistmax
+ put = 'let g:netrw_ftp_browse_reject = '.g:netrw_ftp_browse_reject
+ put = 'let g:netrw_ftp_list_cmd = '.g:netrw_ftp_list_cmd
+ put = 'let g:netrw_hide = '.g:netrw_hide
+ put = 'let g:netrw_keepdir = '.g:netrw_keepdir
+ put = 'let g:netrw_list_cmd = '.g:netrw_list_cmd
+ put = 'let g:netrw_list_cmd = '.g:netrw_list_cmd
+ put = 'let g:netrw_list_hide = '.g:netrw_list_hide
+ put = 'let g:netrw_local_mkdir = '.g:netrw_local_mkdir
+ put = 'let g:netrw_local_rmdir = '.g:netrw_local_rmdir
+ put = 'let g:netrw_longlist = '.g:netrw_longlist
+ put = 'let g:netrw_maxfilenamelen = '.g:netrw_maxfilenamelen
+ put = 'let g:netrw_mkdir_cmd = '.g:netrw_mkdir_cmd
+ put = 'let g:netrw_rename_cmd = '.g:netrw_rename_cmd
+ put = 'let g:netrw_rm_cmd = '.g:netrw_rm_cmd
+ put = 'let g:netrw_rmdir_cmd = '.g:netrw_rmdir_cmd
+ put = 'let g:netrw_rmf_cmd = '.g:netrw_rmf_cmd
+ put = 'let g:netrw_silent = '.g:netrw_silent
+ put = 'let g:netrw_sort_by = '.g:netrw_sort_by
+ put = 'let g:netrw_sort_direction = '.g:netrw_sort_direction
+ put = 'let g:netrw_sort_sequence = '.g:netrw_sort_sequence
+ put = 'let g:netrw_ssh_browse_reject = '.g:netrw_ssh_browse_reject
+ put = 'let g:netrw_timefmt = '.g:netrw_timefmt
+ put = 'let g:netrw_winsize = '.g:netrw_winsize
+
+ put =''
+ put ='+ For help, place cursor on line and press ?'
+
+ 1d
+ silent %s/^+/"/e
+ res 99
+ silent %s/= \([^0-9].*\)$/= '\1'/e
+ silent %s/= $/= ''/e
+ 1
+
+ set nomod
+
+ map <buffer> <silent> ? :call NetrwSettingHelp()<cr>
+ let tmpfile= tempname()
+ exe 'au BufWriteCmd Netrw\ Settings silent w! '.tmpfile.'|so '.tmpfile.'|call delete("'.tmpfile.'")|set nomod'
+endfun
+
+" ---------------------------------------------------------------------
+" NetrwSettingHelp: {{{2
+fun! NetrwSettingHelp()
+" call Dfunc("NetrwSettingHelp()")
+ let curline = getline(".")
+ if curline =~ '='
+ let varhelp = substitute(curline,'^\s*let ','','e')
+ let varhelp = substitute(varhelp,'\s*=.*$','','e')
+" call Decho("trying help ".varhelp)
+ try
+ exe "he ".varhelp
+ catch /^Vim\%((\a\+)\)\=:E149/
+ echo "***sorry*** no help available for <".varhelp.">"
+ endtry
+ elseif line(".") < s:netrw_settings_stop
+ he netrw-settings
+ elseif line(".") < s:netrw_protocol_stop
+ he netrw-externapp
+ elseif line(".") < s:netrw_xfer_stop
+ he netrw-variables
+ else
+ he netrw-browse-var
+ endif
+" call Dret("NetrwSettingHelp")
+endfun
+
+" ---------------------------------------------------------------------
+" Modelines: {{{1
+" vim:ts=8 fdm=marker
diff --git a/runtime/plugin/netrwPlugin.vim b/runtime/plugin/netrwPlugin.vim
index bc5a85a84..6e33d51c1 100644
--- a/runtime/plugin/netrwPlugin.vim
+++ b/runtime/plugin/netrwPlugin.vim
@@ -1,6 +1,6 @@
" netrwPlugin.vim: Handles file transfer and remote directory listing across a network
" PLUGIN PORTION
-" Date: Oct 12, 2005
+" Date: Oct 27, 2005
" Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
" Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1
@@ -42,15 +42,15 @@ augroup END
augroup Network
au!
if has("win32") || has("win95") || has("win64") || has("win16")
- au BufReadCmd file://* exe "silent doau BufReadPre ".expand("<amatch>")|exe 'e '.substitute(expand("<amatch>"),"file:/*","","")|exe "silent doau BufReadPost ".expand("<amatch>")
+ au BufReadCmd file://* exe "silent doau BufReadPre ".netrw#RFC2396(expand("<amatch>"))|exe 'e '.substitute(netrw#RFC2396(expand("<amatch>")),'file://\(.*\)','\1',"")|exe "silent doau BufReadPost ".netrw#RFC2396(expand("<amatch>"))
else
- au BufReadCmd file:///* exe "silent doau BufReadPre ".expand("<amatch>")|exe 'e /'.substitute(expand("<amatch>"),"file:/*","","")|exe "silent doau BufReadPost ".expand("<amatch>")
- au BufReadCmd file://localhost/* exe "silent doau BufReadPre ".expand("<amatch>")|exe 'e /'.substitute(expand("<amatch>"),"file:/*","","")|exe "silent doau BufReadPost ".expand("<amatch>")
+ au BufReadCmd file://* exe "silent doau BufReadPre ".netrw#RFC2396(expand("<amatch>"))|exe 'e '.substitute(netrw#RFC2396(expand("<amatch>")),'file://\(.*\)','\1',"")|exe "silent doau BufReadPost ".netrw#RFC2396(expand("<amatch>"))
+ au BufReadCmd file://localhost/* exe "silent doau BufReadPre ".netrw#RFC2396(expand("<amatch>"))|exe 'e '.substitute(netrw#RFC2396(expand("<amatch>")),'file://localhost/\(.*\)','\1',"")|exe "silent doau BufReadPost ".netrw#RFC2396(expand("<amatch>"))
endif
au BufReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,rsync://*,sftp://* exe "silent doau BufReadPre ".expand("<amatch>")|exe "Nread 0r ".expand("<amatch>")|exe "silent doau BufReadPost ".expand("<amatch>")
- au FileReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,rsync://*,sftp://* exe "silent doau BufReadPre ".expand("<amatch>")|exe "Nread " .expand("<amatch>")|exe "silent doau FileReadPost ".expand("<amatch>")
+ au FileReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,rsync://*,sftp://* exe "silent doau FileReadPre ".expand("<amatch>")|exe "Nread " .expand("<amatch>")|exe "silent doau FileReadPost ".expand("<amatch>")
au BufWriteCmd ftp://*,rcp://*,scp://*,dav://*,rsync://*,sftp://* exe "silent doau BufWritePre ".expand("<amatch>")|exe "Nwrite " .expand("<amatch>")|exe "silent doau BufWritePost ".expand("<amatch>")
- au FileWriteCmd ftp://*,rcp://*,scp://*,dav://*,rsync://*,sftp://* exe "silent doau BufWritePre ".expand("<amatch>")|exe "'[,']Nwrite " .expand("<amatch>")|exe "silent doau FileWritePost ".expand("<amatch>")
+ au FileWriteCmd ftp://*,rcp://*,scp://*,dav://*,rsync://*,sftp://* exe "silent doau FileWritePre ".expand("<amatch>")|exe "'[,']Nwrite " .expand("<amatch>")|exe "silent doau FileWritePost ".expand("<amatch>")
augroup END
" Commands: :Nread, :Nwrite, :NetUserPass {{{2
diff --git a/runtime/plugin/tar.vim b/runtime/plugin/tar.vim
deleted file mode 100644
index cc97f444b..000000000
--- a/runtime/plugin/tar.vim
+++ /dev/null
@@ -1,34 +0,0 @@
-" tar.vim -- a Vim plugin for browsing tarfiles
-" Copyright (c) 2002, Michael C. Toren <mct@toren.net>
-" Distributed under the GNU General Public License.
-"
-" Version: 1.01
-" Last Change: 2005 Jul 26
-"
-" Updates are available from <http://michael.toren.net/code/>. If you
-" find this script useful, or have suggestions for improvements, please
-" let me know.
-" Also look there for further comments and documentation.
-"
-" This part only sets the autocommands. The functions are in autoload/tar.vim.
-
-if has("autocmd")
- augroup tar
- au!
- au BufReadCmd tarfile:* call tar#Read(expand("<afile>"), 1)
- au BufReadCmd tarfile:*/* call tar#Read(expand("<afile>"), 1)
- au FileReadCmd tarfile:* call tar#Read(expand("<afile>"), 0)
- au FileReadCmd tarfile:*/* call tar#Read(expand("<afile>"), 0)
-
- au BufWriteCmd tarfile:* call tar#Write(expand("<afile>"))
- au BufWriteCmd tarfile:*/* call tar#Write(expand("<afile>"))
- au FileWriteCmd tarfile:* call tar#Write(expand("<afile>"))
- au FileWriteCmd tarfile:*/* call tar#Write(expand("<afile>"))
-
- au BufReadCmd *.tar call tar#Browse(expand("<afile>"))
- au BufReadCmd *.tar.gz call tar#Browse(expand("<afile>"))
- au BufReadCmd *.tar.bz2 call tar#Browse(expand("<afile>"))
- au BufReadCmd *.tar.Z call tar#Browse(expand("<afile>"))
- au BufReadCmd *.tgz call tar#Browse(expand("<afile>"))
- augroup END
-endif
diff --git a/runtime/plugin/tarPlugin.vim b/runtime/plugin/tarPlugin.vim
index b9a34aa07..506b4313d 100644
--- a/runtime/plugin/tarPlugin.vim
+++ b/runtime/plugin/tarPlugin.vim
@@ -9,25 +9,25 @@
"
" This part only sets the autocommands. The functions are in autoload/tar.vim.
-if has("autocmd")
- augroup tar
- au!
- au BufReadCmd tarfile:* call tar#Read(expand("<afile>"), 1)
- au BufReadCmd tarfile:*/* call tar#Read(expand("<afile>"), 1)
- au FileReadCmd tarfile:* call tar#Read(expand("<afile>"), 0)
- au FileReadCmd tarfile:*/* call tar#Read(expand("<afile>"), 0)
+augroup tar
+ au!
+ au BufReadCmd tarfile:* call tar#Read(expand("<amatch>"), 1)
+ au FileReadCmd tarfile:* call tar#Read(expand("<amatch>"), 0)
+ au BufWriteCmd tarfile:* call tar#Write(expand("<amatch>"))
+ au FileWriteCmd tarfile:* call tar#Write(expand("<amatch>"))
- au BufWriteCmd tarfile:* call tar#Write(expand("<afile>"))
- au BufWriteCmd tarfile:*/* call tar#Write(expand("<afile>"))
- au FileWriteCmd tarfile:* call tar#Write(expand("<afile>"))
- au FileWriteCmd tarfile:*/* call tar#Write(expand("<afile>"))
+ if has("unix")
+ au BufReadCmd tarfile:*/* call tar#Read(expand("<amatch>"), 1)
+ au FileReadCmd tarfile:*/* call tar#Read(expand("<amatch>"), 0)
+ au BufWriteCmd tarfile:*/* call tar#Write(expand("<amatch>"))
+ au FileWriteCmd tarfile:*/* call tar#Write(expand("<amatch>"))
+ endif
- au BufReadCmd *.tar call tar#Browse(expand("<afile>"))
- au BufReadCmd *.tar.gz call tar#Browse(expand("<afile>"))
- au BufReadCmd *.tar.bz2 call tar#Browse(expand("<afile>"))
- au BufReadCmd *.tar.Z call tar#Browse(expand("<afile>"))
- au BufReadCmd *.tgz call tar#Browse(expand("<afile>"))
- augroup END
-endif
+ au BufReadCmd *.tar call tar#Browse(expand("<amatch>"))
+ au BufReadCmd *.tar.gz call tar#Browse(expand("<amatch>"))
+ au BufReadCmd *.tar.bz2 call tar#Browse(expand("<amatch>"))
+ au BufReadCmd *.tar.Z call tar#Browse(expand("<amatch>"))
+ au BufReadCmd *.tgz call tar#Browse(expand("<amatch>"))
+augroup END
" vim: ts=8
diff --git a/runtime/plugin/zipPlugin.vim b/runtime/plugin/zipPlugin.vim
index 608edb554..20319a328 100644
--- a/runtime/plugin/zipPlugin.vim
+++ b/runtime/plugin/zipPlugin.vim
@@ -22,19 +22,19 @@ set cpo&vim
" Public Interface: {{{1
augroup zip
au!
- au BufReadCmd zipfile:* call zip#Read(expand("<afile>"), 1)
- au FileReadCmd zipfile:* call zip#Read(expand("<afile>"), 0)
- au BufWriteCmd zipfile:* call zip#Write(expand("<afile>"))
- au FileWriteCmd zipfile:* call zip#Write(expand("<afile>"))
+ au BufReadCmd zipfile:* call zip#Read(expand("<amatch>"), 1)
+ au FileReadCmd zipfile:* call zip#Read(expand("<amatch>"), 0)
+ au BufWriteCmd zipfile:* call zip#Write(expand("<amatch>"))
+ au FileWriteCmd zipfile:* call zip#Write(expand("<amatch>"))
if has("unix")
- au BufReadCmd zipfile:*/* call zip#Read(expand("<afile>"), 1)
- au FileReadCmd zipfile:*/* call zip#Read(expand("<afile>"), 0)
- au BufWriteCmd zipfile:*/* call zip#Write(expand("<afile>"))
- au FileWriteCmd zipfile:*/* call zip#Write(expand("<afile>"))
+ au BufReadCmd zipfile:*/* call zip#Read(expand("<amatch>"), 1)
+ au FileReadCmd zipfile:*/* call zip#Read(expand("<amatch>"), 0)
+ au BufWriteCmd zipfile:*/* call zip#Write(expand("<amatch>"))
+ au FileWriteCmd zipfile:*/* call zip#Write(expand("<amatch>"))
endif
- au BufReadCmd *.zip call zip#Browse(expand("<afile>"))
+ au BufReadCmd *.zip call zip#Browse(expand("<amatch>"))
augroup END
" ------------------------------------------------------------------------