0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

updated for version 7.0191

This commit is contained in:
Bram Moolenaar
2006-02-01 21:51:12 +00:00
parent b8a7b560b1
commit afeb4fa8a7
9 changed files with 502 additions and 193 deletions

View File

@@ -1,7 +1,7 @@
" netrw.vim: Handles file transfer and remote directory listing across a network " netrw.vim: Handles file transfer and remote directory listing across a network
" AUTOLOAD PORTION " AUTOLOAD PORTION
" Date: Nov 28, 2005 " Date: Jan 30, 2006
" Version: 76 " Version: 78
" Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz> " Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
" Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1 " Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1
@@ -23,7 +23,7 @@
if &cp || exists("g:loaded_netrw") if &cp || exists("g:loaded_netrw")
finish finish
endif endif
let g:loaded_netrw = "v76" let g:loaded_netrw = "v78"
if v:version < 700 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 echohl WarningMsg | echo "***netrw*** you need vim version 7.0 or later for version ".g:loaded_netrw." of netrw" | echohl None
finish finish
@@ -32,8 +32,12 @@ let s:keepcpo= &cpo
set cpo&vim set cpo&vim
" call Decho("doing autoload/netrw.vim") " call Decho("doing autoload/netrw.vim")
" ======================
" Netrw Variables: {{{1
" ======================
" --------------------------------------------------------------------- " ---------------------------------------------------------------------
" Default values for netrw's global protocol variables {{{1 " Default values for netrw's global protocol variables {{{2
if !exists("g:netrw_dav_cmd") if !exists("g:netrw_dav_cmd")
let g:netrw_dav_cmd = "cadaver" let g:netrw_dav_cmd = "cadaver"
endif endif
@@ -84,14 +88,17 @@ if has("win32") || has("win95") || has("win64") || has("win16")
endif endif
" --------------------------------------------------------------------- " ---------------------------------------------------------------------
" Default values for netrw's global variables {{{1 " Default values for netrw's global variables {{{2
" Default values - a-c ---------- {{{2 " Default values - a-c ---------- {{{3
if !exists("g:netrw_alto") if !exists("g:netrw_alto")
let g:netrw_alto= 0 let g:netrw_alto= 0
endif endif
if !exists("g:netrw_altv") if !exists("g:netrw_altv")
let g:netrw_altv= 0 let g:netrw_altv= 0
endif endif
if !exists("g:netrw_browse_split")
let g:netrw_browse_split= 0
endif
if !exists("g:netrw_cygwin") if !exists("g:netrw_cygwin")
if has("win32") || has("win95") || has("win64") || has("win16") if has("win32") || has("win95") || has("win64") || has("win16")
if &shell == "bash" if &shell == "bash"
@@ -103,7 +110,7 @@ if !exists("g:netrw_cygwin")
let g:netrw_cygwin= 0 let g:netrw_cygwin= 0
endif endif
endif endif
" Default values - d-f ---------- {{{2 " Default values - d-f ---------- {{{3
if !exists("g:NETRW_DIRHIST_CNT") if !exists("g:NETRW_DIRHIST_CNT")
let g:NETRW_DIRHIST_CNT= 0 let g:NETRW_DIRHIST_CNT= 0
endif endif
@@ -123,7 +130,7 @@ endif
if !exists("g:netrw_ftpmode") if !exists("g:netrw_ftpmode")
let g:netrw_ftpmode= "binary" let g:netrw_ftpmode= "binary"
endif endif
" Default values - h-lh ---------- {{{2 " Default values - h-lh ---------- {{{3
if !exists("g:netrw_hide") if !exists("g:netrw_hide")
let g:netrw_hide= 1 let g:netrw_hide= 1
endif endif
@@ -142,7 +149,7 @@ endif
if !exists("g:netrw_list_hide") if !exists("g:netrw_list_hide")
let g:netrw_list_hide= "" let g:netrw_list_hide= ""
endif endif
" Default values - lh-lz ---------- {{{2 " Default values - lh-lz ---------- {{{3
if !exists("g:netrw_local_mkdir") if !exists("g:netrw_local_mkdir")
let g:netrw_local_mkdir= "mkdir" let g:netrw_local_mkdir= "mkdir"
endif endif
@@ -159,7 +166,7 @@ endif
if g:netrw_longlist == 1 if g:netrw_longlist == 1
let g:netrw_list_cmd= g:netrw_list_cmd." -l" let g:netrw_list_cmd= g:netrw_list_cmd." -l"
endif endif
" Default values - m-r ---------- {{{2 " Default values - m-r ---------- {{{3
if !exists("g:netrw_maxfilenamelen") if !exists("g:netrw_maxfilenamelen")
let g:netrw_maxfilenamelen= 32 let g:netrw_maxfilenamelen= 32
endif endif
@@ -178,7 +185,7 @@ endif
if !exists("g:netrw_rmf_cmd") if !exists("g:netrw_rmf_cmd")
let g:netrw_rmf_cmd = g:netrw_ssh_cmd." HOSTNAME rm -f" let g:netrw_rmf_cmd = g:netrw_ssh_cmd." HOSTNAME rm -f"
endif endif
" Default values - s ---------- {{{2 " Default values - s ---------- {{{3
if exists("g:netrw_silent") && g:netrw_silent != 0 if exists("g:netrw_silent") && g:netrw_silent != 0
let g:netrw_silentxfer= "silent " let g:netrw_silentxfer= "silent "
else else
@@ -198,7 +205,7 @@ endif
if !exists("g:netrw_ssh_browse_reject") if !exists("g:netrw_ssh_browse_reject")
let g:netrw_ssh_browse_reject='^total\s\+\d\+$' let g:netrw_ssh_browse_reject='^total\s\+\d\+$'
endif endif
" Default values - t-w ---------- {{{2 " Default values - t-w ---------- {{{3
if !exists("g:netrw_timefmt") if !exists("g:netrw_timefmt")
let g:netrw_timefmt= "%c" let g:netrw_timefmt= "%c"
endif endif
@@ -209,7 +216,7 @@ if !exists("g:netrw_winsize")
let g:netrw_winsize= "" let g:netrw_winsize= ""
endif endif
" --------------------------------------------------------------------- " ---------------------------------------------------------------------
" Default values for netrw's script variables: {{{1 " Default values for netrw's script variables: {{{2
if !exists("s:netrw_cd_escape") if !exists("s:netrw_cd_escape")
if has("win32") || has("win95") || has("win64") || has("win16") if has("win32") || has("win95") || has("win64") || has("win16")
let s:netrw_cd_escape="#% " let s:netrw_cd_escape="#% "
@@ -230,8 +237,12 @@ endif
" files read by network transfer aren't appropriately highlighted. " files read by network transfer aren't appropriately highlighted.
"let g:decho_bufenter = 1 "Decho "let g:decho_bufenter = 1 "Decho
" ==============================
" Netrw Utility Functions: {{{1
" ==============================
" ------------------------------------------------------------------------ " ------------------------------------------------------------------------
" NetSavePosn: saves position of cursor on screen {{{1 " NetSavePosn: saves position of cursor on screen {{{2
fun! netrw#NetSavePosn() fun! netrw#NetSavePosn()
" call Dfunc("NetSavePosn()") " call Dfunc("NetSavePosn()")
" Save current line and column " Save current line and column
@@ -248,7 +259,7 @@ fun! netrw#NetSavePosn()
endfun endfun
" ------------------------------------------------------------------------ " ------------------------------------------------------------------------
" NetRestorePosn: restores the cursor and file position as saved by NetSavePosn() {{{1 " NetRestorePosn: restores the cursor and file position as saved by NetSavePosn() {{{2
fun! netrw#NetRestorePosn() fun! netrw#NetRestorePosn()
" call Dfunc("NetRestorePosn() winnr=".w:netrw_winnr." line=".w:netrw_line." col=".w:netrw_col." hline=".w:netrw_hline) " call Dfunc("NetRestorePosn() winnr=".w:netrw_winnr." line=".w:netrw_line." col=".w:netrw_col." hline=".w:netrw_hline)
let eikeep= &ei let eikeep= &ei
@@ -275,15 +286,19 @@ fun! netrw#NetRestorePosn()
" call Dret("NetRestorePosn") " call Dret("NetRestorePosn")
endfun endfun
" ===============================
" Netrw Transfer Functions: {{{1
" ===============================
" ------------------------------------------------------------------------ " ------------------------------------------------------------------------
" NetRead: responsible for reading a file over the net {{{1 " NetRead: responsible for reading a file over the net {{{2
fun! netrw#NetRead(...) fun! netrw#NetRead(...)
" call Dfunc("NetRead(a:1<".a:1.">)") " call Dfunc("NetRead(a:1<".a:1.">)")
" save options " save options
call s:NetOptionSave() call s:NetOptionSave()
" Special Exception: if a file is named "0r", then " Special Exception: if a file is named "0r", then {{{3
" "0r" will be used to read the " "0r" will be used to read the
" following files instead of "r" " following files instead of "r"
if a:0 == 0 if a:0 == 0
@@ -297,7 +312,7 @@ fun! netrw#NetRead(...)
let ichoice = 1 let ichoice = 1
endif endif
" get name of a temporary file and set up shell-quoting character " get name of a temporary file and set up shell-quoting character {{{3
let tmpfile= tempname() let tmpfile= tempname()
let tmpfile= substitute(tmpfile,'\','/','ge') let tmpfile= substitute(tmpfile,'\','/','ge')
if !isdirectory(substitute(tmpfile,'[^/]\+$','','e')) if !isdirectory(substitute(tmpfile,'[^/]\+$','','e'))
@@ -377,7 +392,7 @@ fun! netrw#NetRead(...)
let tmpfile = fnamemodify(tmpfile,':t') let tmpfile = fnamemodify(tmpfile,':t')
endif endif
" Determine method of read (ftp, rcp, etc) " Determine method of read (ftp, rcp, etc) {{{3
call s:NetMethod(choice) call s:NetMethod(choice)
" Check if NetBrowse() should be handling this request " Check if NetBrowse() should be handling this request
@@ -389,21 +404,21 @@ fun! netrw#NetRead(...)
endif endif
" use filename's suffix for the temporary file " use filename's suffix for the temporary file
if b:netrw_fname =~ '\.[^./]\+' if b:netrw_fname =~ '\.[^./]\+$'
let suffix = substitute(b:netrw_fname,'^.*\(\.[^./]\+\)','\1','e') let suffix = substitute(b:netrw_fname,'^.*\(\.[^./]\+\)$','\1','e')
let tmpfile= substitute(tmpfile,"$",suffix,'e') let tmpfile= substitute(tmpfile,"$",suffix,'e')
" call Decho("chgd tmpfile<".tmpfile."> (added ".suffix." suffix)") " call Decho("chgd tmpfile<".tmpfile."> (added ".suffix." suffix) netrw_fname<".b:netrw_fname.">")
endif endif
" ============ " ============
" Perform Read " Perform Protocol-Based Read {{{3
" ============ " ===========================
if exists("g:netrw_silent") && g:netrw_silent == 0 && &ch >= 1 if exists("g:netrw_silent") && g:netrw_silent == 0 && &ch >= 1
echo "(netrw) Processing your read request..." echo "(netrw) Processing your read request..."
endif endif
"......................................... ".........................................
" rcp: NetRead Method #1 " rcp: NetRead Method #1 {{{3
if b:netrw_method == 1 " read with rcp if b:netrw_method == 1 " read with rcp
" call Decho("read via rcp (method #1)") " call Decho("read via rcp (method #1)")
" ER: noting done with g:netrw_uid yet? " ER: noting done with g:netrw_uid yet?
@@ -430,7 +445,7 @@ fun! netrw#NetRead(...)
let b:netrw_lastfile = choice let b:netrw_lastfile = choice
"......................................... ".........................................
" ftp + <.netrc>: NetRead Method #2 " ftp + <.netrc>: NetRead Method #2 {{{3
elseif b:netrw_method == 2 " read with ftp + <.netrc> elseif b:netrw_method == 2 " read with ftp + <.netrc>
" call Decho("read via ftp+.netrc (method #2)") " call Decho("read via ftp+.netrc (method #2)")
let netrw_fname= b:netrw_fname let netrw_fname= b:netrw_fname
@@ -460,7 +475,7 @@ fun! netrw#NetRead(...)
let b:netrw_lastfile = choice let b:netrw_lastfile = choice
"......................................... ".........................................
" ftp + machine,id,passwd,filename: NetRead Method #3 " ftp + machine,id,passwd,filename: NetRead Method #3 {{{3
elseif b:netrw_method == 3 " read with ftp + machine, id, passwd, and fname elseif b:netrw_method == 3 " read with ftp + machine, id, passwd, and fname
" Construct execution string (four lines) which will be passed through filter " Construct execution string (four lines) which will be passed through filter
" call Decho("read via ftp+mipf (method #3)") " call Decho("read via ftp+mipf (method #3)")
@@ -512,7 +527,7 @@ fun! netrw#NetRead(...)
let b:netrw_lastfile = choice let b:netrw_lastfile = choice
"......................................... ".........................................
" scp: NetRead Method #4 " scp: NetRead Method #4 {{{3
elseif b:netrw_method == 4 " read with scp elseif b:netrw_method == 4 " read with scp
" call Decho("read via scp (method #4)") " call Decho("read via scp (method #4)")
if exists("g:netrw_port") && g:netrw_port != "" if exists("g:netrw_port") && g:netrw_port != ""
@@ -522,17 +537,18 @@ fun! netrw#NetRead(...)
endif endif
if g:netrw_cygwin == 1 if g:netrw_cygwin == 1
let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e') let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e')
" call Decho("executing: !".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,' ?&')."' ".cygtmpfile)
exe g:netrw_silentxfer."!".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
else else
" call Decho("executing: !".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,' ?&')."' ".tmpfile)
exe g:netrw_silentxfer."!".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
endif endif
let result = s:NetGetFile(readcmd, tmpfile, b:netrw_method) let result = s:NetGetFile(readcmd, tmpfile, b:netrw_method)
let b:netrw_lastfile = choice let b:netrw_lastfile = choice
"......................................... ".........................................
elseif b:netrw_method == 5 " read with http (wget) " http: NetRead Method #5 (wget) {{{3
elseif b:netrw_method == 5
" call Decho("read via http (method #5)") " call Decho("read via http (method #5)")
if g:netrw_http_cmd == "" if g:netrw_http_cmd == ""
if !exists("g:netrw_quiet") if !exists("g:netrw_quiet")
@@ -564,8 +580,8 @@ fun! netrw#NetRead(...)
let b:netrw_lastfile = choice let b:netrw_lastfile = choice
"......................................... ".........................................
" cadaver: NetRead Method #6 " cadaver: NetRead Method #6 {{{3
elseif b:netrw_method == 6 " read with cadaver elseif b:netrw_method == 6
" call Decho("read via cadaver (method #6)") " call Decho("read via cadaver (method #6)")
" Construct execution string (four lines) which will be passed through filter " Construct execution string (four lines) which will be passed through filter
@@ -596,8 +612,8 @@ fun! netrw#NetRead(...)
let b:netrw_lastfile = choice let b:netrw_lastfile = choice
"......................................... ".........................................
" rsync: NetRead Method #7 " rsync: NetRead Method #7 {{{3
elseif b:netrw_method == 7 " read with rsync elseif b:netrw_method == 7
" call Decho("read via rsync (method #7)") " call Decho("read via rsync (method #7)")
if g:netrw_cygwin == 1 if g:netrw_cygwin == 1
let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e') let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e')
@@ -611,9 +627,9 @@ fun! netrw#NetRead(...)
let b:netrw_lastfile = choice let b:netrw_lastfile = choice
"......................................... ".........................................
" fetch: NetRead Method #8 " fetch: NetRead Method #8 {{{3
" fetch://[user@]host[:http]/path " fetch://[user@]host[:http]/path
elseif b:netrw_method == 8 " read with fetch elseif b:netrw_method == 8
if g:netrw_fetch_cmd == "" if g:netrw_fetch_cmd == ""
if !exists("g:netrw_quiet") if !exists("g:netrw_quiet")
echohl Error | echo "***netrw*** fetch command not available" | echohl None echohl Error | echo "***netrw*** fetch command not available" | echohl None
@@ -640,8 +656,8 @@ fun! netrw#NetRead(...)
let b:netrw_lastfile = choice let b:netrw_lastfile = choice
"......................................... ".........................................
" sftp: NetRead Method #9 " sftp: NetRead Method #9 {{{3
elseif b:netrw_method == 9 " read with sftp elseif b:netrw_method == 9
" call Decho("read via sftp (method #4)") " call Decho("read via sftp (method #4)")
if g:netrw_cygwin == 1 if g:netrw_cygwin == 1
let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e') let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e')
@@ -656,12 +672,13 @@ fun! netrw#NetRead(...)
let b:netrw_lastfile = choice let b:netrw_lastfile = choice
"......................................... ".........................................
else " Complain " Complain {{{3
else
echo "***warning*** unable to comply with your request<" . choice . ">" echo "***warning*** unable to comply with your request<" . choice . ">"
endif endif
endwhile endwhile
" cleanup " cleanup {{{3
" call Decho("cleanup") " call Decho("cleanup")
if exists("b:netrw_method") if exists("b:netrw_method")
unlet b:netrw_method unlet b:netrw_method
@@ -673,7 +690,7 @@ fun! netrw#NetRead(...)
endfun endfun
" ------------------------------------------------------------------------ " ------------------------------------------------------------------------
" NetGetFile: Function to read temporary file "tfile" with command "readcmd". {{{1 " NetGetFile: Function to read temporary file "tfile" with command "readcmd". {{{2
fun! s:NetGetFile(readcmd, tfile, method) 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.">)")
@@ -715,13 +732,14 @@ fun! s:NetGetFile(readcmd, tfile, method)
elseif rfile =~ '\.tar$' elseif rfile =~ '\.tar$'
call tar#Browse(tfile) call tar#Browse(tfile)
else else
" call Decho("edit temporary file")
e e
endif endif
" rename buffer back to remote filename " rename buffer back to remote filename
keepalt exe "file ".rfile keepalt exe "file ".escape(rfile,' ')
filetype detect filetype detect
" call Dredir("ls!","renamed buffer back to remote filename<".rfile.">") " call Dredir("ls!","renamed buffer back to remote filename<".rfile."> : expand(%)<".expand("%").">")
let line1 = 1 let line1 = 1
let line2 = line("$") let line2 = line("$")
@@ -764,7 +782,7 @@ fun! s:NetGetFile(readcmd, tfile, method)
endfun endfun
" ------------------------------------------------------------------------ " ------------------------------------------------------------------------
" NetWrite: responsible for writing a file over the net {{{1 " NetWrite: responsible for writing a file over the net {{{2
fun! netrw#NetWrite(...) range fun! netrw#NetWrite(...) range
" call Dfunc("NetWrite(a:0=".a:0.")") " call Dfunc("NetWrite(a:0=".a:0.")")
@@ -772,7 +790,7 @@ fun! netrw#NetWrite(...) range
let mod= 0 let mod= 0
call s:NetOptionSave() call s:NetOptionSave()
" Get Temporary Filename " Get Temporary Filename {{{3
let tmpfile= tempname() let tmpfile= tempname()
if !isdirectory(substitute(tmpfile,'[^/]\+$','','e')) if !isdirectory(substitute(tmpfile,'[^/]\+$','','e'))
echohl Error | echo "***netrw*** your ".substitute(tmpfile,'[^/]\+$','','e')." directory is missing!" echohl Error | echo "***netrw*** your ".substitute(tmpfile,'[^/]\+$','','e')." directory is missing!"
@@ -800,6 +818,7 @@ fun! netrw#NetWrite(...) range
while ichoice <= a:0 while ichoice <= a:0
" Process arguments: {{{3
" attempt to repeat with previous host-file-etc " attempt to repeat with previous host-file-etc
if exists("b:netrw_lastfile") && a:0 == 0 if exists("b:netrw_lastfile") && a:0 == 0
" call Decho("using b:netrw_lastfile<" . b:netrw_lastfile . ">") " call Decho("using b:netrw_lastfile<" . b:netrw_lastfile . ">")
@@ -860,19 +879,19 @@ fun! netrw#NetWrite(...) range
let tmpfile = fnamemodify(tmpfile,':t') let tmpfile = fnamemodify(tmpfile,':t')
endif endif
" Determine method of read (ftp, rcp, etc) " Determine method of read (ftp, rcp, etc) {{{3
call s:NetMethod(choice) call s:NetMethod(choice)
" ============= " =============
" Perform Write " Perform Protocol-Based Write {{{3
" ============= " ============================
if exists("g:netrw_silent") && g:netrw_silent == 0 && &ch >= 1 if exists("g:netrw_silent") && g:netrw_silent == 0 && &ch >= 1
echo "(netrw) Processing your write request..." echo "(netrw) Processing your write request..."
endif endif
"......................................... ".........................................
" rcp: NetWrite Method #1 " rcp: NetWrite Method #1 {{{3
if b:netrw_method == 1 " write with rcp if b:netrw_method == 1
" call Decho("write via rcp (method #1)") " call Decho("write via rcp (method #1)")
if s:netrw_has_nt_rcp == 1 if s:netrw_has_nt_rcp == 1
if exists("g:netrw_uid") && ( g:netrw_uid != "" ) if exists("g:netrw_uid") && ( g:netrw_uid != "" )
@@ -892,8 +911,8 @@ fun! netrw#NetWrite(...) range
let b:netrw_lastfile = choice let b:netrw_lastfile = choice
"......................................... ".........................................
" ftp + <.netrc>: NetWrite Method #2 " ftp + <.netrc>: NetWrite Method #2 {{{3
elseif b:netrw_method == 2 " write with ftp + <.netrc> elseif b:netrw_method == 2
let netrw_fname = b:netrw_fname let netrw_fname = b:netrw_fname
new new
setlocal ff=unix setlocal ff=unix
@@ -920,8 +939,8 @@ fun! netrw#NetWrite(...) range
let b:netrw_lastfile = choice let b:netrw_lastfile = choice
"......................................... ".........................................
" ftp + machine, id, passwd, filename: NetWrite Method #3 " ftp + machine, id, passwd, filename: NetWrite Method #3 {{{3
elseif b:netrw_method == 3 " write with ftp + machine, id, passwd, and fname elseif b:netrw_method == 3
let netrw_fname= b:netrw_fname let netrw_fname= b:netrw_fname
new new
setlocal ff=unix setlocal ff=unix
@@ -964,8 +983,8 @@ fun! netrw#NetWrite(...) range
bd! bd!
"......................................... ".........................................
" scp: NetWrite Method #4 " scp: NetWrite Method #4 {{{3
elseif b:netrw_method == 4 " write with scp elseif b:netrw_method == 4
if exists("g:netrw_port") && g:netrw_port != "" if exists("g:netrw_port") && g:netrw_port != ""
let useport= " -P ".g:netrw_port let useport= " -P ".g:netrw_port
else else
@@ -973,16 +992,16 @@ fun! netrw#NetWrite(...) range
endif endif
if g:netrw_cygwin == 1 if g:netrw_cygwin == 1
let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e') let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e')
" call Decho("executing: !".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.":".escape(b:netrw_fname,' ?&')."'")
exe g:netrw_silentxfer."!".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,' ?&')."'"
else else
" call Decho("executing: !".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.":".escape(b:netrw_fname,' ?&')."'")
exe g:netrw_silentxfer."!".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,' ?&')."'"
endif endif
let b:netrw_lastfile = choice let b:netrw_lastfile = choice
"......................................... ".........................................
" http: NetWrite Method #5 " http: NetWrite Method #5 {{{3
elseif b:netrw_method == 5 elseif b:netrw_method == 5
if !exists("g:netrw_quiet") if !exists("g:netrw_quiet")
echohl Error | echo "***netrw*** currently <netrw.vim> does not support writing using http:" | echohl None echohl Error | echo "***netrw*** currently <netrw.vim> does not support writing using http:" | echohl None
@@ -990,8 +1009,8 @@ fun! netrw#NetWrite(...) range
endif endif
"......................................... ".........................................
" dav: NetWrite Method #6 " dav: NetWrite Method #6 (cadaver) {{{3
elseif b:netrw_method == 6 " write with cadaver elseif b:netrw_method == 6
" call Decho("write via cadaver (method #6)") " call Decho("write via cadaver (method #6)")
" Construct execution string (four lines) which will be passed through filter " Construct execution string (four lines) which will be passed through filter
@@ -1020,8 +1039,8 @@ fun! netrw#NetWrite(...) range
let b:netrw_lastfile = choice let b:netrw_lastfile = choice
"......................................... ".........................................
" rsync: NetWrite Method #7 " rsync: NetWrite Method #7 {{{3
elseif b:netrw_method == 7 " write with rsync elseif b:netrw_method == 7
if g:netrw_cygwin == 1 if g:netrw_cygwin == 1
let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e') let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e')
" call Decho("executing: !".g:netrw_rsync_cmd." ".cygtmpfile." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')) " call Decho("executing: !".g:netrw_rsync_cmd." ".cygtmpfile." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&'))
@@ -1033,8 +1052,8 @@ fun! netrw#NetWrite(...) range
let b:netrw_lastfile = choice let b:netrw_lastfile = choice
"......................................... ".........................................
" scp: NetWrite Method #9 " sftp: NetWrite Method #9 {{{3
elseif b:netrw_method == 9 " write with sftp elseif b:netrw_method == 9
let netrw_fname= b:netrw_fname let netrw_fname= b:netrw_fname
if exists("g:netrw_uid") && ( g:netrw_uid != "" ) if exists("g:netrw_uid") && ( g:netrw_uid != "" )
let uid_machine = g:netrw_uid .'@'. g:netrw_machine let uid_machine = g:netrw_uid .'@'. g:netrw_machine
@@ -1051,12 +1070,13 @@ fun! netrw#NetWrite(...) range
let b:netrw_lastfile= choice let b:netrw_lastfile= choice
"......................................... ".........................................
else " Complain " Complain {{{3
else
echo "***warning*** unable to comply with your request<" . choice . ">" echo "***warning*** unable to comply with your request<" . choice . ">"
endif endif
endwhile endwhile
" cleanup " cleanup {{{3
" call Decho("cleanup") " call Decho("cleanup")
let result=delete(tmpfile) let result=delete(tmpfile)
call s:NetOptionRestore() call s:NetOptionRestore()
@@ -1072,6 +1092,7 @@ endfun
" Remote Directory Browsing Support: {{{1 " Remote Directory Browsing Support: {{{1
" =========================================== " ===========================================
" ---------------------------------------------------------------------
" NetBrowse: This function uses the command in g:netrw_list_cmd to get a list {{{2 " NetBrowse: This function uses the command in g:netrw_list_cmd to get a list {{{2
" of the contents of a remote directory. It is assumed that the " of the contents of a remote directory. It is assumed that the
" g:netrw_list_cmd has a string, HOSTNAME, that needs to be substituted " g:netrw_list_cmd has a string, HOSTNAME, that needs to be substituted
@@ -1235,10 +1256,10 @@ fun! s:NetBrowse(dirname)
" call Decho("exe file ".escape(bufname,s:netrw_cd_escape)) " call Decho("exe file ".escape(bufname,s:netrw_cd_escape))
exe 'file '.escape(bufname,s:netrw_cd_escape) exe 'file '.escape(bufname,s:netrw_cd_escape)
" call Decho("renaming file to bufname<".bufname.">") " call Decho("renaming file to bufname<".bufname.">")
setlocal bh=hide bt=nofile nobl nonu setlocal bh=hide bt=nofile nobl nonu noswf
" save current directory on directory history list " save current directory on directory history list
call <SID>NetBookmarkDir(3,expand("%")) call s:NetBookmarkDir(3,expand("%"))
" set up buffer-local mappings " set up buffer-local mappings
" call Decho("set up buffer-local mappings") " call Decho("set up buffer-local mappings")
@@ -1256,6 +1277,7 @@ fun! s:NetBrowse(dirname)
nnoremap <buffer> <silent> i :call <SID>NetLongList(0)<cr> nnoremap <buffer> <silent> i :call <SID>NetLongList(0)<cr>
nnoremap <buffer> <silent> o :call <SID>NetSplit(0)<cr> nnoremap <buffer> <silent> o :call <SID>NetSplit(0)<cr>
nnoremap <buffer> <silent> O :call <SID>NetObtain()<cr> nnoremap <buffer> <silent> O :call <SID>NetObtain()<cr>
nnoremap <buffer> <silent> P :call <SID>NetPrevWinOpen(0)<cr>
nnoremap <buffer> <silent> q :<c-u>call <SID>NetBookmarkDir(2,expand("%"))<cr> nnoremap <buffer> <silent> q :<c-u>call <SID>NetBookmarkDir(2,expand("%"))<cr>
nnoremap <buffer> <silent> r :let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'<bar>exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),'./'))<cr> nnoremap <buffer> <silent> r :let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'<bar>exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),'./'))<cr>
nnoremap <buffer> <silent> s :call <SID>NetSaveWordPosn()<bar>let g:netrw_sort_by= (g:netrw_sort_by =~ 'n')? 'time' : (g:netrw_sort_by =~ 't')? 'size' : 'name'<bar>exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),'./'))<bar>call <SID>NetRestoreWordPosn()<cr> nnoremap <buffer> <silent> s :call <SID>NetSaveWordPosn()<bar>let g:netrw_sort_by= (g:netrw_sort_by =~ 'n')? 'time' : (g:netrw_sort_by =~ 't')? 'size' : 'name'<bar>exe "norm! 0"<bar>call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),'./'))<bar>call <SID>NetRestoreWordPosn()<cr>
@@ -1263,7 +1285,7 @@ fun! s:NetBrowse(dirname)
nnoremap <buffer> <silent> u :<c-u>call <SID>NetBookmarkDir(4,expand("%"))<cr> nnoremap <buffer> <silent> u :<c-u>call <SID>NetBookmarkDir(4,expand("%"))<cr>
nnoremap <buffer> <silent> U :<c-u>call <SID>NetBookmarkDir(5,expand("%"))<cr> nnoremap <buffer> <silent> U :<c-u>call <SID>NetBookmarkDir(5,expand("%"))<cr>
nnoremap <buffer> <silent> v :call <SID>NetSplit(1)<cr> nnoremap <buffer> <silent> v :call <SID>NetSplit(1)<cr>
nnoremap <buffer> <silent> x :call <SID>NetBrowseX(<SID>NetBrowseChgDir(expand("%"),<SID>NetGetWord()),1)<cr> nnoremap <buffer> <silent> x :call netrw#NetBrowseX(<SID>NetBrowseChgDir(expand("%"),<SID>NetGetWord()),1)<cr>
nnoremap <buffer> <silent> <2-leftmouse> :call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),<SID>NetGetWord()))<cr> nnoremap <buffer> <silent> <2-leftmouse> :call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),<SID>NetGetWord()))<cr>
exe 'nnoremap <buffer> <silent> <del> :call <SID>NetBrowseRm("'.user.machine.'","'.path.'")<cr>' exe 'nnoremap <buffer> <silent> <del> :call <SID>NetBrowseRm("'.user.machine.'","'.path.'")<cr>'
exe 'vnoremap <buffer> <silent> <del> :call <SID>NetBrowseRm("'.user.machine.'","'.path.'")<cr>' exe 'vnoremap <buffer> <silent> <del> :call <SID>NetBrowseRm("'.user.machine.'","'.path.'")<cr>'
@@ -1446,6 +1468,13 @@ fun! s:NetBrowseChgDir(dirname,newdir)
if newdir !~ '[\/]$' if newdir !~ '[\/]$'
" handling a file " handling a file
let dirname= dirname.newdir let dirname= dirname.newdir
if g:netrw_browse_split == 1
new
wincmd _
elseif g:netrw_browse_split == 2
rightb vert new
wincmd |
endif
" call Decho("handling a file: dirname<".dirname.">") " call Decho("handling a file: dirname<".dirname.">")
elseif newdir == './' elseif newdir == './'
@@ -1479,7 +1508,7 @@ fun! s:NetBrowseChgDir(dirname,newdir)
endfun endfun
" --------------------------------------------------------------------- " ---------------------------------------------------------------------
" NetGetWord: it gets the directory named under the cursor " NetGetWord: it gets the directory named under the cursor {{{2
fun! s:NetGetWord() fun! s:NetGetWord()
" call Dfunc("NetGetWord() line#".line(".")) " call Dfunc("NetGetWord() line#".line("."))
call s:UseBufWinVars() call s:UseBufWinVars()
@@ -1651,7 +1680,7 @@ fun! s:NetBrowseRm(usrhost,path) range
" refresh the directory " refresh the directory
let curline= line(".")-1 let curline= line(".")-1
" call Decho("refresh the directory") " call Decho("refresh the directory")
call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),'./')) call s:NetBrowse(s:NetBrowseChgDir(expand("%"),'./'))
exe curline exe curline
" call Dret("NetBrowseRm") " call Dret("NetBrowseRm")
@@ -1692,7 +1721,7 @@ fun! s:NetBrowseRename(usrhost,path) range
" refresh the directory " refresh the directory
let curline= line(".") let curline= line(".")
call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),'./')) call s:NetBrowse(s:NetBrowseChgDir(expand("%"),'./'))
exe "keepjumps ".curline exe "keepjumps ".curline
" call Dret("NetBrowseRename") " call Dret("NetBrowseRename")
endfun endfun
@@ -1721,29 +1750,29 @@ endfun
" =2 : local and o " =2 : local and o
" =3 : local and v " =3 : local and v
fun! s:NetSplit(mode) fun! s:NetSplit(mode)
" call Dfunc("NetSplit(mode=".a:mode.")") " call Dfunc("NetSplit(mode=".a:mode.") alto=".g:netrw_alto." altv=".g:netrw_altv)
call s:SaveWinVars() call s:SaveWinVars()
if a:mode == 0 if a:mode == 0
exe (g:netrw_alto? "bel " : "abo ").g:netrw_winsize."wincmd s" exe (g:netrw_alto? "bel " : "abo ").g:netrw_winsize."wincmd s"
call s:CopyWinVars() call s:CopyWinVars()
exe "norm! 0" exe "norm! 0"
call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),<SID>NetGetWord())) call s:NetBrowse(s:NetBrowseChgDir(expand("%"),s:NetGetWord()))
elseif a:mode ==1 elseif a:mode ==1
exe (g:netrw_altv? "rightb " : "lefta ").g:netrw_winsize."wincmd v" exe (g:netrw_altv? "rightb " : "lefta ").g:netrw_winsize."wincmd v"
call s:CopyWinVars() call s:CopyWinVars()
exe "norm! 0" exe "norm! 0"
call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),<SID>NetGetWord())) call s:NetBrowse(s:NetBrowseChgDir(expand("%"),s:NetGetWord()))
elseif a:mode ==2 elseif a:mode ==2
exe (g:netrw_alto? "bel " : "abo ").g:netrw_winsize."wincmd s" exe (g:netrw_alto? "bel " : "abo ").g:netrw_winsize."wincmd s"
call s:CopyWinVars() call s:CopyWinVars()
exe "norm! 0" exe "norm! 0"
call s:LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord())) call s:LocalBrowse(s:LocalBrowseChgDir(b:netrw_curdir,s:NetGetWord()))
else else
exe (g:netrw_altv? "rightb " : "lefta ").g:netrw_winsize."wincmd v" exe (g:netrw_altv? "rightb " : "lefta ").g:netrw_winsize."wincmd v"
call s:CopyWinVars() call s:CopyWinVars()
exe "norm! 0" exe "norm! 0"
call s:LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord())) call s:LocalBrowse(s:LocalBrowseChgDir(b:netrw_curdir,s:NetGetWord()))
endif endif
" call Dret("NetSplit") " call Dret("NetSplit")
@@ -1752,8 +1781,8 @@ endfun
" --------------------------------------------------------------------- " ---------------------------------------------------------------------
" NetBrowseX: allows users to write custom functions to operate on {{{2 " NetBrowseX: allows users to write custom functions to operate on {{{2
" files given their extension. Passes 0=local, 1=remote " files given their extension. Passes 0=local, 1=remote
fun! s:NetBrowseX(fname,remote) fun! netrw#NetBrowseX(fname,remote)
" call Dfunc("NetBrowseX(".a:fname." remote=".a:remote.")") " call Dfunc("NetBrowseX(fname<".a:fname."> remote=".a:remote.")")
" set up the filename " set up the filename
" (lower case the extension, make a local copy of a remote file) " (lower case the extension, make a local copy of a remote file)
@@ -1764,6 +1793,23 @@ fun! s:NetBrowseX(fname,remote)
let fname= escape(a:fname,"%#") let fname= escape(a:fname,"%#")
" call Decho("fname<".fname."> after escape()") " call Decho("fname<".fname."> after escape()")
" 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")
if has("unix")
let v:shell_error=0
silent! let s:haskicker= system('ps -e') =~ 'kicker'
if v:shell_error
let s:haskicker = 0
let v:shell_error = 0
endif
else
let s:haskicker= 0
endif
" call Decho("setting s:haskicker=".s:haskicker)
endif
if a:remote == 1 if a:remote == 1
" create a local copy " create a local copy
let fname= tempname().".".exten let fname= tempname().".".exten
@@ -1783,18 +1829,31 @@ fun! s:NetBrowseX(fname,remote)
endif endif
" call Decho("redir:".redir.":") " call Decho("redir:".redir.":")
if exists("g:netrw_browsex_viewer") && executable(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
else
" call Decho("exe silent !".g:netrw_browsex_viewer." '".escape(fname,'%#')."' ".redir)
exe "silent !".g:netrw_browsex_viewer." '".escape(fname,'%#')."'".redir
let ret= v:shell_error
endif
" execute the file handler " execute the file handler
if has("win32") || has("win64") elseif has("win32") || has("win64")
" call Decho('exe silent !start rundll32 url.dll,FileProtocolHandler "'.escape(fname, '%#').'"') " call Decho('exe silent !start rundll32 url.dll,FileProtocolHandler "'.escape(fname, '%#').'"')
exe 'silent !start rundll32 url.dll,FileProtocolHandler "'.escape(fname, '%#').'"' exe 'silent !start rundll32 url.dll,FileProtocolHandler "'.escape(fname, '%#').'"'
let ret= v:shell_error let ret= v:shell_error
elseif has("unix") && executable("gnome-open") elseif has("unix") && executable("gnome-open") && !s:haskicker
" call Decho("exe silent !gnome-open '".escape(fname,'%#')."' ".redir) " call Decho("exe silent !gnome-open '".escape(fname,'%#')."' ".redir)
exe "silent !gnome-open '".escape(fname,'%#')."'".redir exe "silent !gnome-open '".escape(fname,'%#')."'".redir
let ret= v:shell_error let ret= v:shell_error
elseif has("unix") && executable("kfmclient") elseif has("unix") && executable("kfmclient") && s:haskicker
" call Decho("exe silent !kfmclient exec '".escape(fname,'%#')."' ".redir) " call Decho("exe silent !kfmclient exec '".escape(fname,'%#')."' ".redir)
exe "silent !kfmclient exec '".escape(fname,'%#')."' ".redir exe "silent !kfmclient exec '".escape(fname,'%#')."' ".redir
let ret= v:shell_error let ret= v:shell_error
@@ -1969,7 +2028,7 @@ fun! s:NetHideEdit(islocal)
if a:islocal == 0 if a:islocal == 0
silent call s:NetBrowse(s:NetBrowseChgDir(expand("%"),'./')) silent call s:NetBrowse(s:NetBrowseChgDir(expand("%"),'./'))
else else
silent call s:NetRefresh(<SID>LocalBrowseChgDir(b:netrw_curdir,"./"),a:islocal) silent call s:NetRefresh(s:LocalBrowseChgDir(b:netrw_curdir,"./"),a:islocal)
endif endif
" call Dret("NetHideEdit") " call Dret("NetHideEdit")
@@ -1989,7 +2048,7 @@ fun! s:NetSortSequence(mode)
if a:mode == 0 if a:mode == 0
silent call s:NetBrowse(s:NetBrowseChgDir(expand("%"),'./')) silent call s:NetBrowse(s:NetBrowseChgDir(expand("%"),'./'))
else else
silent call s:LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,"./")) silent call s:LocalBrowse(s:LocalBrowseChgDir(b:netrw_curdir,"./"))
endif endif
" call Dret("NetSortSequence") " call Dret("NetSortSequence")
@@ -2025,9 +2084,9 @@ fun! s:NetLongList(mode)
" refresh the listing " refresh the listing
if a:mode == 0 if a:mode == 0
silent call <SID>NetBrowse(<SID>NetBrowseChgDir(expand("%"),"./")) silent call s:NetBrowse(s:NetBrowseChgDir(expand("%"),"./"))
else else
silent call s:LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,"./")) silent call s:LocalBrowse(s:LocalBrowseChgDir(b:netrw_curdir,"./"))
endif endif
" keep cursor on the filename " keep cursor on the filename
@@ -2434,6 +2493,82 @@ fun! s:NetObtain()
" call Dret("NetObtain") " call Dret("NetObtain")
endfun endfun
" ---------------------------------------------------------------------
" NetPrevWinOpen: opoen file/directory in previous window. {{{2
" If there's only one window, then the window will first be split.
fun! s:NetPrevWinOpen(islocal)
" call Dfunc("NetPrevWinOpen(islocal=".a:islocal.")")
" get last window number and the word currently under the cursor
let lastwinnr = winnr("$")
let curword = s:NetGetWord()
let curdir = b:netrw_curdir
" call Decho("lastwinnr=".lastwinnr." curword<".curword.">")
let didsplit = 0
if lastwinnr == 1
" if only one window, open a new one first
" call Decho("only one window, so open a new one (g:netrw_alto=".g:netrw_alto.")")
exe (g:netrw_alto? "bel " : "abo ").g:netrw_winsize."wincmd s"
let didsplit = 1
else
wincmd p
" if the previous window's buffer has been changed (is modified),
" and it doesn't appear in any other extant window, then ask the
" user if s/he wants to abandon modifications therein.
let bnr = winbufnr(0)
let bnrcnt = 0
if &mod
windo if winbufnr(0) == bnr | let bnrcnt=bnrcnt+1 | endif
" call Decho("bnr=".bnr." bnrcnt=".bnrcnt)
if bnrcnt == 1
let bufname= bufname(winbufnr(winnr()))
let choice= confirm("Save modified file<".bufname.">?","&Yes\n&No\n&Cancel")
if choice == 1
" Yes -- write file & then browse
let v:errmsg= ""
silent w
if v:errmsg != ""
echohl Error | echo "***netrw*** "unable to write <".bufname.">!" | echohl None
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
if didsplit
q
else
wincmd p
endif
" call Dret("NetPrevWinOpen : unable to write <".bufname.">")
return
endif
elseif choice == 2
" No -- don't worry about changed file, just browse anyway
set nomod
echohl WarningMsg | echo "***netrw*** ".bufname." changes abandoned" | echohl None
else
" Cancel -- don't do this
if didsplit
q
else
wincmd p
endif
" call Dret("NetPrevWinOpen : cancelled")
return
endif
endif
endif
endif
if a:islocal
call s:LocalBrowse(s:LocalBrowseChgDir(curdir,curword))
else
call s:NetBrowse(s:NetBrowseChgDir(expand("%"),curword))
endif
" call Dret("NetPrevWinOpen")
endfun
" ========================================== " ==========================================
" Local Directory Browsing Support: {{{1 " Local Directory Browsing Support: {{{1
" ========================================== " ==========================================
@@ -2445,7 +2580,7 @@ fun! s:LocalBrowse(dirname)
" the BufEnter event causes triggering when attempts to write to " the BufEnter event causes triggering when attempts to write to
" the DBG buffer are made. " the DBG buffer are made.
if isdirectory(a:dirname) if isdirectory(a:dirname)
call netrw#DirBrowse(a:dirname) silent! call netrw#DirBrowse(a:dirname)
endif endif
" not a directory, ignore it " not a directory, ignore it
endfun endfun
@@ -2462,6 +2597,7 @@ fun! netrw#DirBrowse(dirname)
" call Dret("DirBrowse") " call Dret("DirBrowse")
return return
endif endif
call s:NetOptionSave() call s:NetOptionSave()
if v:version < 603 if v:version < 603
@@ -2550,10 +2686,13 @@ fun! netrw#DirBrowse(dirname)
endif endif
" change the name of the buffer to reflect the b:netrw_curdir " change the name of the buffer to reflect the b:netrw_curdir
" Hmm. When another vim is open to the same directory, I get
" a "Press ENTER" ... ok, setting "noswf" avoids it.
" call Decho('exe silent! file '.escape(b:netrw_curdir,s:netrw_cd_escape))
exe 'silent! file '.escape(b:netrw_curdir,s:netrw_cd_escape) exe 'silent! file '.escape(b:netrw_curdir,s:netrw_cd_escape)
" make this buffer not-a-file, modifiable, not line-numbered, etc " make this buffer not-a-file, modifiable, not line-numbered, etc
setlocal bh=hide bt=nofile nobl ma nonu setlocal bh=hide bt=nofile nobl ma nonu noswf
keepalt silent! %d keepalt silent! %d
" --------------------------- " ---------------------------
@@ -2563,7 +2702,7 @@ fun! netrw#DirBrowse(dirname)
endif endif
" save current directory on directory history list " save current directory on directory history list
call <SID>NetBookmarkDir(3,b:netrw_curdir) call s:NetBookmarkDir(3,b:netrw_curdir)
" set up all the maps " set up all the maps
" call Decho("Setting up local browser maps") " call Decho("Setting up local browser maps")
@@ -2584,6 +2723,7 @@ fun! netrw#DirBrowse(dirname)
nnoremap <buffer> <silent> o :call <SID>NetSplit(2)<cr> nnoremap <buffer> <silent> o :call <SID>NetSplit(2)<cr>
nnoremap <buffer> <silent> O :call <SID>LocalObtain()<cr> nnoremap <buffer> <silent> O :call <SID>LocalObtain()<cr>
nnoremap <buffer> <silent> p :call <SID>LocalPreview(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord(),1))<cr> nnoremap <buffer> <silent> p :call <SID>LocalPreview(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord(),1))<cr>
nnoremap <buffer> <silent> P :call <SID>NetPrevWinOpen(1)<cr>
nnoremap <buffer> <silent> q :<c-u>call <SID>NetBookmarkDir(2,b:netrw_curdir)<cr> nnoremap <buffer> <silent> q :<c-u>call <SID>NetBookmarkDir(2,b:netrw_curdir)<cr>
nnoremap <buffer> <silent> r :let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'<bar>exe "norm! 0"<bar>call <SID>NetRefresh(<SID>LocalBrowseChgDir(b:netrw_curdir,'./'),1)<cr> nnoremap <buffer> <silent> r :let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'<bar>exe "norm! 0"<bar>call <SID>NetRefresh(<SID>LocalBrowseChgDir(b:netrw_curdir,'./'),1)<cr>
nnoremap <buffer> <silent> s :call <SID>NetSaveWordPosn()<bar>let g:netrw_sort_by= (g:netrw_sort_by =~ 'n')? 'time' : (g:netrw_sort_by =~ 't')? 'size' : 'name'<bar>exe "norm! 0"<bar>call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,'./'))<bar>call <SID>NetRestoreWordPosn()<cr> nnoremap <buffer> <silent> s :call <SID>NetSaveWordPosn()<bar>let g:netrw_sort_by= (g:netrw_sort_by =~ 'n')? 'time' : (g:netrw_sort_by =~ 't')? 'size' : 'name'<bar>exe "norm! 0"<bar>call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,'./'))<bar>call <SID>NetRestoreWordPosn()<cr>
@@ -2591,7 +2731,7 @@ fun! netrw#DirBrowse(dirname)
nnoremap <buffer> <silent> u :<c-u>call <SID>NetBookmarkDir(4,expand("%"))<cr> nnoremap <buffer> <silent> u :<c-u>call <SID>NetBookmarkDir(4,expand("%"))<cr>
nnoremap <buffer> <silent> U :<c-u>call <SID>NetBookmarkDir(5,expand("%"))<cr> nnoremap <buffer> <silent> U :<c-u>call <SID>NetBookmarkDir(5,expand("%"))<cr>
nnoremap <buffer> <silent> v :call <SID>NetSplit(3)<cr> nnoremap <buffer> <silent> v :call <SID>NetSplit(3)<cr>
nnoremap <buffer> <silent> x :call <SID>NetBrowseX(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord(),0),0)"<cr> nnoremap <buffer> <silent> x :call netrw#NetBrowseX(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord(),0),0)"<cr>
nnoremap <buffer> <silent> <2-leftmouse> :call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord()))<cr> nnoremap <buffer> <silent> <2-leftmouse> :call <SID>LocalBrowse(<SID>LocalBrowseChgDir(b:netrw_curdir,<SID>NetGetWord()))<cr>
nnoremap <buffer> <silent> <s-up> :Pexplore<cr> nnoremap <buffer> <silent> <s-up> :Pexplore<cr>
nnoremap <buffer> <silent> <s-down> :Nexplore<cr> nnoremap <buffer> <silent> <s-down> :Nexplore<cr>
@@ -2784,7 +2924,7 @@ fun! s:LocalBrowseList()
let ft = strpart("000000000000000000",1,18-strlen(t)).t let ft = strpart("000000000000000000",1,18-strlen(t)).t
" call Decho("exe keepjumps put ='".ft.'/'.filename."'") " call Decho("exe keepjumps put ='".ft.'/'.filename."'")
let ftpfile= ft.'/'.pfile let ftpfile= ft.'/'.pfile
keepjumps put=ftpfile keepjumps silent! put=ftpfile
elseif g:netrw_sort_by =~ "^s" elseif g:netrw_sort_by =~ "^s"
" sort by size (handles file sizes up to 1 quintillion bytes, US) " sort by size (handles file sizes up to 1 quintillion bytes, US)
@@ -2793,12 +2933,12 @@ fun! s:LocalBrowseList()
let fsz = strpart("000000000000000000",1,18-strlen(sz)).sz let fsz = strpart("000000000000000000",1,18-strlen(sz)).sz
" call Decho("exe keepjumps put ='".fsz.'/'.filename."'") " call Decho("exe keepjumps put ='".fsz.'/'.filename."'")
let fszpfile= fsz.'/'.pfile let fszpfile= fsz.'/'.pfile
keepjumps put =fszpfile keepjumps silent! put =fszpfile
else else
" sort by name " sort by name
" call Decho("exe keepjumps put ='".pfile."'") " call Decho("exe keepjumps put ='".pfile."'")
keepjumps put=pfile keepjumps silent! put=pfile
endif endif
endwhile endwhile
@@ -2833,6 +2973,13 @@ fun! s:LocalBrowseChgDir(dirname,newdir,...)
if a:0 < 1 if a:0 < 1
" call Decho("dirname<".dirname."> netrw_cd_escape<".s:netrw_cd_escape.">") " call Decho("dirname<".dirname."> netrw_cd_escape<".s:netrw_cd_escape.">")
" call Decho("about to edit<".escape(dirname,s:netrw_cd_escape).">") " call Decho("about to edit<".escape(dirname,s:netrw_cd_escape).">")
if g:netrw_browse_split == 1
new
wincmd _
elseif g:netrw_browse_split == 2
rightb vert new
wincmd |
endif
exe "e! ".escape(dirname,s:netrw_cd_escape) exe "e! ".escape(dirname,s:netrw_cd_escape)
set ma nomod set ma nomod
endif endif
@@ -3063,7 +3210,7 @@ fun! netrw#Explore(indx,dosplit,style,...)
" if dosplit or file has been modified " if dosplit or file has been modified
if a:dosplit || &modified if a:dosplit || &modified
call <SID>SaveWinVars() call s:SaveWinVars()
if a:style == 0 " Explore, Sexplore if a:style == 0 " Explore, Sexplore
exe g:netrw_winsize."wincmd s" exe g:netrw_winsize."wincmd s"
@@ -3275,7 +3422,7 @@ fun! s:NetGetcwd(doesc)
endfun endfun
" --------------------------------------------------------------------- " ---------------------------------------------------------------------
" NetMethod: determine method of transfer {{{1 " NetMethod: determine method of transfer {{{2
" method == 1: rcp " method == 1: rcp
" 2: ftp + <.netrc> " 2: ftp + <.netrc>
" 3: ftp + machine, id, password, and [path]filename " 3: ftp + machine, id, password, and [path]filename
@@ -3475,7 +3622,7 @@ fun! s:NetMethod(choice) " globals: method machine id passwd fname
endfun endfun
" ------------------------------------------------------------------------ " ------------------------------------------------------------------------
" NetUserPass: set username and password for subsequent ftp transfer {{{1 " NetUserPass: set username and password for subsequent ftp transfer {{{2
" Usage: :call NetUserPass() -- will prompt for userid and password " Usage: :call NetUserPass() -- will prompt for userid and password
" :call NetUserPass("uid") -- will prompt for password " :call NetUserPass("uid") -- will prompt for password
" :call NetUserPass("uid","password") -- sets global userid and password " :call NetUserPass("uid","password") -- sets global userid and password
@@ -3506,7 +3653,7 @@ fun! NetUserPass(...)
endfun endfun
" ------------------------------------------------------------------------ " ------------------------------------------------------------------------
" NetOptionSave: save options and set to "standard" form {{{1 " NetOptionSave: save options and set to "standard" form {{{2
fun! s:NetOptionSave() fun! s:NetOptionSave()
" call Dfunc("NetOptionSave()") " call Dfunc("NetOptionSave()")
if !exists("w:netoptionsave") if !exists("w:netoptionsave")
@@ -3550,7 +3697,7 @@ fun! s:NetOptionSave()
endfun endfun
" ------------------------------------------------------------------------ " ------------------------------------------------------------------------
" NetOptionRestore: restore options {{{1 " NetOptionRestore: restore options {{{2
fun! s:NetOptionRestore() fun! s:NetOptionRestore()
" call Dfunc("NetOptionRestore()") " call Dfunc("NetOptionRestore()")
if !exists("w:netoptionsave") if !exists("w:netoptionsave")
@@ -3591,7 +3738,7 @@ fun! s:NetOptionRestore()
endfun endfun
" ------------------------------------------------------------------------ " ------------------------------------------------------------------------
" NetReadFixup: this sort of function is typically written by the user {{{1 " NetReadFixup: this sort of function is typically written by the user {{{2
" to handle extra junk that their system's ftp dumps " to handle extra junk that their system's ftp dumps
" into the transfer. This function is provided as an " into the transfer. This function is provided as an
" example and as a fix for a Windows 95 problem: in my " example and as a fix for a Windows 95 problem: in my
@@ -3609,7 +3756,7 @@ if has("win95") && exists("g:netrw_win95ftp") && g:netrw_win95ftp
endif endif
" --------------------------------------------------------------------- " ---------------------------------------------------------------------
" NetSort: Piet Delport's BISort2() function, modified to take a range {{{1 " NetSort: Piet Delport's BISort2() function, modified to take a range {{{2
if v:version < 700 if v:version < 700
fun! s:NetSort() range fun! s:NetSort() range
" " call Dfunc("NetSort()") " " call Dfunc("NetSort()")
@@ -3654,7 +3801,7 @@ if v:version < 700
endif endif
" --------------------------------------------------------------------- " ---------------------------------------------------------------------
" SetSort: sets up the sort based on the g:netrw_sort_sequence {{{1 " SetSort: sets up the sort based on the g:netrw_sort_sequence {{{2
" What this function does is to compute a priority for the patterns " What this function does is to compute a priority for the patterns
" in the g:netrw_sort_sequence. It applies a substitute to any " in the g:netrw_sort_sequence. It applies a substitute to any
" "files" that satisfy each pattern, putting the priority / in " "files" that satisfy each pattern, putting the priority / in
@@ -3711,7 +3858,7 @@ fun! s:SetSort()
endfun endfun
" --------------------------------------------------------------------- " ---------------------------------------------------------------------
" SaveWinVars: (used by Explore()) {{{1 " SaveWinVars: (used by Explore()) {{{2
fun! s:SaveWinVars() fun! s:SaveWinVars()
" call Dfunc("SaveWinVars()") " call Dfunc("SaveWinVars()")
if exists("w:netrw_bannercnt") |let s:bannercnt = w:netrw_bannercnt |endif if exists("w:netrw_bannercnt") |let s:bannercnt = w:netrw_bannercnt |endif
@@ -3727,7 +3874,7 @@ fun! s:SaveWinVars()
endfun endfun
" --------------------------------------------------------------------- " ---------------------------------------------------------------------
" CopyWinVars: (used by Explore()) {{{1 " CopyWinVars: (used by Explore()) {{{2
fun! s:CopyWinVars() fun! s:CopyWinVars()
" call Dfunc("CopyWinVars()") " call Dfunc("CopyWinVars()")
if exists("s:bannercnt") |let w:netrw_bannercnt = s:bannercnt |unlet s:bannercnt |endif if exists("s:bannercnt") |let w:netrw_bannercnt = s:bannercnt |unlet s:bannercnt |endif
@@ -3743,7 +3890,7 @@ fun! s:CopyWinVars()
endfun endfun
" --------------------------------------------------------------------- " ---------------------------------------------------------------------
" SetBufWinVars: (used by NetBrowse() and LocalBrowse()) {{{1 " SetBufWinVars: (used by NetBrowse() and LocalBrowse()) {{{2
" To allow separate windows to have their own activities, such as " To allow separate windows to have their own activities, such as
" Explore **/pattern, several variables have been made window-oriented. " Explore **/pattern, several variables have been made window-oriented.
" However, when the user splits a browser window (ex: ctrl-w s), these " However, when the user splits a browser window (ex: ctrl-w s), these
@@ -3765,7 +3912,7 @@ fun! s:SetBufWinVars()
endfun endfun
" --------------------------------------------------------------------- " ---------------------------------------------------------------------
" UseBufWinVars: (used by NetBrowse() and LocalBrowse() {{{1 " UseBufWinVars: (used by NetBrowse() and LocalBrowse() {{{2
" Matching function to BufferWinVars() " Matching function to BufferWinVars()
fun! s:UseBufWinVars() fun! s:UseBufWinVars()
" call Dfunc("UseBufWinVars()") " call Dfunc("UseBufWinVars()")
@@ -3783,7 +3930,7 @@ fun! s:UseBufWinVars()
endfun endfun
" --------------------------------------------------------------------- " ---------------------------------------------------------------------
" RFC2396: converts %xx into characters " RFC2396: converts %xx into characters {{{2
fun! netrw#RFC2396(fname) fun! netrw#RFC2396(fname)
" call Dfunc("RFC2396(fname<".a:fname.">)") " call Dfunc("RFC2396(fname<".a:fname.">)")
let fname = escape(substitute(a:fname,'%\(\x\x\)','\=nr2char("0x".submatch(1))','ge')," \t") let fname = escape(substitute(a:fname,'%\(\x\x\)','\=nr2char("0x".submatch(1))','ge')," \t")
@@ -3792,7 +3939,7 @@ fun! netrw#RFC2396(fname)
endfun endfun
" ------------------------------------------------------------------------ " ------------------------------------------------------------------------
" Settings Restoration: {{{1 " Settings Restoration: {{{2
let &cpo= s:keepcpo let &cpo= s:keepcpo
unlet s:keepcpo unlet s:keepcpo

View File

@@ -1,7 +1,7 @@
" netrwSettings.vim: makes netrw settings simpler " netrwSettings.vim: makes netrw settings simpler
" Date: Oct 12, 2005 " Date: Jan 26, 2006
" Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz> " Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
" Version: 4 " Version: 6a ASTRO-ONLY
" Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1 " Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1
" Permission is hereby granted to use and distribute this code, " Permission is hereby granted to use and distribute this code,
" with or without modifications, provided that this copyright " with or without modifications, provided that this copyright
@@ -19,7 +19,7 @@
if exists("g:loaded_netrwSettings") || &cp if exists("g:loaded_netrwSettings") || &cp
finish finish
endif endif
let g:loaded_netrwSettings = "v4" let g:loaded_netrwSettings = "v6a"
" --------------------------------------------------------------------- " ---------------------------------------------------------------------
" NetrwSettings: {{{1 " NetrwSettings: {{{1
@@ -56,10 +56,10 @@ fun! netrwSettings#NetrwSettings()
let g:netrw_ignorenetrc= 0 let g:netrw_ignorenetrc= 0
endif endif
put ='+ ---------------------------------------------' put ='+ --------------------------------------------'
put ='+ NetrwSettings: (by Charles E. Campbell, Jr.)' put ='+ NetrwSettings: by Charles E. Campbell, Jr.'
put ='+ Press ? with cursor atop any line for help ' put ='+ Press ? with cursor atop any line for help '
put ='+ ---------------------------------------------' put ='+ --------------------------------------------'
let s:netrw_settings_stop= line(".") let s:netrw_settings_stop= line(".")
put ='' put =''
@@ -89,6 +89,12 @@ fun! netrwSettings#NetrwSettings()
put ='+ Netrw Browser Control' put ='+ Netrw Browser Control'
put = 'let g:netrw_alto = '.g:netrw_alto put = 'let g:netrw_alto = '.g:netrw_alto
put = 'let g:netrw_altv = '.g:netrw_altv put = 'let g:netrw_altv = '.g:netrw_altv
put = 'let g:netrw_browse_split = '.g:netrw_browse_split
if exists("g:netrw_browsex_viewer")
put = 'let g:netrw_browsex_viewer = '.g:netrw_browsex_viewer
else
put = 'let g:netrw_browsex_viewer = (not defined)'
endif
put = 'let g:netrw_dirhistmax = '.g:netrw_dirhistmax 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_browse_reject = '.g:netrw_ftp_browse_reject
put = 'let g:netrw_ftp_list_cmd = '.g:netrw_ftp_list_cmd put = 'let g:netrw_ftp_list_cmd = '.g:netrw_ftp_list_cmd

View File

@@ -1,4 +1,4 @@
*autocmd.txt* For Vim version 7.0aa. Last change: 2006 Jan 08 *autocmd.txt* For Vim version 7.0aa. Last change: 2006 Feb 01
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -273,6 +273,7 @@ Name triggered by ~
|FileChangedRO| before making the first change to a read-only file |FileChangedRO| before making the first change to a read-only file
|FuncUndefined| a user function is used but it isn't defined |FuncUndefined| a user function is used but it isn't defined
|SpellFileMissing| a spell file is used but it can't be found
|FocusGained| Vim got input focus |FocusGained| Vim got input focus
|FocusLost| Vim lost input focus |FocusLost| Vim lost input focus
@@ -643,6 +644,11 @@ RemoteReply When a reply from a Vim that functions as
*SessionLoadPost* *SessionLoadPost*
SessionLoadPost After loading the session file created using SessionLoadPost After loading the session file created using
the |:mksession| command. the |:mksession| command.
*SpellFileMissing*
SpellFileMissing When trying to load a spell checking file and
it can't be found. <amatch> is the language,
'encoding' also matters. See
|spell-SpellFileMissing|.
*StdinReadPost* *StdinReadPost*
StdinReadPost After reading from the stdin into the buffer, StdinReadPost After reading from the stdin into the buffer,
before executing the modelines. Only used before executing the modelines. Only used

View File

@@ -1,4 +1,4 @@
*eval.txt* For Vim version 7.0aa. Last change: 2006 Jan 29 *eval.txt* For Vim version 7.0aa. Last change: 2006 Jan 31
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2371,7 +2371,7 @@ filter({expr}, {string}) *filter()*
The operation is done in-place. If you want a List or The operation is done in-place. If you want a List or
Dictionary to remain unmodified make a copy first: > Dictionary to remain unmodified make a copy first: >
:let l = filter(copy(mylist), '& =~ "KEEP"') :let l = filter(copy(mylist), 'v:val =~ "KEEP"')
< Returns {expr}, the List or Dictionary that was filtered. < Returns {expr}, the List or Dictionary that was filtered.
When an error is encountered while evaluating {string} no When an error is encountered while evaluating {string} no

View File

@@ -1,4 +1,4 @@
*options.txt* For Vim version 7.0aa. Last change: 2006 Jan 29 *options.txt* For Vim version 7.0aa. Last change: 2006 Jan 31
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@@ -5092,6 +5092,7 @@ A jump table for the options with a short description can be found at |Q_op|.
menu.vim GUI menus |menu.vim| menu.vim GUI menus |menu.vim|
plugin/ plugin scripts |write-plugin| plugin/ plugin scripts |write-plugin|
print/ files for printing |postscript-print-encoding| print/ files for printing |postscript-print-encoding|
spell/ spell checking files |spell|
syntax/ syntax files |mysyntaxfile| syntax/ syntax files |mysyntaxfile|
tutor/ files for vimtutor |tutor| tutor/ files for vimtutor |tutor|
@@ -5727,7 +5728,7 @@ A jump table for the options with a short description can be found at |Q_op|.
'shiftwidth'. 'tabstop' or 'softtabstop' is used in other places. A 'shiftwidth'. 'tabstop' or 'softtabstop' is used in other places. A
<BS> will delete a 'shiftwidth' worth of space at the start of the <BS> will delete a 'shiftwidth' worth of space at the start of the
line. line.
When off a <Tab> always inserts blanks according to 'tabstop' or When off, a <Tab> always inserts blanks according to 'tabstop' or
'softtabstop'. 'shiftwidth' is only used for shifting text left or 'softtabstop'. 'shiftwidth' is only used for shifting text left or
right |shift-left-right|. right |shift-left-right|.
What gets inserted (a Tab or spaces) depends on the 'expandtab' What gets inserted (a Tab or spaces) depends on the 'expandtab'
@@ -5836,7 +5837,8 @@ A jump table for the options with a short description can be found at |Q_op|.
After this option has been set successfully, Vim will source the files After this option has been set successfully, Vim will source the files
"spell/LANG.vim" in 'runtimepath'. "LANG" is the value of 'spelllang' "spell/LANG.vim" in 'runtimepath'. "LANG" is the value of 'spelllang'
up to the first comma, dot or underscore. See |set-spc-auto|. up to the first comma, dot or underscore.
Also see |set-spc-auto|.
*'spellsuggest'* *'sps'* *'spellsuggest'* *'sps'*

View File

@@ -1,4 +1,4 @@
*pi_netrw.txt* For Vim version 7.0. Last change: Nov 28, 2005 *pi_netrw.txt* For Vim version 7.0. Last change: Jan 27, 2006
VIM REFERENCE MANUAL by Charles E. Campbell, Jr. VIM REFERENCE MANUAL by Charles E. Campbell, Jr.
@@ -10,7 +10,8 @@
============================================================================== ==============================================================================
0. Contents *netrw-contents* 0. Contents *netrw-contents*
1. Netrw Reference......................................|netrw-ref| 1. Starting With Netrw.................................|netrw-start|
2. Netrw Reference......................................|netrw-ref|
CONTROLLING EXTERNAL APPLICTIONS...................|netrw-externapp| CONTROLLING EXTERNAL APPLICTIONS...................|netrw-externapp|
READING............................................|netrw-read| READING............................................|netrw-read|
WRITING............................................|netrw-write| WRITING............................................|netrw-write|
@@ -18,14 +19,14 @@
CHANGING THE USERID AND PASSWORD...................|netrw-chgup| CHANGING THE USERID AND PASSWORD...................|netrw-chgup|
VARIABLES..........................................|netrw-variables| VARIABLES..........................................|netrw-variables|
PATHS..............................................|netrw-path| PATHS..............................................|netrw-path|
2. Network-Oriented File Transfer.......................|netrw-xfer| 3. Network-Oriented File Transfer.......................|netrw-xfer|
NETRC..............................................|netrw-netrc| NETRC..............................................|netrw-netrc|
PASSWORD...........................................|netrw-passwd| PASSWORD...........................................|netrw-passwd|
3. Activation...........................................|netrw-activate| 4. Activation...........................................|netrw-activate|
4. Transparent File Transfer............................|netrw-transparent| 5. Transparent File Transfer............................|netrw-transparent|
5. Ex Commands..........................................|netrw-ex| 6. Ex Commands..........................................|netrw-ex|
6. Variables and Options................................|netrw-var| 7. Variables and Options................................|netrw-var|
7. Directory Browsing...................................|netrw-browse| {{{1 8. Directory Browsing...................................|netrw-browse| {{{1
Maps...............................................|netrw-maps| Maps...............................................|netrw-maps|
Exploring..........................................|netrw-explore-cmds| Exploring..........................................|netrw-explore-cmds|
Quick Reference Commands Table.....................|netrw-browse-cmds| Quick Reference Commands Table.....................|netrw-browse-cmds|
@@ -41,7 +42,7 @@
Deleting Files Or Directories......................|netrw-delete| Deleting Files Or Directories......................|netrw-delete|
Renaming Files Or Directories......................|netrw-move| Renaming Files Or Directories......................|netrw-move|
Hiding Files Or Directories........................|netrw-a| Hiding Files Or Directories........................|netrw-a|
Edit File Or Directory Hiding List.................|netrw-h| Edit File Or Directory Hiding List.................|netrw-ctrl-h|
Browsing With A Horizontally Split Window..........|netrw-o| Browsing With A Horizontally Split Window..........|netrw-o|
Preview Window.....................................|netrw-p| Preview Window.....................................|netrw-p|
Selecting Sorting Style............................|netrw-s| Selecting Sorting Style............................|netrw-s|
@@ -56,19 +57,19 @@
Changing To A Bookmarked Directory.................|netrw-B| |netrw-NB| Changing To A Bookmarked Directory.................|netrw-B| |netrw-NB|
Listing Bookmarks And History......................|netrw-q| Listing Bookmarks And History......................|netrw-q|
Improving Directory Browsing.......................|netrw-listhack| }}}1 Improving Directory Browsing.......................|netrw-listhack| }}}1
8. Problems and Fixes...................................|netrw-problems| 9. Problems and Fixes...................................|netrw-problems|
9. Debugging............................................|netrw-debug| 10. Debugging............................................|netrw-debug|
10. History..............................................|netrw-history| 11. History..............................................|netrw-history|
11. Credits..............................................|netrw-credits| 12. Credits..............................................|netrw-credits|
The Netrw plugin is generally sourced automatically as it is a The Netrw plugin is generally sourced automatically as it is a
|standard-plugin|. That said, to make use of netrw, one must |standard-plugin|. That said, to make use of netrw, one must
have plugins available which can be done with the following have plugins available which can be done with the following
two lines in your <.vimrc>: two lines in your <.vimrc>: >
set nocp " 'compatible' is not set set nocp " 'compatible' is not set
filetype plugin on " plugins are enabled filetype plugin on " plugins are enabled
<
You can avoid loading this plugin by setting the "loaded_netrw" variable You can avoid loading this plugin by setting the "loaded_netrw" variable
in your <.vimrc> file: > in your <.vimrc> file: >
@@ -77,14 +78,66 @@ in your <.vimrc> file: >
{Vi does not have any of this} {Vi does not have any of this}
============================================================================== ==============================================================================
1. Netrw Reference *netrw-ref* 1. Starting With Netrw *netrw-start*
Netrw makes reading, writing, and browsing over a network connection easy!
First, make sure that you have plugins enabled, so you'll need to have at
least the following in your <.vimrc>: (or see |netrw-activate|) >
set nocp " 'compatible' is not set
filetype plugin on " plugins are enabled
<
(see |'cp'| and |:filetype-plugin-on|)
Netrw supports "transparent" editing of files on other machines using urls
(see |netrw-transparent|). As an example of this, let's assume you have an
account on some other machine; try >
vim scp://hostname/path/to/file
<
if you have an ssh connection. Want to make ssh/scp easier to use? Check
out |netrw-listhack|!
What if you have ftp, not ssh/scp? That's easy, too; try >
vim ftp://hostname/path/to/file
<
Want to make ftp simpler to use? See if your ftp supports a file called
<.netrc> -- typically it goes in your home directory, has read/write
permissions for only the user to read (ie. not group, world, other, etc),
and has lines resembling >
machine HOSTNAME login USERID password "PASSWORD"
machine HOSTNAME login USERID password "PASSWORD"
...
default login USERID password "PASSWORD"
<
How about browsing -- ie. you just want to look around before editing a
file. For browsing on your current host, just "edit" a directory: >
vim .
vim /home/userid/path
<
For browsing on a remote host, "edit" a directory (but make sure that
the directory name is followed by a "/"): >
vim scp://hostname/
vim ftp://hostname/path/to/dir/
<
See |netrw-browse| for more!
There's more protocols supported than scp and ftp, too: see the next
section, |netrw-externapp|.
==============================================================================
2. Netrw Reference *netrw-ref*
CONTROLLING EXTERNAL APPLICTIONS *netrw-externapp* CONTROLLING EXTERNAL APPLICTIONS *netrw-externapp*
Protocol Variable Default Value Protocol Variable Default Value
-------- ---------------- ------------- -------- ---------------- -------------
dav: *g:netrw_dav_cmd* = "cadaver" dav: *g:netrw_dav_cmd* = "cadaver"
fetch: *g:netrw_fetch_cmd* = "fetch -o" fetch: *g:netrw_fetch_cmd* = "fetch -o" if fetch is available
ftp: *g:netrw_ftp_cmd* = "ftp" ftp: *g:netrw_ftp_cmd* = "ftp"
http: *g:netrw_http_cmd* = "fetch -o" if fetch is available http: *g:netrw_http_cmd* = "fetch -o" if fetch is available
http: g:netrw_http_cmd = "wget -q -O" If wget is available http: g:netrw_http_cmd = "wget -q -O" If wget is available
@@ -191,7 +244,7 @@ file using root-relative paths, use the full path:
< <
============================================================================== ==============================================================================
2. Network-Oriented File Transfer *netrw-xfer* 3. Network-Oriented File Transfer *netrw-xfer*
Network-oriented file transfer under Vim is implemented by a VimL-based script Network-oriented file transfer under Vim is implemented by a VimL-based script
(<netrw.vim>) using plugin techniques. It currently supports both reading and (<netrw.vim>) using plugin techniques. It currently supports both reading and
@@ -337,7 +390,7 @@ However, |netrw-listhack| can help with this problem.
============================================================================== ==============================================================================
3. Activation *netrw-activate* 4. Activation *netrw-activate*
Network-oriented file transfers are available by default whenever Network-oriented file transfers are available by default whenever
|'nocompatible'| mode is enabled. The <netrw.vim> file resides in your |'nocompatible'| mode is enabled. The <netrw.vim> file resides in your
@@ -351,7 +404,7 @@ up vim. I suggest that, at a minimum, you have at least the following in your
< <
============================================================================== ==============================================================================
4. Transparent File Transfer *netrw-transparent* 5. Transparent File Transfer *netrw-transparent*
Transparent file transfers occur whenever a regular file read or write Transparent file transfers occur whenever a regular file read or write
(invoked via an |:autocmd| for |BufReadCmd| or |BufWriteCmd| events) is made. (invoked via an |:autocmd| for |BufReadCmd| or |BufWriteCmd| events) is made.
@@ -365,7 +418,7 @@ See |netrw-activate| for more on how to encourage your vim to use plugins
such as netrw. such as netrw.
============================================================================== ==============================================================================
5. Ex Commands *netrw-ex* 6. Ex Commands *netrw-ex*
The usual read/write commands are supported. There are also a couple of The usual read/write commands are supported. There are also a couple of
additional commands available. additional commands available.
@@ -403,7 +456,7 @@ additional commands available.
============================================================================== ==============================================================================
6. Variables and Options *netrw-options* *netrw-var* 7. Variables and Options *netrw-options* *netrw-var*
The script <netrw.vim> uses several variables which can affect <netrw.vim>'s The script <netrw.vim> uses several variables which can affect <netrw.vim>'s
behavior. These variables typically may be set in the user's <.vimrc> file: behavior. These variables typically may be set in the user's <.vimrc> file:
@@ -476,10 +529,10 @@ variables listed below, and may be modified by the user.
transformed however they wish transformed however they wish
by NetReadFixup() by NetReadFixup()
g:netrw_dav_cmd variable ="cadaver" g:netrw_dav_cmd variable ="cadaver"
g:netrw_fetch_cmd variable ="fetch -o" g:netrw_fetch_cmd variable ="fetch -o" if fetch is available
g:netrw_ftp_cmd variable ="ftp" g:netrw_ftp_cmd variable ="ftp"
g:netrw_http_cmd variable ="fetch -o" else if fetch is executable g:netrw_http_cmd variable ="fetch -o" if fetch is available
g:netrw_http_cmd variable ="wget -O" if wget is executable g:netrw_http_cmd variable ="wget -O" else if wget is available
g:netrw_list_cmd variable ="ssh HOSTNAME ls -Fa" g:netrw_list_cmd variable ="ssh HOSTNAME ls -Fa"
g:netrw_rcp_cmd variable ="rcp" g:netrw_rcp_cmd variable ="rcp"
g:netrw_rsync_cmd variable ="rsync -a" g:netrw_rsync_cmd variable ="rsync -a"
@@ -488,9 +541,10 @@ variables listed below, and may be modified by the user.
------------------------------------------------------------------------- -------------------------------------------------------------------------
< <
*netrw-ftp* *netrw-ftp*
The first two options both help with certain ftp's that give trouble The first two options (netrw_ftp and NetReadFixup) both help with certain
otherwise. In order to best understand how to use these options if ftp is ftp's that give trouble otherwise. In order to best understand how to use
giving you troubles, a bit of discussion follows on how netrw does ftp reads. these options if ftp is giving you troubles, a bit of discussion follows on
how netrw does ftp reads.
The g:netrw_..._cmd variables specify the external program to use handle the The g:netrw_..._cmd variables specify the external program to use handle the
associated protocol (rcp, ftp, etc), plus any options. associated protocol (rcp, ftp, etc), plus any options.
@@ -572,7 +626,7 @@ itself:
> >
============================================================================== ==============================================================================
7. Directory Browsing *netrw-browse* *netrw-dir* *netrw-list* *netrw-help* 8. Directory Browsing *netrw-browse* *netrw-dir* *netrw-list* *netrw-help*
MAPS *netrw-maps* MAPS *netrw-maps*
?................Help.......................................|netrw-help| ?................Help.......................................|netrw-help|
@@ -585,7 +639,7 @@ MAPS *netrw-maps*
c................Make Browsing Directory The Current Dir....|netrw-c| c................Make Browsing Directory The Current Dir....|netrw-c|
d................Make A New Directory.......................|netrw-d| d................Make A New Directory.......................|netrw-d|
D................Deleting Files or Directories..............|netrw-D| D................Deleting Files or Directories..............|netrw-D|
<c-h>............Edit File/Directory Hiding List............|netrw-h| <c-h>............Edit File/Directory Hiding List............|netrw-ctrl-h|
i................Long Listing...............................|netrw-i| i................Long Listing...............................|netrw-i|
<c-l>............Refreshing the Listing.....................|netrw-ctrl-l| <c-l>............Refreshing the Listing.....................|netrw-ctrl-l|
o................Browsing with a Horizontal Split...........|netrw-o| o................Browsing with a Horizontal Split...........|netrw-o|
@@ -615,27 +669,38 @@ QUICK REFERENCE COMMANDS TABLE *netrw-browse-cmds*
Command Explanation Command Explanation
------- ----------- ------- -----------
< ? Causes Netrw to issue help < ? Causes Netrw to issue help
<cr> Netrw will enter the directory or read the file <cr> Netrw will enter the directory or read the file |netrw-cr|
<del> Netrw will attempt to remove the file/directory <del> Netrw will attempt to remove the file/directory |netrw-del|
d Make a directory - Makes Netrw go up one directory |netrw--|
D Netrw will attempt to remove the file(s)/directory(ies) a Toggles between normal display, |netrw-a|
R Netrw will attempt to rename the file(s)/directory(ies)
- Makes Netrw go up one directory
a Toggles between normal display,
hiding (suppress display of files matching g:netrw_list_hide) hiding (suppress display of files matching g:netrw_list_hide)
showing (display only files which match g:netrw_list_hide) showing (display only files which match g:netrw_list_hide)
c Make current browsing directory the current directory b bookmark current directory; use Nb if compact listing
<c-h> Edit file hiding list in use |netrw-b|
i Toggles between long and short listing B go to previous bookmarked directory; use Nb if compact
<c-l> Causes Netrw to refresh the directory listing listing is in use |netrw-B|
c Make current browsing directory the current directory |netrw-c|
d Make a directory |netrw-d|
D Netrw will attempt to remove the file(s)/directory(ies) |netrw-D|
<c-h> Edit file hiding list |netrw-ctrl-h|
i Toggles between long and short listing |netrw-i|
<c-l> Causes Netrw to refresh the directory listing |netrw-ctrl-l|
Nb Same as b, but always available |netrw-Nb|
NB Same as B, but always available |netrw-NB|
o Enter the file/directory under the cursor in a new browser o Enter the file/directory under the cursor in a new browser
window. A horizontal split is used. window. A horizontal split is used. |netrw-o|
p Preview the file O Obtain a file specified by cursor |netrw-O|
r Reverse sorting order p Preview the file |netrw-p|
s Select sorting style: by name, time, or file size P Browse in the previously used window |netrw-P|
r Reverse sorting order |netrw-r|
R Rename the designed file(s)/directory(ies) |netrw-R|
s Select sorting style: by name, time, or file size |netrw-s|
S Specify suffix priority for name-sorting |netrw-S|
u Change to recently-visited directory |netrw-u|
U Change to subsequently-visited directory |netrw-U|
v Enter the file/directory under the cursor in a new browser v Enter the file/directory under the cursor in a new browser
window. A vertical split is used. window. A vertical split is used. |netrw-v|
x Apply a function to a file. x Apply a function to a file. (special browsers) |netrw-x|
NETRW BROWSER VARIABLES *netrw-browse-var* NETRW BROWSER VARIABLES *netrw-browse-var*
> >
@@ -650,6 +715,19 @@ NETRW BROWSER VARIABLES *netrw-browse-var*
by setting this variable (see |netrw-v|) by setting this variable (see |netrw-v|)
default: =0 default: =0
*g:netrw_browse_split* when browsing, <cr> will open the file by:
=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"
< If >
"-"
< is used, then netrwFileHandler() will look for
a script/function to handle the given
extension. (see |netrw_filehandler|).
<
*g:netrw_ftp_browse_reject* ftp can produce a number of errors and warnings *g:netrw_ftp_browse_reject* ftp can produce a number of errors and warnings
that can show up as "directories" and "files" that can show up as "directories" and "files"
in the listing. This pattern is used to in the listing. This pattern is used to
@@ -866,6 +944,11 @@ protocol given in the original read request.
or more spaces embedded in it, or any trailing spaces, then you'll need to or more spaces embedded in it, or any trailing spaces, then you'll need to
use the "thin" format to select it. use the "thin" format to select it.
The |g:netrw_browse_split| option, which is zero by default, may be used to
cause the opening of files to be done in a new window. The splitting will
be done horizontally if the option is one and vertically if the option is
two.
OBTAINING A FILE *netrw-O* OBTAINING A FILE *netrw-O*
@@ -921,7 +1004,7 @@ directory. Attempts to make a local directory that already exists (as either
a file or a directory) will be detected, reported on, and ignored. a file or a directory) will be detected, reported on, and ignored.
DELETING FILES OR DIRECTORIES *netrw-delete* *netrw-D* DELETING FILES OR DIRECTORIES *netrw-delete* *netrw-D* *netrw-del*
Deleting/removing files and directories involves moving the cursor to the Deleting/removing files and directories involves moving the cursor to the
file/directory to be deleted and pressing "D". Directories must be empty file/directory to be deleted and pressing "D". Directories must be empty
@@ -971,7 +1054,7 @@ ways: ignore it, hide files which match, and show only those files which
match. The "a" map allows the user to cycle about these three ways. match. The "a" map allows the user to cycle about these three ways.
The g:netrw_list_hide variable holds a comma delimited list of patterns (ex. The g:netrw_list_hide variable holds a comma delimited list of patterns (ex.
\.obj) which specify the hiding list. (also see |netrw-h|) To set the hiding \.obj) which specify the hiding list. (also see |netrw-ctrl-h|) To set the hiding
list, use the <c-h> map. As an example, to hide files which begin with a ".", list, use the <c-h> map. As an example, to hide files which begin with a ".",
one may use the <c-h> map to set the hiding list to '^\..*' (or one may put one may use the <c-h> map to set the hiding list to '^\..*' (or one may put
let g:netrw_list_hide= '^\..*' in one's <.vimrc>). One may then use the "a" let g:netrw_list_hide= '^\..*' in one's <.vimrc>). One may then use the "a"
@@ -979,7 +1062,7 @@ key to show all files, hide matching files, or to show only the matching
files. files.
EDIT FILE OR DIRECTORY HIDING LIST *netrw-h* *netrw-edithide* EDIT FILE OR DIRECTORY HIDING LIST *netrw-ctrl-h* *netrw-edithide*
The "<ctrl-h>" map brings up a requestor allowing the user to change the The "<ctrl-h>" map brings up a requestor allowing the user to change the
file/directory hiding list. The hiding list consists of one or more patterns file/directory hiding list. The hiding list consists of one or more patterns
@@ -1009,6 +1092,20 @@ One may use a preview window (currently only for local browsing) by using the
"p" key when the cursor is atop the desired filename to be previewed. "p" key when the cursor is atop the desired filename to be previewed.
PREVIOUS WINDOW *netrw-P* *netrw-prvwin*
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|,
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
the selected file/directory. If the previous window's associated buffer
has been modified, and there's only one window with that buffer, then
the user will be asked if s/he wishes to save the buffer first (yes,
no, or cancel).
SELECTING SORTING STYLE *netrw-s* *netrw-sort* SELECTING SORTING STYLE *netrw-s* *netrw-sort*
One may select the sorting style by name, time, or (file) size. The "s" map One may select the sorting style by name, time, or (file) size. The "s" map
@@ -1068,15 +1165,30 @@ window and cursor at the right, have
in your <.vimrc>. in your <.vimrc>.
CUSTOMIZING BROWSING WITH A USER FUNCTION *netrw-x* *netrw-handler* CUSTOMIZING BROWSING WITH A USER FUNCTION *netrw-x* *netrw-handler* *gx*
One may "enter" a file with a special handler, thereby firing up a browser or Certain files, such as html, gif, jpeg, (word/office) doc, etc, files, are
other application, for example, on a file by hitting the "x" key. The special best seen with a special handler (ie. a tool provided with your computer).
handler varies: Netrw allows one to invoke such special handlers by: >
* when Exploring, hit the "x" key
* when editing, hit gx with the cursor atop the special filename
<
Netrw determines which special handler by the following method:
* if |g:netrw_browsex_viewer| exists, then it will be used to attempt to
view files. Examples of useful settings (place into your <.vimrc>): >
:let g:netrw_browsex_viewer= "kfmclient exec"
< or >
:let g:netrw_browsex_viewer= "gnome-open"
<
If g:netrw_browsex_viewer == '-', then netrwFileHandler() will be
invoked first (see |netrw_filehandler|).
* for Windows 32 or 64, the url and FileProtocolHandler dlls are used. * for Windows 32 or 64, the url and FileProtocolHandler dlls are used.
* for KDE (with kfmclient): kfmclient is used.
* for Gnome (with gnome-open): gnome-open is used. * for Gnome (with gnome-open): gnome-open is used.
* for KDE (with kfmclient): kfmclient is used.
* otherwise the netrwFileHandler plugin is used. * otherwise the netrwFileHandler plugin is used.
The file's suffix is used by these various approaches to determine an The file's suffix is used by these various approaches to determine an
@@ -1084,6 +1196,7 @@ appropriate application to use to "handle" these files. Such things as
OpenOffice (*.sfx), visualization (*.jpg, *.gif, etc), and PostScript (*.ps, OpenOffice (*.sfx), visualization (*.jpg, *.gif, etc), and PostScript (*.ps,
*.eps) can be handled. *.eps) can be handled.
*netrw_filehandler*
The netrwFileHandler applies a user-defined function to a file, based on its The netrwFileHandler applies a user-defined function to a file, based on its
extension. Of course, the handler function must exist for it to be called! extension. Of course, the handler function must exist for it to be called!
> >
@@ -1093,10 +1206,12 @@ extension. Of course, the handler function must exist for it to be called!
See the <plugin/netrwFileHandlers.vim> for an example of how to handle an html See the <plugin/netrwFileHandlers.vim> for an example of how to handle an html
file with mozilla. file with mozilla.
One may write custom netrwFileHandlers; please look at the One may write custom netrwFileHandlers; please look at the >
plugin/netrwFileHandlers.vim script for examples. If its likely to be
generally useful, please feel free to forward a copy to me for future plugin/netrwFileHandlers.vim
inclusion in the distribution.
script for examples. If its likely to be generally useful, please feel free
to forward a copy to me for future inclusion in the distribution.
MAKING THE BROWSING DIRECTORY THE CURRENT DIRECTORY *netrw-c* *netrw-curdir* MAKING THE BROWSING DIRECTORY THE CURRENT DIRECTORY *netrw-c* *netrw-curdir*
@@ -1168,7 +1283,7 @@ help on what each of the variables do.
============================================================================== ==============================================================================
8. Problems and Fixes *netrw-problems* 9. Problems and Fixes *netrw-problems*
(This section is likely to grow as I get feedback) (This section is likely to grow as I get feedback)
(also see |netrw-debug|) (also see |netrw-debug|)
@@ -1233,7 +1348,7 @@ help on what each of the variables do.
============================================================================== ==============================================================================
9. Debugging *netrw-debug* 10. Debugging *netrw-debug*
The <netrw.vim> script is typically available as: The <netrw.vim> script is typically available as:
> >
@@ -1282,8 +1397,23 @@ which is loaded automatically at startup (assuming :set nocp).
NdrOchip at ScampbellPfamily.AbizM - NOSPAM NdrOchip at ScampbellPfamily.AbizM - NOSPAM
============================================================================== ==============================================================================
10. History *netrw-history* 11. History *netrw-history* {{{1
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
* g:netrw_browsex_viewer implemented
* Mikolaj Machowski pointed out that gnome-open is often
executable under KDE systems, although it is effectively
not functional. NetBrowseX now looks for "kicker" as
a running process to determine if KDE is actually the
really running.
* Explorer's O functionality was inadvertently left out.
Netrw now does the same thing, but with the "P" key.
* added g:netrw_browse_split option
* fixed a bug where the directory contained a "." but
the file didn't (was treating the dirname from "."
onwards as a suffix)
v76: * "directory is missing" error message now restores echo v76: * "directory is missing" error message now restores echo
highlighting highlighting
v75: * file://... now conforms to RFC2396 (thanks to S. Zacchiroli) v75: * file://... now conforms to RFC2396 (thanks to S. Zacchiroli)
@@ -1475,7 +1605,7 @@ which is loaded automatically at startup (assuming :set nocp).
============================================================================== ==============================================================================
11. Credits *netrw-credits* 11. Credits *netrw-credits* {{{1
Vim editor by Bram Moolenaar (Thanks, Bram!) Vim editor by Bram Moolenaar (Thanks, Bram!)
dav support by C Campbell dav support by C Campbell

View File

@@ -2181,6 +2181,8 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
:lr quickfix.txt /*:lr* :lr quickfix.txt /*:lr*
:lrewind quickfix.txt /*:lrewind* :lrewind quickfix.txt /*:lrewind*
:ls windows.txt /*:ls* :ls windows.txt /*:ls*
:lt tagsrch.txt /*:lt*
:ltag tagsrch.txt /*:ltag*
:lu map.txt /*:lu* :lu map.txt /*:lu*
:lunmap map.txt /*:lunmap* :lunmap map.txt /*:lunmap*
:lw quickfix.txt /*:lw* :lw quickfix.txt /*:lw*
@@ -4051,6 +4053,7 @@ Select-mode-mapping visual.txt /*Select-mode-mapping*
Session starting.txt /*Session* Session starting.txt /*Session*
SessionLoad-variable starting.txt /*SessionLoad-variable* SessionLoad-variable starting.txt /*SessionLoad-variable*
SessionLoadPost autocmd.txt /*SessionLoadPost* SessionLoadPost autocmd.txt /*SessionLoadPost*
SpellFileMissing autocmd.txt /*SpellFileMissing*
StdinReadPost autocmd.txt /*StdinReadPost* StdinReadPost autocmd.txt /*StdinReadPost*
StdinReadPre autocmd.txt /*StdinReadPre* StdinReadPre autocmd.txt /*StdinReadPre*
SwapExists autocmd.txt /*SwapExists* SwapExists autocmd.txt /*SwapExists*
@@ -4559,6 +4562,7 @@ compl-spelling insert.txt /*compl-spelling*
compl-tag insert.txt /*compl-tag* compl-tag insert.txt /*compl-tag*
compl-vim insert.txt /*compl-vim* compl-vim insert.txt /*compl-vim*
compl-whole-line insert.txt /*compl-whole-line* compl-whole-line insert.txt /*compl-whole-line*
complete-functions insert.txt /*complete-functions*
complete_add() eval.txt /*complete_add()* complete_add() eval.txt /*complete_add()*
complete_check() eval.txt /*complete_check()* complete_check() eval.txt /*complete_check()*
complex-change change.txt /*complex-change* complex-change change.txt /*complex-change*
@@ -5093,6 +5097,7 @@ ft-htmlos-syntax syntax.txt /*ft-htmlos-syntax*
ft-ia64-syntax syntax.txt /*ft-ia64-syntax* ft-ia64-syntax syntax.txt /*ft-ia64-syntax*
ft-inform-syntax syntax.txt /*ft-inform-syntax* ft-inform-syntax syntax.txt /*ft-inform-syntax*
ft-java-syntax syntax.txt /*ft-java-syntax* ft-java-syntax syntax.txt /*ft-java-syntax*
ft-javascript-omni insert.txt /*ft-javascript-omni*
ft-ksh-syntax syntax.txt /*ft-ksh-syntax* ft-ksh-syntax syntax.txt /*ft-ksh-syntax*
ft-lace-syntax syntax.txt /*ft-lace-syntax* ft-lace-syntax syntax.txt /*ft-lace-syntax*
ft-lex-syntax syntax.txt /*ft-lex-syntax* ft-lex-syntax syntax.txt /*ft-lex-syntax*
@@ -5183,6 +5188,8 @@ g0 motion.txt /*g0*
g8 various.txt /*g8* g8 various.txt /*g8*
g:netrw_alto pi_netrw.txt /*g:netrw_alto* g:netrw_alto pi_netrw.txt /*g:netrw_alto*
g:netrw_altv pi_netrw.txt /*g:netrw_altv* 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_cygwin pi_netrw.txt /*g:netrw_cygwin*
g:netrw_dav_cmd pi_netrw.txt /*g:netrw_dav_cmd* g:netrw_dav_cmd pi_netrw.txt /*g:netrw_dav_cmd*
g:netrw_fetch_cmd pi_netrw.txt /*g:netrw_fetch_cmd* g:netrw_fetch_cmd pi_netrw.txt /*g:netrw_fetch_cmd*
@@ -5379,6 +5386,7 @@ gvimrc gui.txt /*gvimrc*
gw change.txt /*gw* gw change.txt /*gw*
gwgw change.txt /*gwgw* gwgw change.txt /*gwgw*
gww change.txt /*gww* gww change.txt /*gww*
gx pi_netrw.txt /*gx*
gzip pi_gzip.txt /*gzip* gzip pi_gzip.txt /*gzip*
gzip-autocmd pi_gzip.txt /*gzip-autocmd* gzip-autocmd pi_gzip.txt /*gzip-autocmd*
gzip-example autocmd.txt /*gzip-example* gzip-example autocmd.txt /*gzip-example*
@@ -5961,6 +5969,7 @@ netrw-D pi_netrw.txt /*netrw-D*
netrw-NB pi_netrw.txt /*netrw-NB* netrw-NB pi_netrw.txt /*netrw-NB*
netrw-Nb pi_netrw.txt /*netrw-Nb* netrw-Nb pi_netrw.txt /*netrw-Nb*
netrw-O pi_netrw.txt /*netrw-O* netrw-O pi_netrw.txt /*netrw-O*
netrw-P pi_netrw.txt /*netrw-P*
netrw-R pi_netrw.txt /*netrw-R* netrw-R pi_netrw.txt /*netrw-R*
netrw-S pi_netrw.txt /*netrw-S* netrw-S pi_netrw.txt /*netrw-S*
netrw-U pi_netrw.txt /*netrw-U* netrw-U pi_netrw.txt /*netrw-U*
@@ -5979,10 +5988,12 @@ netrw-chgup pi_netrw.txt /*netrw-chgup*
netrw-contents pi_netrw.txt /*netrw-contents* netrw-contents pi_netrw.txt /*netrw-contents*
netrw-cr pi_netrw.txt /*netrw-cr* netrw-cr pi_netrw.txt /*netrw-cr*
netrw-credits pi_netrw.txt /*netrw-credits* netrw-credits pi_netrw.txt /*netrw-credits*
netrw-ctrl-h pi_netrw.txt /*netrw-ctrl-h*
netrw-ctrl-l pi_netrw.txt /*netrw-ctrl-l* netrw-ctrl-l pi_netrw.txt /*netrw-ctrl-l*
netrw-curdir pi_netrw.txt /*netrw-curdir* netrw-curdir pi_netrw.txt /*netrw-curdir*
netrw-d pi_netrw.txt /*netrw-d* netrw-d pi_netrw.txt /*netrw-d*
netrw-debug pi_netrw.txt /*netrw-debug* netrw-debug pi_netrw.txt /*netrw-debug*
netrw-del pi_netrw.txt /*netrw-del*
netrw-delete pi_netrw.txt /*netrw-delete* netrw-delete pi_netrw.txt /*netrw-delete*
netrw-dir pi_netrw.txt /*netrw-dir* netrw-dir pi_netrw.txt /*netrw-dir*
netrw-dirlist pi_netrw.txt /*netrw-dirlist* netrw-dirlist pi_netrw.txt /*netrw-dirlist*
@@ -5995,7 +6006,6 @@ netrw-externapp pi_netrw.txt /*netrw-externapp*
netrw-file pi_netrw.txt /*netrw-file* netrw-file pi_netrw.txt /*netrw-file*
netrw-fixup pi_netrw.txt /*netrw-fixup* netrw-fixup pi_netrw.txt /*netrw-fixup*
netrw-ftp pi_netrw.txt /*netrw-ftp* netrw-ftp pi_netrw.txt /*netrw-ftp*
netrw-h pi_netrw.txt /*netrw-h*
netrw-handler pi_netrw.txt /*netrw-handler* netrw-handler pi_netrw.txt /*netrw-handler*
netrw-help pi_netrw.txt /*netrw-help* netrw-help pi_netrw.txt /*netrw-help*
netrw-hexplore pi_netrw.txt /*netrw-hexplore* netrw-hexplore pi_netrw.txt /*netrw-hexplore*
@@ -6026,6 +6036,7 @@ netrw-pexplore pi_netrw.txt /*netrw-pexplore*
netrw-preview pi_netrw.txt /*netrw-preview* netrw-preview pi_netrw.txt /*netrw-preview*
netrw-problems pi_netrw.txt /*netrw-problems* netrw-problems pi_netrw.txt /*netrw-problems*
netrw-protocol pi_netrw.txt /*netrw-protocol* netrw-protocol pi_netrw.txt /*netrw-protocol*
netrw-prvwin pi_netrw.txt /*netrw-prvwin*
netrw-q pi_netrw.txt /*netrw-q* netrw-q pi_netrw.txt /*netrw-q*
netrw-r pi_netrw.txt /*netrw-r* netrw-r pi_netrw.txt /*netrw-r*
netrw-read pi_netrw.txt /*netrw-read* netrw-read pi_netrw.txt /*netrw-read*
@@ -6038,6 +6049,7 @@ netrw-sexplore pi_netrw.txt /*netrw-sexplore*
netrw-sort pi_netrw.txt /*netrw-sort* netrw-sort pi_netrw.txt /*netrw-sort*
netrw-sortsequence pi_netrw.txt /*netrw-sortsequence* netrw-sortsequence pi_netrw.txt /*netrw-sortsequence*
netrw-starstar pi_netrw.txt /*netrw-starstar* netrw-starstar pi_netrw.txt /*netrw-starstar*
netrw-start pi_netrw.txt /*netrw-start*
netrw-transparent pi_netrw.txt /*netrw-transparent* netrw-transparent pi_netrw.txt /*netrw-transparent*
netrw-u pi_netrw.txt /*netrw-u* netrw-u pi_netrw.txt /*netrw-u*
netrw-uidpass pi_netrw.txt /*netrw-uidpass* netrw-uidpass pi_netrw.txt /*netrw-uidpass*
@@ -6051,6 +6063,7 @@ netrw-write pi_netrw.txt /*netrw-write*
netrw-x pi_netrw.txt /*netrw-x* netrw-x pi_netrw.txt /*netrw-x*
netrw-xfer pi_netrw.txt /*netrw-xfer* netrw-xfer pi_netrw.txt /*netrw-xfer*
netrw.vim pi_netrw.txt /*netrw.vim* netrw.vim pi_netrw.txt /*netrw.vim*
netrw_filehandler pi_netrw.txt /*netrw_filehandler*
netterm-mouse options.txt /*netterm-mouse* netterm-mouse options.txt /*netterm-mouse*
network pi_netrw.txt /*network* network pi_netrw.txt /*network*
new-5 version5.txt /*new-5* new-5 version5.txt /*new-5*
@@ -6605,6 +6618,7 @@ spell-SOFOTO spell.txt /*spell-SOFOTO*
spell-SUGSWITHDOTS spell.txt /*spell-SUGSWITHDOTS* spell-SUGSWITHDOTS spell.txt /*spell-SUGSWITHDOTS*
spell-SYLLABLE spell.txt /*spell-SYLLABLE* spell-SYLLABLE spell.txt /*spell-SYLLABLE*
spell-SYLLABLENUM spell.txt /*spell-SYLLABLENUM* spell-SYLLABLENUM spell.txt /*spell-SYLLABLENUM*
spell-SpellFileMissing spell.txt /*spell-SpellFileMissing*
spell-TRY spell.txt /*spell-TRY* spell-TRY spell.txt /*spell-TRY*
spell-UPP spell.txt /*spell-UPP* spell-UPP spell.txt /*spell-UPP*
spell-VERSION spell.txt /*spell-VERSION* spell-VERSION spell.txt /*spell-VERSION*
@@ -6635,6 +6649,7 @@ spell-wordlist-format spell.txt /*spell-wordlist-format*
spell-yiddish spell.txt /*spell-yiddish* spell-yiddish spell.txt /*spell-yiddish*
spell.txt spell.txt /*spell.txt* spell.txt spell.txt /*spell.txt*
spellbadword() eval.txt /*spellbadword()* spellbadword() eval.txt /*spellbadword()*
spellfile.vim spell.txt /*spellfile.vim*
spellsuggest() eval.txt /*spellsuggest()* spellsuggest() eval.txt /*spellsuggest()*
split() eval.txt /*split()* split() eval.txt /*split()*
splitfind windows.txt /*splitfind* splitfind windows.txt /*splitfind*
@@ -6888,6 +6903,7 @@ tag-highlight syntax.txt /*tag-highlight*
tag-matchlist tagsrch.txt /*tag-matchlist* tag-matchlist tagsrch.txt /*tag-matchlist*
tag-old-static tagsrch.txt /*tag-old-static* tag-old-static tagsrch.txt /*tag-old-static*
tag-overloaded version5.txt /*tag-overloaded* tag-overloaded version5.txt /*tag-overloaded*
tag-preview tagsrch.txt /*tag-preview*
tag-priority tagsrch.txt /*tag-priority* tag-priority tagsrch.txt /*tag-priority*
tag-regexp tagsrch.txt /*tag-regexp* tag-regexp tagsrch.txt /*tag-regexp*
tag-search tagsrch.txt /*tag-search* tag-search tagsrch.txt /*tag-search*

View File

@@ -46,6 +46,8 @@ void list_unref __ARGS((list_T *l));
dictitem_T *dict_lookup __ARGS((hashitem_T *hi)); dictitem_T *dict_lookup __ARGS((hashitem_T *hi));
int list_append_dict __ARGS((list_T *list, dict_T *dict)); int list_append_dict __ARGS((list_T *list, dict_T *dict));
int garbage_collect __ARGS((void)); int garbage_collect __ARGS((void));
list_T *list_alloc __ARGS((void));
void list_free __ARGS((list_T *l));
dict_T *dict_alloc __ARGS((void)); dict_T *dict_alloc __ARGS((void));
int dict_add_nr_str __ARGS((dict_T *d, char *key, long nr, char_u *str)); int dict_add_nr_str __ARGS((dict_T *d, char *key, long nr, char_u *str));
char_u *get_dict_string __ARGS((dict_T *d, char_u *key)); char_u *get_dict_string __ARGS((dict_T *d, char_u *key));

View File

@@ -36,5 +36,5 @@
#define VIM_VERSION_NODOT "vim70aa" #define VIM_VERSION_NODOT "vim70aa"
#define VIM_VERSION_SHORT "7.0aa" #define VIM_VERSION_SHORT "7.0aa"
#define VIM_VERSION_MEDIUM "7.0aa ALPHA" #define VIM_VERSION_MEDIUM "7.0aa ALPHA"
#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2006 Jan 29)" #define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 1)"
#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2006 Jan 29, compiled " #define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 1, compiled "