# HG changeset patch # User vimboss # Date 1141943559 0 # Node ID 82ef0c58b0120c4f60d9ef442160b20582532842 # Parent 7b21554be7a13772b52bc1a393b314e97c8f7a08 updated for version 7.0219 diff --git a/Filelist b/Filelist --- a/Filelist +++ b/Filelist @@ -498,6 +498,7 @@ RT_SCRIPTS = \ runtime/filetype.vim \ runtime/scripts.vim \ runtime/menu.vim \ + runtime/macmap.vim \ runtime/delmenu.vim \ runtime/synmenu.vim \ runtime/makemenu.vim \ diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim --- a/runtime/autoload/netrw.vim +++ b/runtime/autoload/netrw.vim @@ -1,7 +1,7 @@ " netrw.vim: Handles file transfer and remote directory listing across a network " AUTOLOAD PORTION -" Date: Jan 30, 2006 -" Version: 78 +" Date: Mar 09, 2006 +" Version: 79 " Maintainer: Charles E Campbell, Jr " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim " Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1 @@ -23,7 +23,7 @@ if &cp || exists("g:loaded_netrw") finish endif -let g:loaded_netrw = "v78" +let g:loaded_netrw = "v79" if v:version < 700 echohl WarningMsg | echo "***netrw*** you need vim version 7.0 or later for version ".g:loaded_netrw." of netrw" | echohl None finish @@ -76,7 +76,7 @@ if !exists("g:netrw_ssh_cmd") let g:netrw_ssh_cmd= "ssh" endif -if has("win32") || has("win95") || has("win64") || has("win16") +if (has("win32") || has("win95") || has("win64") || has("win16")) \ && exists("g:netrw_use_nt_rcp") \ && g:netrw_use_nt_rcp \ && executable( $SystemRoot .'/system32/rcp.exe') @@ -191,6 +191,9 @@ if exists("g:netrw_silent") && g:netrw_s else let g:netrw_silentxfer= "" endif +if !exists("g:netrw_fastbrowse") + let g:netrw_fastbrowse= 1 +endif if !exists("g:netrw_sort_by") " alternatives: date size let g:netrw_sort_by= "name" @@ -224,6 +227,12 @@ if !exists("s:netrw_cd_escape") let s:netrw_cd_escape="[]#*$%'\" ?`!&();<>\\" endif endif +if !exists("g:netrw_fname_escape") + let g:netrw_fname_escape= ' ?&;' +endif +if !exists("g:netrw_tmpfile_escape") + let g:netrw_tmpfile_escape= ' ?&;' +endif if !exists("s:netrw_glob_escape") if has("win32") || has("win95") || has("win64") || has("win16") let s:netrw_glob_escape= "" @@ -292,49 +301,48 @@ endfun " ------------------------------------------------------------------------ " NetRead: responsible for reading a file over the net {{{2 -fun! netrw#NetRead(...) -" call Dfunc("NetRead(a:1<".a:1.">)") - +fun! netrw#NetRead(mode,...) +" call Dfunc("NetRead(mode=".a:mode.",...) a:0=".a:0) + " save options call s:NetOptionSave() - - " Special Exception: if a file is named "0r", then {{{3 - " "0r" will be used to read the - " following files instead of "r" - if a:0 == 0 - let readcmd= "r" - let ichoice= 0 - elseif a:1 == "0r" + + if a:mode == 0 " read remote file before current line let readcmd = "0r" - let ichoice = 2 - else + elseif a:mode == 1 " read file after current line let readcmd = "r" - let ichoice = 1 + elseif a:mode == 2 " replace with remote file + let readcmd = "%r" + else + exe a:mode + let readcmd = "r" endif - + let ichoice = (a:0 == 0)? 0 : 1 +" call Decho("readcmd<".readcmd."> ichoice=".ichoice) + " get name of a temporary file and set up shell-quoting character {{{3 let tmpfile= tempname() - let tmpfile= substitute(tmpfile,'\','/','ge') + let tmpfile= escape(substitute(tmpfile,'\','/','ge'),g:netrw_tmpfile_escape) if !isdirectory(substitute(tmpfile,'[^/]\+$','','e')) echohl Error | echo "***netrw*** your <".substitute(tmpfile,'[^/]\+$','','e')."> directory is missing!" | echohl None call inputsave()|call input("Press to continue")|call inputrestore() " call Dret("NetRead") return endif - -" call Decho("ichoice=".ichoice." readcmd<".readcmd.">") +" call Decho("tmpfile<".tmpfile.">") + while ichoice <= a:0 - + " attempt to repeat with previous host-file-etc if exists("b:netrw_lastfile") && a:0 == 0 " call Decho("using b:netrw_lastfile<" . b:netrw_lastfile . ">") let choice = b:netrw_lastfile let ichoice= ichoice + 1 - + else exe "let choice= a:" . ichoice " call Decho("no lastfile: choice<" . choice . ">") - + if match(choice,"?") == 0 " give help echomsg 'NetRead Usage:' @@ -361,7 +369,7 @@ fun! netrw#NetRead(...) " case "... ... ..." let choice = strpart(choice,1,strlen(choice)-1) let wholechoice = "" - + while match(choice,"\"$") == -1 let wholechoice = wholechoice . " " . choice let ichoice = ichoice + 1 @@ -382,7 +390,7 @@ fun! netrw#NetRead(...) " call Decho("choice<" . choice . ">") let ichoice= ichoice + 1 - + " fix up windows urls if has("win32") || has("win95") || has("win64") || has("win16") let choice = substitute(choice,'\\','/','ge') @@ -391,10 +399,10 @@ fun! netrw#NetRead(...) exe 'lcd ' . fnamemodify(tmpfile,':h') let tmpfile = fnamemodify(tmpfile,':t') endif - + " Determine method of read (ftp, rcp, etc) {{{3 call s:NetMethod(choice) - + " Check if NetBrowse() should be handling this request " call Decho("checking if netlist: choice<".choice."> netrw_list_cmd<".g:netrw_list_cmd.">") if choice =~ "^.*[\/]$" @@ -409,14 +417,14 @@ fun! netrw#NetRead(...) let tmpfile= substitute(tmpfile,"$",suffix,'e') " call Decho("chgd tmpfile<".tmpfile."> (added ".suffix." suffix) netrw_fname<".b:netrw_fname.">") endif - + " ============ " Perform Protocol-Based Read {{{3 " =========================== if exists("g:netrw_silent") && g:netrw_silent == 0 && &ch >= 1 echo "(netrw) Processing your read request..." endif - + "......................................... " rcp: NetRead Method #1 {{{3 if b:netrw_method == 1 " read with rcp @@ -439,16 +447,16 @@ fun! netrw#NetRead(...) let uid_machine = g:netrw_machine endif endif -" call Decho("executing: !".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".uid_machine.":".escape(b:netrw_fname,' ?&')." ".tmpfile) - exe g:netrw_silentxfer."!".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".uid_machine.":".escape(b:netrw_fname,' ?&')." ".tmpfile +" call Decho("executing: !".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".uid_machine.":".escape(b:netrw_fname,' ?&;')." ".tmpfile) + exe g:netrw_silentxfer."!".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".uid_machine.":".escape(b:netrw_fname,' ?&;')." ".tmpfile let result = s:NetGetFile(readcmd, tmpfile, b:netrw_method) let b:netrw_lastfile = choice - + "......................................... " ftp + <.netrc>: NetRead Method #2 {{{3 elseif b:netrw_method == 2 " read with ftp + <.netrc> " call Decho("read via ftp+.netrc (method #2)") - let netrw_fname= b:netrw_fname + let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape) new setlocal ff=unix exe "put ='".g:netrw_ftpmode."'" @@ -473,13 +481,13 @@ fun! netrw#NetRead(...) bd! let result = s:NetGetFile(readcmd, tmpfile, b:netrw_method) let b:netrw_lastfile = choice - + "......................................... " ftp + machine,id,passwd,filename: NetRead Method #3 {{{3 elseif b:netrw_method == 3 " read with ftp + machine, id, passwd, and fname " Construct execution string (four lines) which will be passed through filter " call Decho("read via ftp+mipf (method #3)") - let netrw_fname= b:netrw_fname + let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape) new setlocal ff=unix if exists("g:netrw_port") && g:netrw_port != "" @@ -489,7 +497,7 @@ fun! netrw#NetRead(...) put ='open '.g:netrw_machine " call Decho("filter input: ".getline(".")) endif - + if exists("g:netrw_ftp") && g:netrw_ftp == 1 put =g:netrw_uid " call Decho("filter input: ".getline(".")) @@ -499,14 +507,14 @@ fun! netrw#NetRead(...) put ='user \"'.g:netrw_uid.'\" \"'.g:netrw_passwd.'\"' " call Decho("filter input: ".getline(".")) endif - + if exists("g:netrw_ftpmode") && g:netrw_ftpmode != "" put =g:netrw_ftpmode " call Decho("filter input: ".getline(".")) endif put ='get \"'.netrw_fname.'\" '.tmpfile " call Decho("filter input: ".getline(".")) - + " perform ftp: " -i : turns off interactive prompting from ftp " -n unix : DON'T use <.netrc>, even though it exists @@ -525,7 +533,7 @@ fun! netrw#NetRead(...) bd! let result = s:NetGetFile(readcmd, tmpfile, b:netrw_method) let b:netrw_lastfile = choice - + "......................................... " scp: NetRead Method #4 {{{3 elseif b:netrw_method == 4 " read with scp @@ -537,15 +545,15 @@ fun! netrw#NetRead(...) endif if g:netrw_cygwin == 1 let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e') -" call Decho("executing: !".g:netrw_scp_cmd.useport." '".g:netrw_machine.":".escape(b:netrw_fname,' ?&')."' ".cygtmpfile) - exe g:netrw_silentxfer."!".g:netrw_scp_cmd.useport." '".g:netrw_machine.":".escape(b:netrw_fname,' ?&')."' ".cygtmpfile +" call Decho("executing: !".g:netrw_scp_cmd.useport." '".g:netrw_machine.":".escape(b:netrw_fname,g:netrw_fname_escape)."' ".cygtmpfile) + exe g:netrw_silentxfer."!".g:netrw_scp_cmd.useport." '".g:netrw_machine.":".escape(b:netrw_fname,g:netrw_fname_escape)."' ".cygtmpfile else -" call Decho("executing: !".g:netrw_scp_cmd.useport." '".g:netrw_machine.":".escape(b:netrw_fname,' ?&')."' ".tmpfile) - exe g:netrw_silentxfer."!".g:netrw_scp_cmd.useport." '".g:netrw_machine.":".escape(b:netrw_fname,' ?&')."' ".tmpfile +" call Decho("executing: !".g:netrw_scp_cmd.useport." '".g:netrw_machine.":".escape(b:netrw_fname,g:netrw_fname_escape)."' ".tmpfile) + exe g:netrw_silentxfer."!".g:netrw_scp_cmd.useport." '".g:netrw_machine.":".escape(b:netrw_fname,g:netrw_fname_escape)."' ".tmpfile endif let result = s:NetGetFile(readcmd, tmpfile, b:netrw_method) let b:netrw_lastfile = choice - + "......................................... " http: NetRead Method #5 (wget) {{{3 elseif b:netrw_method == 5 @@ -558,17 +566,18 @@ fun! netrw#NetRead(...) " call Dret("NetRead") return endif - + if match(b:netrw_fname,"#") == -1 " simple wget -" call Decho("executing: !".g:netrw_http_cmd." ".tmpfile." http://".g:netrw_machine.escape(b:netrw_fname,' ?&')) - exe g:netrw_silentxfer."!".g:netrw_http_cmd." ".tmpfile." http://".g:netrw_machine.escape(b:netrw_fname,' ?&') + let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape) +" call Decho("executing: !".g:netrw_http_cmd." ".tmpfile." http://".g:netrw_machine.netrw_fname) + exe g:netrw_silentxfer."!".g:netrw_http_cmd." ".tmpfile." http://".g:netrw_machine.netrw_fname let result = s:NetGetFile(readcmd, tmpfile, b:netrw_method) - + else " wget plus a jump to an in-page marker (ie. http://abc/def.html#aMarker) - let netrw_html= substitute(b:netrw_fname,"#.*$","","") - let netrw_tag = substitute(b:netrw_fname,"^.*#","","") + let netrw_html= substitute(netrw_fname,"#.*$","","") + let netrw_tag = substitute(netrw_fname,"^.*#","","") " call Decho("netrw_html<".netrw_html.">") " call Decho("netrw_tag <".netrw_tag.">") " call Decho("executing: !".g:netrw_http_cmd." ".tmpfile." http://".g:netrw_machine.netrw_html) @@ -578,14 +587,14 @@ fun! netrw#NetRead(...) exe 'norm! 1G/<\s*a\s*name=\s*"'.netrw_tag.'"/'."\" endif let b:netrw_lastfile = choice - + "......................................... " cadaver: NetRead Method #6 {{{3 elseif b:netrw_method == 6 " call Decho("read via cadaver (method #6)") - + " Construct execution string (four lines) which will be passed through filter - let netrw_fname= b:netrw_fname + let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape) new setlocal ff=unix if exists("g:netrw_port") && g:netrw_port != "" @@ -594,7 +603,7 @@ fun! netrw#NetRead(...) put ='open '.g:netrw_machine endif put ='user '.g:netrw_uid.' '.g:netrw_passwd - + if g:netrw_cygwin == 1 let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e') put ='get '.netrw_fname.' '.cygtmpfile @@ -602,7 +611,7 @@ fun! netrw#NetRead(...) put ='get '.netrw_fname.' '.tmpfile endif put ='quit' - + " perform cadaver operation: norm! 1Gdd " call Decho("executing: %!".g:netrw_dav_cmd) @@ -610,26 +619,28 @@ fun! netrw#NetRead(...) bd! let result = s:NetGetFile(readcmd, tmpfile, b:netrw_method) let b:netrw_lastfile = choice - + "......................................... " rsync: NetRead Method #7 {{{3 elseif b:netrw_method == 7 " call Decho("read via rsync (method #7)") + let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape) if g:netrw_cygwin == 1 let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e') -" call Decho("executing: !".g:netrw_rsync_cmd." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".cygtmpfile) - exe g:netrw_silentxfer."!".g:netrw_rsync_cmd." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".cygtmpfile +" call Decho("executing: !".g:netrw_rsync_cmd." ".g:netrw_machine.":".netrw_fname." ".cygtmpfile) + exe g:netrw_silentxfer."!".g:netrw_rsync_cmd." ".g:netrw_machine.":".netrw_fname." ".cygtmpfile else -" call Decho("executing: !".g:netrw_rsync_cmd." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".tmpfile) - exe g:netrw_silentxfer."!".g:netrw_rsync_cmd." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".tmpfile +" call Decho("executing: !".g:netrw_rsync_cmd." ".g:netrw_machine.":".netrw_fname." ".tmpfile) + exe g:netrw_silentxfer."!".g:netrw_rsync_cmd." ".g:netrw_machine.":".netrw_fname." ".tmpfile endif let result = s:NetGetFile(readcmd,tmpfile, b:netrw_method) let b:netrw_lastfile = choice - + "......................................... " fetch: NetRead Method #8 {{{3 " fetch://[user@]host[:http]/path elseif b:netrw_method == 8 + let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape) if g:netrw_fetch_cmd == "" if !exists("g:netrw_quiet") echohl Error | echo "***netrw*** fetch command not available" | echohl None @@ -643,41 +654,42 @@ fun! netrw#NetRead(...) let netrw_option= "ftp" endif " call Decho("read via fetch for ".netrw_option) - + if exists("g:netrw_uid") && g:netrw_uid != "" && exists("g:netrw_passwd") && g:netrw_passwd != "" -" call Decho("executing: !".g:netrw_fetch_cmd." ".tmpfile." ".netrw_option."://".g:netrw_uid.':'.g:netrw_passwd.'@'.g:netrw_machine."/".escape(b:netrw_fname,' ?&')) - exe g:netrw_silentxfer."!".g:netrw_fetch_cmd." ".tmpfile." ".netrw_option."://".g:netrw_uid.':'.g:netrw_passwd.'@'.g:netrw_machine."/".escape(b:netrw_fname,' ?&') +" call Decho("executing: !".g:netrw_fetch_cmd." ".tmpfile." ".netrw_option."://".g:netrw_uid.':'.g:netrw_passwd.'@'.g:netrw_machine."/".netrw_fname) + exe g:netrw_silentxfer."!".g:netrw_fetch_cmd." ".tmpfile." ".netrw_option."://".g:netrw_uid.':'.g:netrw_passwd.'@'.g:netrw_machine."/".netrw_fname else -" call Decho("executing: !".g:netrw_fetch_cmd." ".tmpfile." ".netrw_option."://".g:netrw_machine."/".escape(b:netrw_fname,' ?&')) - exe g:netrw_silentxfer."!".g:netrw_fetch_cmd." ".tmpfile." ".netrw_option."://".g:netrw_machine."/".escape(b:netrw_fname,' ?&') +" call Decho("executing: !".g:netrw_fetch_cmd." ".tmpfile." ".netrw_option."://".g:netrw_machine."/".netrw_fname) + exe g:netrw_silentxfer."!".g:netrw_fetch_cmd." ".tmpfile." ".netrw_option."://".g:netrw_machine."/".netrw_fname endif - + let result = s:NetGetFile(readcmd,tmpfile, b:netrw_method) let b:netrw_lastfile = choice - + "......................................... " sftp: NetRead Method #9 {{{3 elseif b:netrw_method == 9 " call Decho("read via sftp (method #4)") + let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape) if g:netrw_cygwin == 1 let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e') -" call Decho("!".g:netrw_sftp_cmd." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".cygtmpfile) -" call Decho("executing: !".g:netrw_sftp_cmd." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".cygtmpfile) - exe "!".g:netrw_sftp_cmd." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".cygtmpfile +" call Decho("!".g:netrw_sftp_cmd." ".g:netrw_machine.":".netrw_fname." ".cygtmpfile) +" call Decho("executing: !".g:netrw_sftp_cmd." ".g:netrw_machine.":".netrw_fname." ".cygtmpfile) + exe "!".g:netrw_sftp_cmd." ".g:netrw_machine.":".netrw_fname." ".cygtmpfile else -" call Decho("executing: !".g:netrw_sftp_cmd." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".tmpfile) - exe g:netrw_silentxfer."!".g:netrw_sftp_cmd." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".tmpfile +" call Decho("executing: !".g:netrw_sftp_cmd." ".g:netrw_machine.":".netrw_fname." ".tmpfile) + exe g:netrw_silentxfer."!".g:netrw_sftp_cmd." ".g:netrw_machine.":".netrw_fname." ".tmpfile endif let result = s:NetGetFile(readcmd, tmpfile, b:netrw_method) let b:netrw_lastfile = choice - + "......................................... " Complain {{{3 else echo "***warning*** unable to comply with your request<" . choice . ">" endif endwhile - + " cleanup {{{3 " call Decho("cleanup") if exists("b:netrw_method") @@ -691,18 +703,21 @@ endfun " ------------------------------------------------------------------------ " NetGetFile: Function to read temporary file "tfile" with command "readcmd". {{{2 +" readcmd == %r : replace buffer with newly read file +" == 0r : read file at top of buffer +" == r : read file after current line fun! s:NetGetFile(readcmd, tfile, method) -" call Dfunc("NetGetFile(readcmd<".a:readcmd.">,tfile<".a:tfile."> method<".a:method.">)") +" call Dfunc("NetGetFile(readcmd<".a:readcmd.">,tfile<".a:tfile."> method<".a:method.">)") " get name of remote filename (ie. url and all) let rfile= bufname("%") " call Decho("rfile<".rfile.">") - + if exists("*NetReadFixup") " for the use of NetReadFixup (not otherwise used internally) let line2= line("$") endif - + " transform paths from / to \ for Windows (except for cygwin) if &term == "win32" if g:netrw_cygwin @@ -716,8 +731,8 @@ fun! s:NetGetFile(readcmd, tfile, method let tfile= a:tfile " call Decho("tfile=a:tfile<".tfile.">") endif - - if a:readcmd[0] == '0' + + if a:readcmd[0] == '%' " get file into buffer " call Dredir("ls!","starting buffer list") @@ -749,18 +764,17 @@ fun! s:NetGetFile(readcmd, tfile, method let lastline= line("$") " call Decho("exe<".a:readcmd." ".v:cmdarg." ".tfile."> line#".curline) exe a:readcmd." ".v:cmdarg." ".tfile - let line1 = curline + 1 - let line2 = line("$") - lastline + 1 + let line1= curline + 1 + let line2= line("$") - lastline + 1 else " not readable -" call Dfunc("NetGetFile(readcmd<".a:readcmd.">,tfile<".a:tfile."> method<".a:method.">)") echohl WarningMsg | echo "***netrw*** file <".tfile."> not readable"| echohl None call inputsave()|call input("Press to continue")|call inputrestore() " call Dret("NetGetFile : tfile<".tfile."> not readable") return endif - + " User-provided (ie. optional) fix-it-up command if exists("*NetReadFixup") " call Decho("calling NetReadFixup(method<".a:method."> line1=".line1." line2=".line2.")") @@ -773,9 +787,9 @@ fun! s:NetGetFile(readcmd, tfile, method if has("gui") && has("gui_running") silent! emenu Buffers.Refresh\ menu endif - + " call Decho("readcmd<".a:readcmd."> cmdarg<".v:cmdarg."> tfile<".a:tfile."> readable=".filereadable(a:tfile)) - + " make sure file is being displayed redraw! " call Dret("NetGetFile") @@ -785,26 +799,26 @@ endfun " NetWrite: responsible for writing a file over the net {{{2 fun! netrw#NetWrite(...) range " call Dfunc("NetWrite(a:0=".a:0.")") - + " option handling let mod= 0 call s:NetOptionSave() - + " Get Temporary Filename {{{3 - let tmpfile= tempname() + let tmpfile= escape(tempname(),g:netrw_tmpfile_escape) if !isdirectory(substitute(tmpfile,'[^/]\+$','','e')) echohl Error | echo "***netrw*** your ".substitute(tmpfile,'[^/]\+$','','e')." directory is missing!" call inputsave()|call input("Press to continue")|call inputrestore() " call Dret("NetWrite") return endif - + if a:0 == 0 let ichoice = 0 else let ichoice = 1 endif - + if &binary " for binary writes, write entire file. Line numbers don't really make sense. " Supports the writing of tar and zip files. @@ -815,9 +829,9 @@ fun! netrw#NetWrite(...) range " call Decho("silent exe ".a:firstline."," . a:lastline . "w! ".v:cmdarg." ".tmpfile) silent exe a:firstline."," . a:lastline . "w! ".v:cmdarg." ".tmpfile endif - + while ichoice <= a:0 - + " Process arguments: {{{3 " attempt to repeat with previous host-file-etc if exists("b:netrw_lastfile") && a:0 == 0 @@ -826,7 +840,7 @@ fun! netrw#NetWrite(...) range let ichoice= ichoice + 1 else exe "let choice= a:" . ichoice - + " Reconstruct Choice if choice starts with '"' if match(choice,"?") == 0 echomsg 'NetWrite Usage:"' @@ -841,7 +855,7 @@ fun! netrw#NetWrite(...) range echomsg ':Nwrite scp://[user@]machine[[:#]port]/path uses scp' echomsg ':Nwrite sftp://[user@]machine/path uses sftp' break - + elseif match(choice,"^\"") != -1 if match(choice,"\"$") != -1 " case "..." @@ -850,7 +864,7 @@ fun! netrw#NetWrite(...) range " case "... ... ..." let choice = strpart(choice,1,strlen(choice)-1) let wholechoice = "" - + while match(choice,"\"$") == -1 let wholechoice= wholechoice . " " . choice let ichoice = ichoice + 1 @@ -870,7 +884,7 @@ fun! netrw#NetWrite(...) range endif " call Decho("choice<" . choice . ">") let ichoice= ichoice + 1 - + " fix up windows urls if has("win32") || has("win95") || has("win64") || has("win16") let choice= substitute(choice,'\\','/','ge') @@ -878,17 +892,17 @@ fun! netrw#NetWrite(...) range exe 'lcd ' . fnamemodify(tmpfile,':h') let tmpfile = fnamemodify(tmpfile,':t') endif - + " Determine method of read (ftp, rcp, etc) {{{3 call s:NetMethod(choice) - + " ============= " Perform Protocol-Based Write {{{3 " ============================ if exists("g:netrw_silent") && g:netrw_silent == 0 && &ch >= 1 echo "(netrw) Processing your write request..." endif - + "......................................... " rcp: NetWrite Method #1 {{{3 if b:netrw_method == 1 @@ -906,14 +920,15 @@ fun! netrw#NetWrite(...) range let uid_machine = g:netrw_machine endif endif -" call Decho("executing: !".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".tmpfile." ".uid_machine.":".escape(b:netrw_fname,' ?&')) - exe g:netrw_silentxfer."!".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".tmpfile." ".uid_machine.":".escape(b:netrw_fname,' ?&') + let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape) +" call Decho("executing: !".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".tmpfile." ".uid_machine.":".netrw_fname) + exe g:netrw_silentxfer."!".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".tmpfile." ".uid_machine.":".netrw_fname let b:netrw_lastfile = choice - + "......................................... " ftp + <.netrc>: NetWrite Method #2 {{{3 elseif b:netrw_method == 2 - let netrw_fname = b:netrw_fname + let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape) new setlocal ff=unix exe "put ='".g:netrw_ftpmode."'" @@ -937,11 +952,11 @@ fun! netrw#NetWrite(...) range endif bd! let b:netrw_lastfile = choice - + "......................................... " ftp + machine, id, passwd, filename: NetWrite Method #3 {{{3 elseif b:netrw_method == 3 - let netrw_fname= b:netrw_fname + let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape) new setlocal ff=unix if exists("g:netrw_port") && g:netrw_port != "" @@ -964,7 +979,7 @@ fun! netrw#NetWrite(...) range " call Decho("filter input: ".getline(".")) " save choice/id/password for future use let b:netrw_lastfile = choice - + " perform ftp: " -i : turns off interactive prompting from ftp " -n unix : DON'T use <.netrc>, even though it exists @@ -981,10 +996,11 @@ fun! netrw#NetWrite(...) range let mod=1 endif bd! - + "......................................... " scp: NetWrite Method #4 {{{3 elseif b:netrw_method == 4 + let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape) if exists("g:netrw_port") && g:netrw_port != "" let useport= " -P ".g:netrw_port else @@ -992,14 +1008,14 @@ fun! netrw#NetWrite(...) range endif if g:netrw_cygwin == 1 let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e') -" call Decho("executing: !".g:netrw_scp_cmd.useport." ".cygtmpfile." '".g:netrw_machine.":".escape(b:netrw_fname,' ?&')."'") - exe g:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".cygtmpfile." '".g:netrw_machine.":".escape(b:netrw_fname,' ?&')."'" +" call Decho("executing: !".g:netrw_scp_cmd.useport." ".cygtmpfile." '".g:netrw_machine.":".netrw_fname."'") + exe g:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".cygtmpfile." '".g:netrw_machine.":".netrw_fname."'" else -" call Decho("executing: !".g:netrw_scp_cmd.useport." ".tmpfile." '".g:netrw_machine.":".escape(b:netrw_fname,' ?&')."'") - exe g:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".tmpfile." '".g:netrw_machine.":".escape(b:netrw_fname,' ?&')."'" +" call Decho("executing: !".g:netrw_scp_cmd.useport." ".tmpfile." '".g:netrw_machine.":".netrw_fname."'") + exe g:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".tmpfile." '".g:netrw_machine.":".netrw_fname."'" endif let b:netrw_lastfile = choice - + "......................................... " http: NetWrite Method #5 {{{3 elseif b:netrw_method == 5 @@ -1007,14 +1023,14 @@ fun! netrw#NetWrite(...) range echohl Error | echo "***netrw*** currently does not support writing using http:" | echohl None call inputsave()|call input("Press to continue")|call inputrestore() endif - + "......................................... " dav: NetWrite Method #6 (cadaver) {{{3 elseif b:netrw_method == 6 " call Decho("write via cadaver (method #6)") - + " Construct execution string (four lines) which will be passed through filter - let netrw_fname= b:netrw_fname + let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape) new setlocal ff=unix if exists("g:netrw_port") && g:netrw_port != "" @@ -1023,38 +1039,39 @@ fun! netrw#NetWrite(...) range put ='open '.g:netrw_machine endif put ='user '.g:netrw_uid.' '.g:netrw_passwd - + if g:netrw_cygwin == 1 let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e') put ='put '.cygtmpfile.' '.netrw_fname else put ='put '.tmpfile.' '.netrw_fname endif - + " perform cadaver operation: norm! 1Gdd " call Decho("executing: %!".g:netrw_dav_cmd) exe g:netrw_silentxfer."%!".g:netrw_dav_cmd bd! let b:netrw_lastfile = choice - + "......................................... " rsync: NetWrite Method #7 {{{3 elseif b:netrw_method == 7 + let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape) if g:netrw_cygwin == 1 let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e') -" call Decho("executing: !".g:netrw_rsync_cmd." ".cygtmpfile." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')) - exe g:netrw_silentxfer."!".g:netrw_rsync_cmd." ".cygtmpfile." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&') +" call Decho("executing: !".g:netrw_rsync_cmd." ".cygtmpfile." ".g:netrw_machine.":".netrw_fname) + exe g:netrw_silentxfer."!".g:netrw_rsync_cmd." ".cygtmpfile." ".g:netrw_machine.":".netrw_fname else -" call Decho("executing: !".g:netrw_rsync_cmd." ".tmpfile." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')) - exe g:netrw_silentxfer."!".g:netrw_rsync_cmd." ".tmpfile." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&') +" call Decho("executing: !".g:netrw_rsync_cmd." ".tmpfile." ".g:netrw_machine.":".netrw_fname) + exe g:netrw_silentxfer."!".g:netrw_rsync_cmd." ".tmpfile." ".g:netrw_machine.":".netrw_fname endif let b:netrw_lastfile = choice - + "......................................... " sftp: NetWrite Method #9 {{{3 elseif b:netrw_method == 9 - let netrw_fname= b:netrw_fname + let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape) if exists("g:netrw_uid") && ( g:netrw_uid != "" ) let uid_machine = g:netrw_uid .'@'. g:netrw_machine else @@ -1068,23 +1085,23 @@ fun! netrw#NetWrite(...) range exe g:netrw_silentxfer."%!".g:netrw_sftp_cmd.' '.uid_machine bd! let b:netrw_lastfile= choice - + "......................................... " Complain {{{3 else echo "***warning*** unable to comply with your request<" . choice . ">" endif endwhile - + " cleanup {{{3 " call Decho("cleanup") let result=delete(tmpfile) call s:NetOptionRestore() - + if a:firstline == 1 && a:lastline == line("$") let &mod= mod " usually equivalent to set nomod endif - + " call Dret("NetWrite") endfun @@ -1135,6 +1152,10 @@ fun! s:NetBrowse(dirname) " use buffer-oriented WinVars if buffer ones exist but window ones don't call s:UseBufWinVars() + " set up menus + let b:netrw_browser_active= 1 + call s:NetMenu() + " make this buffer modifiable setlocal ma nonu nowrap @@ -1216,14 +1237,14 @@ fun! s:NetBrowse(dirname) " call Decho("exe file ".method."://".user.machine."/".escape(path,s:netrw_cd_escape)) exe "file ".method."://".user.machine."/".escape(path,s:netrw_cd_escape) exe "silent doau BufReadPre ".fname - silent call netrw#NetRead(method."://".user.machine."/".path) + silent call netrw#NetRead(2,method."://".user.machine."/".path) exe "silent doau BufReadPost ".fname keepjumps 1d " save certain window-oriented variables into buffer-oriented variables call s:SetBufWinVars() call s:NetOptionRestore() - setlocal nomod + setlocal nomod nowrap " call Dret("NetBrowse : file<".fname.">") return @@ -1256,7 +1277,10 @@ fun! s:NetBrowse(dirname) " call Decho("exe file ".escape(bufname,s:netrw_cd_escape)) exe 'file '.escape(bufname,s:netrw_cd_escape) " call Decho("renaming file to bufname<".bufname.">") - setlocal bh=hide bt=nofile nobl nonu noswf + setlocal bt=nofile nobl nonu noswf + if g:netrw_fastbrowse >= 1 + setlocal bh=hide + endif " save current directory on directory history list call s:NetBookmarkDir(3,expand("%")) @@ -1276,7 +1300,7 @@ fun! s:NetBrowse(dirname) nnoremap :call NetHideEdit(0) nnoremap i :call NetLongList(0) nnoremap o :call NetSplit(0) - nnoremap O :call NetObtain() + nnoremap O :call netrw#NetObtain() nnoremap P :call NetPrevWinOpen(0) nnoremap q :call NetBookmarkDir(2,expand("%")) nnoremap r :let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'exe "norm! 0"call NetBrowse(NetBrowseChgDir(expand("%"),'./')) @@ -1475,12 +1499,16 @@ fun! s:NetBrowseChgDir(dirname,newdir) rightb vert new wincmd | endif + call s:NetMenu() " call Decho("handling a file: dirname<".dirname.">") elseif newdir == './' " refresh the directory list " call Decho("refresh directory listing") - setlocal ma nobl bh=hide + setlocal ma nobl + if g:netrw_fastbrowse >= 1 + setlocal bh=hide + endif %d elseif newdir == '../' @@ -1630,7 +1658,7 @@ fun! s:NetBrowseRm(usrhost,path) range elseif ok =~ 'q\%[uit]' break endif - + else " attempt to remove directory if !all @@ -1661,7 +1689,7 @@ fun! s:NetBrowseRm(usrhost,path) range " call Decho("2nd attempt to remove dir: system(".netrw_rmf_cmd.")") let ret= system(netrw_rmf_cmd) " call Decho("returned=".ret." errcode=".v:shell_error) - + if v:shell_error != 0 && !exists("g:netrw_quiet") echohl Error | echo "***netrw*** unable to remove directory<".rmfile."> -- is it empty?" | echohl None call inputsave()|call input("Press to continue")|call inputrestore() @@ -1795,25 +1823,23 @@ fun! netrw#NetBrowseX(fname,remote) " seems kde systems often have gnome-open due to dependencies, even though " gnome-open's subsidiary display tools are largely absent. Kde systems - " usually have "kicker" running, though... (tnx Mikolaj Machowski) - if !exists("s:haskicker") + " usually have "kdeinit" running, though... (tnx Mikolaj Machowski) + if !exists("s:haskdeinit") if has("unix") - let v:shell_error=0 - silent! let s:haskicker= system('ps -e') =~ 'kicker' + silent! let s:haskdeinit= system('ps -e') =~ 'kdeinit' if v:shell_error - let s:haskicker = 0 - let v:shell_error = 0 + let s:haskdeinit = 0 endif else - let s:haskicker= 0 + let s:haskdeinit= 0 endif -" call Decho("setting s:haskicker=".s:haskicker) +" call Decho("setting s:haskdeinit=".s:haskdeinit) endif if a:remote == 1 " create a local copy let fname= tempname().".".exten -" call Decho("create a local copy of <".a:fname."> as <".fname.">") +" call Decho("a:remote==1: create a local copy of <".a:fname."> as <".fname.">") exe "silent keepjumps bot 1new ".a:fname set bh=delete exe "w! ".fname @@ -1827,15 +1853,12 @@ fun! netrw#NetBrowseX(fname,remote) else let redir= &srr . "/dev/null" endif -" call Decho("redir:".redir.":") +" call Decho("redir{".redir."} srr{".&srr."}") if exists("g:netrw_browsex_viewer") && executable(g:netrw_browsex_viewer) +" call Decho("g:netrw_browsex_viewer<".g:netrw_browsex_viewer.">") if g:netrw_browsex_viewer == '-' - call netrwFileHandlers#Init() - if exten != "" && exists("*netrwFileHandlers#NFH_".exten) -" call Decho("let ret= netrwFileHandlers#NFH_".exten.'("'.fname.'")') - exe "let ret= netrwFileHandlers#NFH_".exten.'("'.fname.'")' - endif + let ret= netrwFileHandlers#Invoke(exten,fname) else " call Decho("exe silent !".g:netrw_browsex_viewer." '".escape(fname,'%#')."' ".redir) exe "silent !".g:netrw_browsex_viewer." '".escape(fname,'%#')."'".redir @@ -1848,23 +1871,26 @@ fun! netrw#NetBrowseX(fname,remote) exe 'silent !start rundll32 url.dll,FileProtocolHandler "'.escape(fname, '%#').'"' let ret= v:shell_error - elseif has("unix") && executable("gnome-open") && !s:haskicker + elseif has("unix") && executable("gnome-open") && !s:haskdeinit " call Decho("exe silent !gnome-open '".escape(fname,'%#')."' ".redir) exe "silent !gnome-open '".escape(fname,'%#')."'".redir let ret= v:shell_error - elseif has("unix") && executable("kfmclient") && s:haskicker + elseif has("unix") && executable("kfmclient") && s:haskdeinit " call Decho("exe silent !kfmclient exec '".escape(fname,'%#')."' ".redir) exe "silent !kfmclient exec '".escape(fname,'%#')."' ".redir let ret= v:shell_error else - call netrwFileHandlers#Init() - if exten != "" && exists("*netrwFileHandlers#NFH_".exten) -" call Decho("let ret= netrwFileHandlers#NFH_".exten.'("'.fname.'")') - exe "let ret= netrwFileHandlers#NFH_".exten.'("'.fname.'")' - endif + " netrwFileHandlers#Invoke() always returns 0 + let ret= netrwFileHandlers#Invoke(exten,fname) endif + + " if unsuccessful, attempt netrwFileHandlers#Invoke() + if ret + let ret= netrwFileHandlers#Invoke(exten,fname) + endif + redraw! " cleanup: remove temporary file, @@ -1928,19 +1954,19 @@ fun! s:NetBrowseFtpCmd(path,cmd) else put ='open '.g:netrw_machine endif - + if exists("g:netrw_ftp") && g:netrw_ftp == 1 put =g:netrw_uid put ='\"'.g:netrw_passwd.'\"' else put ='user \"'.g:netrw_uid.'\" \"'.g:netrw_passwd.'\"' endif - + if a:path != "" put ='cd \"'.a:path.'\"' endif exe "put ='".a:cmd."'" - + " perform ftp: " -i : turns off interactive prompting from ftp " -n unix : DON'T use <.netrc>, even though it exists @@ -2123,6 +2149,9 @@ fun! s:NetrwWideListing() " determine qty files per line (fpl) let w:netrw_fpl= winwidth(0)/b:netrw_cpf + if w:netrw_fpl <= 0 + let w:netrw_fpl= 1 + endif " call Decho("fpl= ".winwidth(0)."/[b:netrw_cpf=".b:netrw_cpf.']='.w:netrw_fpl) " make wide display @@ -2258,7 +2287,7 @@ fun! s:NetMakeDir(usrhost) endif redraw! endif - + " call Dret("NetMakeDir") endfun @@ -2376,13 +2405,40 @@ endfun " --------------------------------------------------------------------- " NetObtain: obtain file under cursor (for remote browsing support) {{{2 -fun! s:NetObtain() - let fname= expand("") +fun! netrw#NetObtain(...) +" call Dfunc("NetObtain() a:0=".a:0) + + if a:0==0 + " no arguments -- use word under cursor + let fname= expand("") +" call Decho("no arguments, use <".fname.">") + elseif a:0 > 1 + " more than one argument, recurse with each argument separately +" call Decho("more than 1 argument, use recursion") + let i=1 + while i <= a:0 + call netrw#NetObtain(a:{i}) + let i=i+1 + endwhile + return + else + " one argument provided + let fname = a:1 + let keep_netrw_choice = exists("b:netrw_choice")? b:netrw_choice : "" + let keep_netrw_fname = exists("b:netrw_fname")? b:netrw_fname : "" + let keep_netrw_wmethod = exists("w:netrw_method")? w:netrw_method : "" + call s:NetMethod(fname) + let w:netrw_method= b:netrw_method + let fname = b:netrw_fname +" call Decho("g:netrw_scp_cmd<".g:netrw_scp_cmd.">") +" call Decho("g:netrw_machine<".g:netrw_machine.">") +" call Decho("fname<".fname.">") + endif " NetrwStatusLine support - for obtaining support call s:SetupNetrwStatusLine('%f %h%m%r%=%9*Obtaining '.fname) -" call Dfunc("NetObtain() method=".w:netrw_method) +" call Decho("method=".w:netrw_method) if exists("w:netrw_method") && w:netrw_method =~ '[235]' if executable("ftp") let curdir = expand("%") @@ -2419,9 +2475,9 @@ fun! s:NetObtain() " call Decho('ftp: open '.g:netrw_machine.' '.g:netrw_port) else put ='open '.g:netrw_machine -" call Decho('ftp: open '.g:netrw_machine +" call Decho('ftp: open '.g:netrw_machine) endif - + if exists("g:netrw_ftp") && g:netrw_ftp == 1 put =g:netrw_uid put ='\"'.g:netrw_passwd.'\"' @@ -2431,21 +2487,21 @@ fun! s:NetObtain() put ='user \"'.g:netrw_uid.'\" \"'.g:netrw_passwd.'\"' " call Decho('user '.g:netrw_uid.' '.g:netrw_passwd) endif - + if a:path != "" put ='cd '.a:path " call Decho('cd '.a:path) endif exe "put ='".a:cmd."'" " call Decho("ftp: ".a:cmd) - + " perform ftp: " -i : turns off interactive prompting from ftp " -n unix : DON'T use <.netrc>, even though it exists " -n win32: quit being obnoxious about password " call Decho("exe ".g:netrw_silentxfer.curline.",$!".g:netrw_ftp_cmd." -i -n") exe g:netrw_silentxfer.endline.",$!".g:netrw_ftp_cmd." -i -n" - + "......................................... else echo "***warning*** unable to comply with your request<" . choice . ">" @@ -2459,8 +2515,14 @@ fun! s:NetObtain() echohl Error | echo "***netrw*** this system doesn't support ftp" | echohl None call inputsave()|call input("Press to continue")|call inputrestore() endif + " restore status line let &stl = s:netrw_users_stl let &laststatus = s:netrw_users_ls + " restore NetMethod + if exists("keep_netrw_method") + call s:NetMethod(keep_netrw_choice) + let w:netrw_method = keep_netrw_wmethod + endif " call Dret("NetObtain") return endif @@ -2470,6 +2532,7 @@ fun! s:NetObtain() " scp: Method#4 let curdir = expand("%") let path = substitute(curdir,'scp://[^/]\+/','','e') +" call Decho("path<".path.">") if exists("g:netrw_port") && g:netrw_port != "" let useport= " -P ".g:netrw_port else @@ -2490,6 +2553,12 @@ fun! s:NetObtain() let &laststatus = s:netrw_users_ls redraw! + " restore NetMethod + if exists("keep_netrw_method") + call s:NetMethod(keep_netrw_choice) + let w:netrw_method = keep_netrw_wmethod + endif + " call Dret("NetObtain") endfun @@ -2569,6 +2638,77 @@ fun! s:NetPrevWinOpen(islocal) " call Dret("NetPrevWinOpen") endfun +" --------------------------------------------------------------------- +" NetMenu: generates the menu for gvim and netrw {{{2 +fun! s:NetMenu() + + if has("menu") && has("gui_running") && &go =~ 'm' +" call Dfunc("NetMenu()") + if !exists("s:netrw_menu_enabled") + let s:netrw_menu_enabled= 1 + if !exists("g:DrChipTopLvlMenu") + let g:DrChipTopLvlMenu= "DrChip." + endif + exe 'silent! menu '.g:DrChipTopLvlMenu.'Netrw.Help? ?' + exe 'silent! menu '.g:DrChipTopLvlMenu.'Netrw.Apply\ Special\ Viewerx x' + exe 'silent! menu '.g:DrChipTopLvlMenu.'Netrw.Bookmark\ Current\ Directoryb Nb' + exe 'silent! menu '.g:DrChipTopLvlMenu.'Netrw.Go\ Up\ Directory- -' + exe 'silent! menu '.g:DrChipTopLvlMenu.'Netrw.Goto\ Bookmarked\ DirectoryB NB' + exe 'silent! menu '.g:DrChipTopLvlMenu.'Netrw.Change\ To\ Recently\ Used\ Directoryu u' + exe 'silent! menu '.g:DrChipTopLvlMenu.'Netrw.Change\ To\ Subsequently\ Used\ DirectoryU U' + exe 'silent! menu '.g:DrChipTopLvlMenu.'Netrw.Delete\ File/DirectoryD D' + exe 'silent! menu '.g:DrChipTopLvlMenu.'Netrw.Edit\ File\ Hiding\ List'." \" + exe 'silent! menu '.g:DrChipTopLvlMenu.'Netrw.Edit\ File/Directory '."\" + exe 'silent! menu '.g:DrChipTopLvlMenu.'Netrw.Edit\ File/Directory,\ New\ Windowo o' + exe 'silent! menu '.g:DrChipTopLvlMenu.'Netrw.Edit\ File/Directory,\ New\ Vertical\ Window\ v v' + exe 'silent! menu '.g:DrChipTopLvlMenu.'Netrw.List\ Bookmarks\ and\ Historyq q' + exe 'silent! menu '.g:DrChipTopLvlMenu.'Netrw.Listing\ Style\ (thin-long-wide)i i' + exe 'silent! menu '.g:DrChipTopLvlMenu.'Netrw.Make\ Subdirectoryd d' + exe 'silent! menu '.g:DrChipTopLvlMenu.'Netrw.Normal-Hide-Showa a' + exe 'silent! menu '.g:DrChipTopLvlMenu.'Netrw.Obtain\ FileO O' + exe 'silent! menu '.g:DrChipTopLvlMenu.'Netrw.Preview\ File/Directoryp p' + exe 'silent! menu '.g:DrChipTopLvlMenu.'Netrw.Previous\ Window\ BrowserP P' + exe 'silent! menu '.g:DrChipTopLvlMenu.'Netrw.Refresh\ Listing'." \" + exe 'silent! menu '.g:DrChipTopLvlMenu.'Netrw.Rename\ File/DirectoryR R' + exe 'silent! menu '.g:DrChipTopLvlMenu.'Netrw.Reverse\ Sorting\ Order'."r r" + exe 'silent! menu '.g:DrChipTopLvlMenu.'Netrw.Select\ Sorting\ Styles s' + exe 'silent! menu '.g:DrChipTopLvlMenu.'Netrw.Sorting\ Sequence\ EditS S' + exe 'silent! menu '.g:DrChipTopLvlMenu.'Netrw.Set\ Current\ Directoryc c' + exe 'silent! menu '.g:DrChipTopLvlMenu.'Netrw.Settings/Options:NetrwSettings '.":NetrwSettings\" + else +" call Decho("clear menus") + exe 'silent! unmenu '.g:DrChipTopLvlMenu.'Netrw.Help' + exe 'silent! unmenu '.g:DrChipTopLvlMenu.'Netrw.Apply\ Special\ Viewer' + exe 'silent! unmenu '.g:DrChipTopLvlMenu.'Netrw.Bookmark\ Current\ Directory' + exe 'silent! unmenu '.g:DrChipTopLvlMenu.'Netrw.Go\ Up\ Directory' + exe 'silent! unmenu '.g:DrChipTopLvlMenu.'Netrw.Goto\ Bookmarked\ Directory' + exe 'silent! unmenu '.g:DrChipTopLvlMenu.'Netrw.Change\ To\ Recently\ Used\ Directory' + exe 'silent! unmenu '.g:DrChipTopLvlMenu.'Netrw.Change\ To\ Subsequently\ Used\ Directory' + exe 'silent! unmenu '.g:DrChipTopLvlMenu.'Netrw.Delete\ File/Directory' + exe 'silent! unmenu '.g:DrChipTopLvlMenu.'Netrw.Edit\ File\ Hiding\ List' + exe 'silent! unmenu '.g:DrChipTopLvlMenu.'Netrw.Edit\ File' + exe 'silent! unmenu '.g:DrChipTopLvlMenu.'Netrw.Enter\ File/Directory' + exe 'silent! unmenu '.g:DrChipTopLvlMenu.'Netrw.Enter\ File/Directory\ (vertical\ split)' + exe 'silent! unmenu '.g:DrChipTopLvlMenu.'Netrw.List\ Bookmarks\ and\ History' + exe 'silent! unmenu '.g:DrChipTopLvlMenu.'Netrw.Listing\ Style\ (thin-long-wide)' + exe 'silent! unmenu '.g:DrChipTopLvlMenu.'Netrw.Make\ Subdirectory' + exe 'silent! unmenu '.g:DrChipTopLvlMenu.'Netrw.Normal-Hide-Show' + exe 'silent! unmenu '.g:DrChipTopLvlMenu.'Netrw.Obtain\ File' + exe 'silent! unmenu '.g:DrChipTopLvlMenu.'Netrw.Preview\ File' + exe 'silent! unmenu '.g:DrChipTopLvlMenu.'Netrw.Previous\ Window\ Browser' + exe 'silent! unmenu '.g:DrChipTopLvlMenu.'Netrw.Refresh\ Listing' + exe 'silent! unmenu '.g:DrChipTopLvlMenu.'Netrw.Rename\ File/Directory' + exe 'silent! unmenu '.g:DrChipTopLvlMenu.'Netrw.Reverse\ Sorting\ Order' + exe 'silent! unmenu '.g:DrChipTopLvlMenu.'Netrw.Select\ Sorting\ Style' + exe 'silent! unmenu '.g:DrChipTopLvlMenu.'Netrw.Sorting\ Sequence\ Edit' + exe 'silent! unmenu '.g:DrChipTopLvlMenu.'Netrw.Set\ Current\ Directory' + exe 'silent! unmenu '.g:DrChipTopLvlMenu.'Netrw.Settings/Options' + endif +" call Dret("NetMenu") + endif + +endfun + " ========================================== " Local Directory Browsing Support: {{{1 " ========================================== @@ -2597,6 +2737,13 @@ fun! netrw#DirBrowse(dirname) " call Dret("DirBrowse") return endif + if &fo =~ '[ta]' + set fo-=t + set fo-=a + echohl Warning + echo '***warning*** directory browsing and formatoptions "ta" are incompatible' + echohl None + endif call s:NetOptionSave() @@ -2613,6 +2760,10 @@ fun! netrw#DirBrowse(dirname) " use buffer-oriented WinVars if buffer ones exist but window ones don't call s:UseBufWinVars() + " set up menus + let b:netrw_browser_active= 1 + call s:NetMenu() + " find buffer number of buffer named precisely the same as a:dirname let bufnum= bufnr(escape(a:dirname,'\')) " call Decho("findbuf: bufnum=".bufnum) @@ -2692,7 +2843,10 @@ fun! netrw#DirBrowse(dirname) exe 'silent! file '.escape(b:netrw_curdir,s:netrw_cd_escape) " make this buffer not-a-file, modifiable, not line-numbered, etc - setlocal bh=hide bt=nofile nobl ma nonu noswf + setlocal bt=nofile nobl ma nonu noswf nowrap + if g:netrw_fastbrowse >= 2 + setlocal bh=hide + endif keepalt silent! %d " --------------------------- @@ -2845,7 +2999,10 @@ fun! netrw#DirBrowse(dirname) " save certain window-oriented variables into buffer-oriented variables call s:SetBufWinVars() call s:NetOptionRestore() - setlocal noma nomod nonu bh=hide nobl + setlocal noma nomod nonu nobl nowrap + if g:netrw_fastbrowse >= 2 + setlocal bh=hide + endif " call Dret("DirBrowse : file<".expand("%:p")."> bufname<".bufname("%").">") endfun @@ -2941,7 +3098,7 @@ fun! s:LocalBrowseList() keepjumps silent! put=pfile endif endwhile - + " cleanup any windows mess at end-of-line silent! keepjumps %s/\r$//e setlocal ts=32 @@ -2981,6 +3138,7 @@ fun! s:LocalBrowseChgDir(dirname,newdir, wincmd | endif exe "e! ".escape(dirname,s:netrw_cd_escape) + call s:NetMenu() set ma nomod endif @@ -3058,7 +3216,7 @@ fun! s:LocalBrowseRm(path) range elseif ok =~ 'q\%[uit]' break endif - + else " attempt to remove directory if !all @@ -3434,13 +3592,14 @@ endfun " 9: sftp fun! s:NetMethod(choice) " globals: method machine id passwd fname " call Dfunc("NetMethod(a:choice<".a:choice.">)") - + " initialization let b:netrw_method = 0 let g:netrw_machine = "" let b:netrw_fname = "" let g:netrw_port = "" - + let g:netrw_choice = a:choice + " Patterns: " mipf : a:machine a:id password filename Use ftp " mf : a:machine filename Use ftp + <.netrc> or g:netrw_uid g:netrw_passwd @@ -3464,7 +3623,7 @@ fun! s:NetMethod(choice) " globals: met let rsyncurm = '^rsync://\([^/]\{-}\)/\(.*\)\=$' let fetchurm = '^fetch://\(\([^/@]\{-}\)@\)\=\([^/#:]\{-}\)\(:http\)\=/\(.*\)$' let sftpurm = '^sftp://\([^/]\{-}\)/\(.*\)\=$' - + " call Decho("determine method:") " Determine Method " rcp://user@hostname/...path-to-file @@ -3477,7 +3636,7 @@ fun! s:NetMethod(choice) " globals: met if userid != "" let g:netrw_uid= userid endif - + " scp://user@hostname/...path-to-file elseif match(a:choice,scpurm) == 0 " call Decho("scp://...") @@ -3485,14 +3644,14 @@ fun! s:NetMethod(choice) " globals: met let g:netrw_machine = substitute(a:choice,scpurm,'\1',"") let g:netrw_port = substitute(a:choice,scpurm,'\2',"") let b:netrw_fname = substitute(a:choice,scpurm,'\3',"") - + " http://user@hostname/...path-to-file elseif match(a:choice,httpurm) == 0 " call Decho("http://...") let b:netrw_method = 5 let g:netrw_machine= substitute(a:choice,httpurm,'\1',"") let b:netrw_fname = substitute(a:choice,httpurm,'\2',"") - + " dav://hostname[:port]/..path-to-file.. elseif match(a:choice,davurm) == 0 " call Decho("dav://...") @@ -3503,14 +3662,14 @@ fun! s:NetMethod(choice) " globals: met let g:netrw_machine= 'http://'.substitute(a:choice,davurm,'\1/\2',"") endif let b:netrw_fname = substitute(a:choice,davurm,'\3',"") - + " rsync://user@hostname/...path-to-file elseif match(a:choice,rsyncurm) == 0 " call Decho("rsync://...") let b:netrw_method = 7 let g:netrw_machine= substitute(a:choice,rsyncurm,'\1',"") let b:netrw_fname = substitute(a:choice,rsyncurm,'\2',"") - + " ftp://[user@]hostname[[:#]port]/...path-to-file elseif match(a:choice,ftpurm) == 0 " call Decho("ftp://...") @@ -3536,7 +3695,7 @@ fun! s:NetMethod(choice) " globals: met let b:netrw_method= 3 endif endif - + elseif match(a:choice,fetchurm) == 0 " call Decho("fetch://...") let b:netrw_method = 8 @@ -3544,7 +3703,7 @@ fun! s:NetMethod(choice) " globals: met let g:netrw_machine= substitute(a:choice,fetchurm,'\3',"") let b:netrw_option = substitute(a:choice,fetchurm,'\4',"") let b:netrw_fname = substitute(a:choice,fetchurm,'\5',"") - + " Issue an ftp : "machine id password [path/]filename" elseif match(a:choice,mipf) == 0 " call Decho("(ftp) host id pass file") @@ -3553,7 +3712,7 @@ fun! s:NetMethod(choice) " globals: met let g:netrw_uid = substitute(a:choice,mipf,'\2',"") let g:netrw_passwd = substitute(a:choice,mipf,'\3',"") let b:netrw_fname = substitute(a:choice,mipf,'\4',"") - + " Issue an ftp: "hostname [path/]filename" elseif match(a:choice,mf) == 0 " call Decho("(ftp) host file") @@ -3561,20 +3720,20 @@ fun! s:NetMethod(choice) " globals: met let b:netrw_method = 3 let g:netrw_machine = substitute(a:choice,mf,'\1',"") let b:netrw_fname = substitute(a:choice,mf,'\2',"") - + elseif filereadable(expand("$HOME/.netrc")) let b:netrw_method = 2 let g:netrw_machine = substitute(a:choice,mf,'\1',"") let b:netrw_fname = substitute(a:choice,mf,'\2',"") endif - + " sftp://user@hostname/...path-to-file elseif match(a:choice,sftpurm) == 0 " call Decho("sftp://...") let b:netrw_method = 9 let g:netrw_machine= substitute(a:choice,sftpurm,'\1',"") let b:netrw_fname = substitute(a:choice,sftpurm,'\2',"") - + " Issue an rcp: hostname:filename" (this one should be last) elseif match(a:choice,rcphf) == 0 " call Decho("(rcp) [user@]host:file) rcphf<".rcphf.">") @@ -3593,7 +3752,7 @@ fun! s:NetMethod(choice) " globals: met " don't let PCs try <.netrc> let b:netrw_method = 3 endif - + else if !exists("g:netrw_quiet") echohl Error | echo "***netrw*** cannot determine method" | echohl None @@ -3606,7 +3765,7 @@ fun! s:NetMethod(choice) " globals: met if g:netrw_port != "" let g:netrw_port = substitute(g:netrw_port,'[#:]\+','','') endif - + " call Decho("a:choice <".a:choice.">") " call Decho("b:netrw_method <".b:netrw_method.">") " call Decho("g:netrw_machine<".g:netrw_machine.">") @@ -3618,7 +3777,7 @@ fun! s:NetMethod(choice) " globals: met " call Decho("g:netrw_passwd <".g:netrw_passwd.">") " endif "Decho " call Decho("b:netrw_fname <".b:netrw_fname.">") -" call Dret("NetMethod") +" call Dret("NetMethod : b:netrw_method=".b:netrw_method) endfun " ------------------------------------------------------------------------ @@ -3666,14 +3825,18 @@ fun! s:NetOptionSave() " Get Temporary Filename let w:aikeep = &ai " record autochdir setting and then insure its unset (tnx to David Fishburn) - if has("netbeans_intg") || has("sun_workshop") - let w:acdkeep = &autochdir - set noautochdir + if &acd && (has("netbeans_intg") || has("sun_workshop")) + set noacd + echohl Warning | echomsg "***warning*** directory browsing and the acd setting are incompatible" |echohl None endif + let w:fokeep = &fo + let w:aikeep = &ai + let w:cikeep = &ci let w:cinkeep = &cin let w:cinokeep = &cino let w:comkeep = &com let w:cpokeep = &cpo + let w:magickeep = &magic if !g:netrw_keepdir let w:dirkeep = getcwd() endif @@ -3684,7 +3847,7 @@ fun! s:NetOptionSave() setlocal cino = setlocal com = setlocal cpo -=aA - setlocal nocin noai nospell + setlocal nocin noai noci magic nospell fo=nroql2 setlocal tw =0 setlocal report=10000 if has("win32") && !has("win95") @@ -3705,18 +3868,18 @@ fun! s:NetOptionRestore() return endif unlet w:netoptionsave - + if exists("w:aikeep")| let &ai= w:aikeep|endif - if (has("netbeans_intg") || has("sun_workshop")) && exists("w:acdkeep") - let &acd= w:acdkeep - unlet w:acdkeep - endif + if exists("w:aikeep") |let &ai = w:aikeep |unlet w:aikeep |endif + if exists("w:cikeep") |let &ci = w:cikeep |unlet w:cikeep |endif if exists("w:cinkeep") |let &cin = w:cinkeep |unlet w:cinkeep |endif if exists("w:cinokeep") |let &cino = w:cinokeep |unlet w:cinokeep |endif if exists("w:comkeep") |let &com = w:comkeep |unlet w:comkeep |endif if exists("w:cpokeep") |let &cpo = w:cpokeep |unlet w:cpokeep |endif if exists("w:dirkeep") |exe "lcd ".w:dirkeep |unlet w:dirkeep |endif + if exists("w:fokeep") |let &fo = w:fokeep |unlet w:fokeep |endif if exists("w:gdkeep") |let &gd = w:gdkeep |unlet w:gdkeep |endif + if exists("w:magic") |let &magic = w:magic |unlet w:magic |endif if exists("w:repkeep") |let &report = w:repkeep |unlet w:repkeep |endif if exists("w:spellkeep")|let &spell = w:spellkeep |unlet w:spellkeep|endif if exists("w:twkeep") |let &tw = w:twkeep |unlet w:twkeep |endif @@ -3733,7 +3896,7 @@ fun! s:NetOptionRestore() endif unlet w:swfkeep endif - + " call Dret("NetOptionRestore") endfun @@ -3760,7 +3923,7 @@ endif if v:version < 700 fun! s:NetSort() range " " call Dfunc("NetSort()") - + let i = a:firstline + 1 while i <= a:lastline " find insertion point via binary search @@ -3795,7 +3958,7 @@ if v:version < 700 endif let i = i + 1 endwhile - + " " call Dret("NetSort") endfun endif diff --git a/runtime/autoload/netrwSettings.vim b/runtime/autoload/netrwSettings.vim --- a/runtime/autoload/netrwSettings.vim +++ b/runtime/autoload/netrwSettings.vim @@ -96,6 +96,7 @@ fun! netrwSettings#NetrwSettings() put = 'let g:netrw_browsex_viewer = (not defined)' endif put = 'let g:netrw_dirhistmax = '.g:netrw_dirhistmax + put = 'let g:netrw_fastbrowse = '.g:netrw_fastbrowse 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 diff --git a/runtime/doc/os_mac.txt b/runtime/doc/os_mac.txt --- a/runtime/doc/os_mac.txt +++ b/runtime/doc/os_mac.txt @@ -1,4 +1,4 @@ -*os_mac.txt* For Vim version 7.0aa. Last change: 2005 Mar 29 +*os_mac.txt* For Vim version 7.0aa. Last change: 2006 Mar 09 VIM REFERENCE MANUAL by Bram Moolenaar et al. @@ -33,9 +33,10 @@ Indianapolis IN 46220 USA ============================================================================== 1. Filename Convention *mac-filename* -You can use either the unix or mac path separator or a mix of both. In order -to determine if the specified filename is relative to the current folder or -absolute (i.e. relative to the "Desktop"), the following algorithm is used: +Starting with Vim version 7 you can just use the unix path separators with +Vim. In order to determine if the specified filename is relative to the +current folder or absolute (i.e. relative to the "Desktop"), the following +algorithm is used: If the path start by a "/", the path is absolute If the path start by a ":", the path is relative @@ -58,10 +59,16 @@ You can use the |$VIM| and |$VIMRUNTIME| ============================================================================== 2. .vimrc and .vim files *mac-vimfile* -On the Mac files starting with a dot "." are discouraged, thus the rc files -are named "vimrc" or "_vimrc" and "gvimrc" or "_gvimrc". These files can be in -any format (mac, dos or unix). Vim can handle any file format when the -|'nocompatible'| option is set, otherwise it will only handle mac format +It is recommended to use Unix style line separators for Vim scripts, thus a +single newline character. + +When starting up Vim will load the $VIMRUNTIME/macmap.vim script to define +default command-key mappings. + +On older systems files starting with a dot "." are discouraged, thus the rc +files are named "vimrc" or "_vimrc" and "gvimrc" or "_gvimrc". These files +can be in any format (mac, dos or unix). Vim can handle any file format when +the |'nocompatible'| option is set, otherwise it will only handle mac format files. ============================================================================== @@ -80,14 +87,6 @@ A: Assuming that Vim.app is located in / ============================================================================== 4. Mac Lack *mac-lack* -The filenames containing both ":" and "/" are sometimes misinterpreted. (just -re-execute the command) - -Scrollbar are not scrolling live, and when only the arrow or scroll area, a -limit of 32 line or page is scrolled. - -Syntax highlighting works on 68k Macs but is _really_ slow. - In a terminal CTRL-^ needs to be entered as Shift-Control-6. CTRL-@ as Shift-Control-2. diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt --- a/runtime/doc/pi_netrw.txt +++ b/runtime/doc/pi_netrw.txt @@ -1,4 +1,4 @@ -*pi_netrw.txt* For Vim version 7.0. Last change: Jan 27, 2006 +*pi_netrw.txt* For Vim version 7.0. Last change: Mar 09, 2006 VIM REFERENCE MANUAL by Charles E. Campbell, Jr. @@ -12,7 +12,7 @@ 0. Contents *netrw-contents* 1. Starting With Netrw.................................|netrw-start| 2. Netrw Reference......................................|netrw-ref| - CONTROLLING EXTERNAL APPLICTIONS...................|netrw-externapp| + CONTROLLING EXTERNAL APPLICATIONS..................|netrw-externapp| READING............................................|netrw-read| WRITING............................................|netrw-write| DIRECTORY LISTING..................................|netrw-dirlist| @@ -32,6 +32,7 @@ 8. Directory Browsing.................. Quick Reference Commands Table.....................|netrw-browse-cmds| Netrw Browser Variables............................|netrw-browse-var| Introduction To Directory Browsing.................|netrw-browse-intro| + Netrw Browsing And Option Incompatibilities........|netrw-incompatible| Directory Exploring Commands.......................|netrw-explore| Refreshing The Listing.............................|netrw-ctrl-l| Going Up...........................................|netrw--| @@ -39,7 +40,7 @@ 8. Directory Browsing.................. Obtaining A File...................................|netrw-O| Thin, Long, and Wide Listings......................|netrw-i| Making A New Directory.............................|netrw-d| - Deleting Files Or Directories......................|netrw-delete| + Deleting Files Or Directories......................|netrw-D| Renaming Files Or Directories......................|netrw-move| Hiding Files Or Directories........................|netrw-a| Edit File Or Directory Hiding List.................|netrw-ctrl-h| @@ -132,7 +133,7 @@ section, |netrw-externapp|. ============================================================================== 2. Netrw Reference *netrw-ref* -CONTROLLING EXTERNAL APPLICTIONS *netrw-externapp* +CONTROLLING EXTERNAL APPLICATIONS *netrw-externapp* Protocol Variable Default Value -------- ---------------- ------------- @@ -719,6 +720,7 @@ NETRW BROWSER VARIABLES *netrw-brows =0: re-using the same window =1: horizontally splitting the window first =2: vertically splitting the window first + *g:netrw_browsex_viewer* specify user's preference for a viewer: > "kfmclient exec" "gnome-open" @@ -727,7 +729,27 @@ NETRW BROWSER VARIABLES *netrw-brows < is used, then netrwFileHandler() will look for a script/function to handle the given extension. (see |netrw_filehandler|). -< + + *g:netrw_fastbrowse* =0: slow speed browsing, never re-use + directory listings; always obtain + directory listings. + =1: medium speed browsing, re-use directory + listings only when remote browsing. + (default value) + =2: fast browsing, only obtains directory + listings when the directory hasn't been + seen before (or |netrw-ctrl-l| is used). + Fast browsing retains old directory listing + buffers so that they don't need to be + re-acquired. This feature is especially + important for remote browsing. However, if + a file is introduced or deleted into or from + such directories, the old directory buffer + becomes out-of-date. One may always refresh + such a directory listing with |netrw-ctrl-l|. + This option gives the choice of the trade-off + between accuracy and speed to the user. + *g:netrw_ftp_browse_reject* ftp can produce a number of errors and warnings that can show up as "directories" and "files" in the listing. This pattern is used to @@ -819,6 +841,12 @@ NETRW BROWSER VARIABLES *netrw-brows *g:netrw_winsize* specify initial size of new o/v windows default: "" + *g:DrChipTopLvlMenu* This variable specifies the top level + submenu name; by default, its "DrChip.". + If you wish to change this, do so in your + .vimrc. It affects all of my plugins which + have menus. + INTRODUCTION TO DIRECTORY BROWSING *netrw-browse-intro* Netrw supports the browsing of directories on the local system and on remote @@ -843,6 +871,18 @@ For local directories, the trailing slas If you'd like to avoid entering the password in for remote directory listings with ssh or scp, see |netrw-listhack|. + +NETRW BROWSING AND OPTION INCOMPATIBILITIES *netrw-incompatible* + +Netrw will not work properly with > + + :set acd + :set fo=...ta... +< +If either of these options are present when browsing is attempted, netrw +will change them by using noacd and removing the ta suboptions from the +|formatoptions|. + *netrw-explore* *netrw-pexplore* *netrw-hexplore* *netrw-sexplore* DIRECTORY EXPLORING COMMANDS *netrw-nexplore* *netrw-vexplore* @@ -1094,9 +1134,9 @@ One may use a preview window (currently PREVIOUS WINDOW *netrw-P* *netrw-prvwin* -To edit a file or directory in the previously used window (see :he |CTRL-W_P|), +To edit a file or directory in the previously used window (see :he |ctrl-w_p|), press a "P". If there's only one window, then the one window will be -horizontally split (above/below splitting is controlled by |g:netrw_alto|, +horizontally split (above/below splitting is controlled by |g:netrw-alto|, and its initial size is controlled by |g:netrw_winsize|). If there's more than one window, the previous window will be re-used on @@ -1399,6 +1439,11 @@ which is loaded automatically at startup ============================================================================== 11. History *netrw-history* {{{1 + v79: * directories are now displayed with nowrap + * (bugfix) if the column width was smaller than the largest + file's name, then netrw would hang when using wide-listing + mode - fixed + * g:netrw_fastbrowse introduced v78: * progress has been made on allowing spaces inside directory names for remote work (reading, writing, browsing). (scp) v77: * Mikolaj Machowski fixed a bug in a substitute command diff --git a/runtime/doc/tags b/runtime/doc/tags --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -4117,6 +4117,7 @@ Ruby if_ruby.txt /*Ruby* Russian russian.txt /*Russian* S change.txt /*S* SHELL starting.txt /*SHELL* +SQLSetType sql.txt /*SQLSetType* Select visual.txt /*Select* Select-mode visual.txt /*Select-mode* Select-mode-mapping visual.txt /*Select-mode-mapping* @@ -4132,6 +4133,7 @@ Syntax autocmd.txt /*Syntax* T motion.txt /*T* TCL if_tcl.txt /*TCL* TERM starting.txt /*TERM* +TSQL sql.txt /*TSQL* TTpro-telnet syntax.txt /*TTpro-telnet* Tab intro.txt /*Tab* TabEnter autocmd.txt /*TabEnter* @@ -4139,6 +4141,7 @@ TabLeave autocmd.txt /*TabLeave* Tcl if_tcl.txt /*Tcl* TermChanged autocmd.txt /*TermChanged* TermResponse autocmd.txt /*TermResponse* +Transact-SQL sql.txt /*Transact-SQL* U undo.txt /*U* UTF-8 mbyte.txt /*UTF-8* UTF8-xterm mbyte.txt /*UTF8-xterm* @@ -5217,7 +5220,9 @@ ft-sgml-syntax syntax.txt /*ft-sgml-synt ft-sh-syntax syntax.txt /*ft-sh-syntax* ft-spec-plugin filetype.txt /*ft-spec-plugin* ft-spup-syntax syntax.txt /*ft-spup-syntax* +ft-sql filetype.txt /*ft-sql* ft-sql-syntax syntax.txt /*ft-sql-syntax* +ft-sqlanywhere-syntax syntax.txt /*ft-sqlanywhere-syntax* ft-sqlinformix-syntax syntax.txt /*ft-sqlinformix-syntax* ft-syntax-omni insert.txt /*ft-syntax-omni* ft-tcsh-syntax syntax.txt /*ft-tcsh-syntax* @@ -5260,12 +5265,14 @@ g'a motion.txt /*g'a* g, motion.txt /*g,* g0 motion.txt /*g0* g8 various.txt /*g8* +g:DrChipTopLvlMenu pi_netrw.txt /*g:DrChipTopLvlMenu* g:netrw_alto pi_netrw.txt /*g:netrw_alto* g:netrw_altv pi_netrw.txt /*g:netrw_altv* g:netrw_browse_split pi_netrw.txt /*g:netrw_browse_split* g:netrw_browsex_viewer pi_netrw.txt /*g:netrw_browsex_viewer* g:netrw_cygwin pi_netrw.txt /*g:netrw_cygwin* g:netrw_dav_cmd pi_netrw.txt /*g:netrw_dav_cmd* +g:netrw_fastbrowse pi_netrw.txt /*g:netrw_fastbrowse* g:netrw_fetch_cmd pi_netrw.txt /*g:netrw_fetch_cmd* g:netrw_ftp pi_netrw.txt /*g:netrw_ftp* g:netrw_ftp_browse_reject pi_netrw.txt /*g:netrw_ftp_browse_reject* @@ -5484,7 +5491,6 @@ hebrew hebrew.txt /*hebrew* hebrew.txt hebrew.txt /*hebrew.txt* help various.txt /*help* help-context help.txt /*help-context* -help-tags tags 1 help-translated various.txt /*help-translated* help-xterm-window various.txt /*help-xterm-window* help.txt help.txt /*help.txt* @@ -5734,6 +5740,7 @@ index() eval.txt /*index()* index.txt index.txt /*index.txt* info-message starting.txt /*info-message* inform.vim syntax.txt /*inform.vim* +informix sql.txt /*informix* initialization starting.txt /*initialization* input() eval.txt /*input()* inputdialog() eval.txt /*inputdialog()* @@ -6019,6 +6026,7 @@ multilang-messages mlang.txt /*multilang multilang-scripts mlang.txt /*multilang-scripts* myfiletypefile syntax.txt /*myfiletypefile* myscriptsfile syntax.txt /*myscriptsfile* +mysql sql.txt /*mysql* mysyntaxfile syntax.txt /*mysyntaxfile* mysyntaxfile-add syntax.txt /*mysyntaxfile-add* mysyntaxfile-replace syntax.txt /*mysyntaxfile-replace* @@ -6107,6 +6115,7 @@ netrw-hexplore pi_netrw.txt /*netrw-hexp netrw-history pi_netrw.txt /*netrw-history* netrw-horiz pi_netrw.txt /*netrw-horiz* netrw-i pi_netrw.txt /*netrw-i* +netrw-incompatible pi_netrw.txt /*netrw-incompatible* netrw-list pi_netrw.txt /*netrw-list* netrw-listbookmark pi_netrw.txt /*netrw-listbookmark* netrw-listhack pi_netrw.txt /*netrw-listhack* @@ -6269,6 +6278,7 @@ option-summary options.txt /*option-summ options options.txt /*options* options-changed version5.txt /*options-changed* options.txt options.txt /*options.txt* +oracle sql.txt /*oracle* os2 os_os2.txt /*os2* os2ansi os_os2.txt /*os2ansi* os390 os_390.txt /*os390* @@ -6341,6 +6351,7 @@ pi_gzip.txt pi_gzip.txt /*pi_gzip.txt* pi_netrw.txt pi_netrw.txt /*pi_netrw.txt* pi_paren.txt pi_paren.txt /*pi_paren.txt* pi_spec.txt pi_spec.txt /*pi_spec.txt* +plsql sql.txt /*plsql* plugin usr_05.txt /*plugin* plugin-details filetype.txt /*plugin-details* plugin-filetype usr_41.txt /*plugin-filetype* @@ -6356,6 +6367,7 @@ ports-6 version6.txt /*ports-6* posix vi_diff.txt /*posix* posix-compliance vi_diff.txt /*posix-compliance* posix-screen-size vi_diff.txt /*posix-screen-size* +postgress sql.txt /*postgress* postscr.vim syntax.txt /*postscr.vim* postscript-cjk-printing print.txt /*postscript-cjk-printing* postscript-print-encoding print.txt /*postscript-print-encoding* @@ -6379,6 +6391,7 @@ profiling repeat.txt /*profiling* profiling-variable eval.txt /*profiling-variable* progname-variable eval.txt /*progname-variable* progress.vim syntax.txt /*progress.vim* +psql sql.txt /*psql* ptcap.vim syntax.txt /*ptcap.vim* pterm-mouse options.txt /*pterm-mouse* pumvisible() eval.txt /*pumvisible()* @@ -6769,8 +6782,23 @@ sponsor-faq sponsor.txt /*sponsor-faq* sponsor.txt sponsor.txt /*sponsor.txt* spoon os_unix.txt /*spoon* spup.vim syntax.txt /*spup.vim* +sql-adding-dialects sql.txt /*sql-adding-dialects* +sql-dialects sql.txt /*sql-dialects* +sql-macros sql.txt /*sql-macros* +sql-matchit sql.txt /*sql-matchit* +sql-navigation sql.txt /*sql-navigation* +sql-object-motions sql.txt /*sql-object-motions* +sql-predefined-objects sql.txt /*sql-predefined-objects* +sql-type-default sql.txt /*sql-type-default* +sql-types sql.txt /*sql-types* +sql.txt sql.txt /*sql.txt* sql.vim syntax.txt /*sql.vim* +sqlanywhere sql.txt /*sqlanywhere* +sqlanywhere.vim syntax.txt /*sqlanywhere.vim* sqlinformix.vim syntax.txt /*sqlinformix.vim* +sqlj sql.txt /*sqlj* +sqlserver sql.txt /*sqlserver* +sqlsettype sql.txt /*sqlsettype* sscanf eval.txt /*sscanf* standard-plugin usr_05.txt /*standard-plugin* standard-plugin-list help.txt /*standard-plugin-list* @@ -6824,6 +6852,7 @@ swapchoice-variable eval.txt /*swapchoic swapcommand-variable eval.txt /*swapcommand-variable* swapfile-changed version4.txt /*swapfile-changed* swapname-variable eval.txt /*swapname-variable* +sybase sql.txt /*sybase* syn-sync-grouphere syntax.txt /*syn-sync-grouphere* syn-sync-groupthere syntax.txt /*syn-sync-groupthere* syn-sync-linecont syntax.txt /*syn-sync-linecont* diff --git a/runtime/menu.vim b/runtime/menu.vim --- a/runtime/menu.vim +++ b/runtime/menu.vim @@ -2,7 +2,7 @@ " You can also use this as a start for your own set of menus. " " Maintainer: Bram Moolenaar -" Last Change: 2006 Mar 05 +" Last Change: 2006 Mar 09 " Note that ":an" (short for ":anoremenu") is often used to make a menu work " in all modes and avoid side effects from mappings defined by the user. @@ -131,41 +131,6 @@ an 10.600 &File.-SEP4- an 10.610 &File.Sa&ve-Exit:wqa :confirm wqa an 10.620 &File.E&xit:qa :confirm qa -" Pasting blockwise and linewise selections is not possible in Insert and -" Visual mode without the +virtualedit feature. They are pasted as if they -" were characterwise instead. Add to that some tricks to leave the cursor in -" the right position, also for "gi". -" Note: the same stuff appears in mswin.vim. -if has("virtualedit") - let s:paste_cmd = ":call Paste()" - func! Paste() - let ove = &ve - set ve=all - normal! `^ - if @+ != '' - normal! "+gP - endif - let c = col(".") - normal! i - if col(".") < c " compensate for i moving the cursor left - normal! l - endif - let &ve = ove - endfunc -else - let s:paste_cmd = "\"=@+.'xy'gPFx\"_2x" -endif - -" Define the string to use for items that are present both in Edit, Popup and -" Toolbar menu. -if has("virtualedit") - let s:paste_v_cmd = '"-c' . s:paste_cmd - let s:paste_i_cmd = '' . s:paste_cmd . 'gi' -else - let s:paste_v_cmd = '"-cgix' . s:paste_cmd . '"_x' - let s:paste_i_cmd = 'x' . s:paste_cmd . '"_s' -endif - func! SelectAll() exe "norm gg" . (&slm == "" ? "VG" : "gH\G") endfunc @@ -182,8 +147,8 @@ vnoremenu 20.350 &Edit.&Copy"+y "+ cnoremenu 20.350 &Edit.&Copy"+y nnoremenu 20.360 &Edit.&Paste"+gP "+gP cnoremenu &Edit.&Paste"+gP + -exe 'vnoremenu