Runtime file updates.

This commit is contained in:
Bram Moolenaar
2014-05-22 18:26:40 +02:00
parent 90013c6a75
commit 13600303c5
8 changed files with 359 additions and 117 deletions

View File

@ -1,7 +1,7 @@
" netrw.vim: Handles file transfer and remote directory listing across " netrw.vim: Handles file transfer and remote directory listing across
" AUTOLOAD SECTION " AUTOLOAD SECTION
" Date: Mar 20, 2014 " Date: May 13, 2014
" Version: 151 " Version: 152
" Maintainer: Charles E Campbell <NdrOchip@ScampbellPfamily.AbizM-NOSPAM> " Maintainer: Charles E Campbell <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
" Copyright: Copyright (C) 1999-2013 Charles E. Campbell {{{1 " Copyright: Copyright (C) 1999-2013 Charles E. Campbell {{{1
@ -22,7 +22,14 @@
if &cp || exists("g:loaded_netrw") if &cp || exists("g:loaded_netrw")
finish finish
endif endif
let g:loaded_netrw = "v151" if v:version < 704 || !has("patch213")
if !exists("s:needpatch213")
echo "***sorry*** this version of netrw requires vim v7.4 with patch 213"
endif
let s:needpatch213= 1
finish
endif
let g:loaded_netrw = "v152"
if !exists("s:NOTE") if !exists("s:NOTE")
let s:NOTE = 0 let s:NOTE = 0
let s:WARNING = 1 let s:WARNING = 1
@ -44,7 +51,7 @@ setl cpo&vim
" 0=note = s:NOTE " 0=note = s:NOTE
" 1=warning = s:WARNING " 1=warning = s:WARNING
" 2=error = s:ERROR " 2=error = s:ERROR
" Mar 04, 2014 : max errnum currently is 96 " Apr 16, 2014 : max errnum currently is 97
fun! netrw#ErrorMsg(level,msg,errnum) fun! netrw#ErrorMsg(level,msg,errnum)
" call Dfunc("netrw#ErrorMsg(level=".a:level." msg<".a:msg."> errnum=".a:errnum.") g:netrw_use_errorwindow=".g:netrw_use_errorwindow) " call Dfunc("netrw#ErrorMsg(level=".a:level." msg<".a:msg."> errnum=".a:errnum.") g:netrw_use_errorwindow=".g:netrw_use_errorwindow)
@ -100,7 +107,7 @@ fun! netrw#ErrorMsg(level,msg,errnum)
hi link netrwMesgError Error hi link netrwMesgError Error
endif endif
" call Decho("setl noma ro bh=wipe") " call Decho("setl noma ro bh=wipe")
setl noma ro bh=wipe setl ro nomod noma bh=wipe
else else
" (optional) netrw will show messages using echomsg. Even if the " (optional) netrw will show messages using echomsg. Even if the
@ -245,7 +252,7 @@ call s:NetrwInit("g:netrw_alto" , &sb)
call s:NetrwInit("g:netrw_altv" , &spr) call s:NetrwInit("g:netrw_altv" , &spr)
call s:NetrwInit("g:netrw_banner" , 1) call s:NetrwInit("g:netrw_banner" , 1)
call s:NetrwInit("g:netrw_browse_split", 0) call s:NetrwInit("g:netrw_browse_split", 0)
call s:NetrwInit("g:netrw_bufsettings" , "noma nomod nonu nobl nowrap ro") call s:NetrwInit("g:netrw_bufsettings" , "noma nomod nonu nobl nowrap ro nornu")
call s:NetrwInit("g:netrw_chgwin" , -1) call s:NetrwInit("g:netrw_chgwin" , -1)
call s:NetrwInit("g:netrw_compress" , "gzip") call s:NetrwInit("g:netrw_compress" , "gzip")
call s:NetrwInit("g:netrw_ctags" , "ctags") call s:NetrwInit("g:netrw_ctags" , "ctags")
@ -316,7 +323,7 @@ if !exists("g:netrw_localcopycmd")
if g:netrw_cygwin if g:netrw_cygwin
let g:netrw_localcopycmd= "cp" let g:netrw_localcopycmd= "cp"
else else
let g:netrw_localcopycmd= "cmd /c copy" let g:netrw_localcopycmd= expand("$COMSPEC")." /c copy"
endif endif
elseif has("unix") || has("macunix") elseif has("unix") || has("macunix")
let g:netrw_localcopycmd= "cp" let g:netrw_localcopycmd= "cp"
@ -328,7 +335,15 @@ if exists("g:netrw_local_mkdir")
let g:netrw_localmkdir= g:netrw_local_mkdir let g:netrw_localmkdir= g:netrw_local_mkdir
call netrw#ErrorMsg(s:NOTE,"g:netrw_local_mkdir is deprecated in favor of g:netrw_localmkdir",87) call netrw#ErrorMsg(s:NOTE,"g:netrw_local_mkdir is deprecated in favor of g:netrw_localmkdir",87)
endif endif
call s:NetrwInit("g:netrw_localmkdir","mkdir") if has("win32") || has("win95") || has("win64") || has("win16")
if g:netrw_cygwin
call s:NetrwInit("g:netrw_localmkdir","mkdir")
else
let g:netrw_localmkdir= expand("$COMSPEC")." /c mkdir"
endif
else
call s:NetrwInit("g:netrw_localmkdir","mkdir")
endif
call s:NetrwInit("g:netrw_remote_mkdir","mkdir") call s:NetrwInit("g:netrw_remote_mkdir","mkdir")
if exists("g:netrw_local_movecmd") if exists("g:netrw_local_movecmd")
let g:netrw_localmovecmd= g:netrw_local_movecmd let g:netrw_localmovecmd= g:netrw_local_movecmd
@ -339,7 +354,7 @@ if !exists("g:netrw_localmovecmd")
if g:netrw_cygwin if g:netrw_cygwin
let g:netrw_localmovecmd= "mv" let g:netrw_localmovecmd= "mv"
else else
let g:netrw_localmovecmd= "cmd /c move" let g:netrw_localmovecmd= expand("$COMSPEC")." /c move"
endif endif
elseif has("unix") || has("macunix") elseif has("unix") || has("macunix")
let g:netrw_localmovecmd= "mv" let g:netrw_localmovecmd= "mv"
@ -347,11 +362,19 @@ if !exists("g:netrw_localmovecmd")
let g:netrw_localmovecmd= "" let g:netrw_localmovecmd= ""
endif endif
endif endif
call s:NetrwInit("g:netrw_localrmdir", "rmdir")
if exists("g:netrw_local_rmdir") if exists("g:netrw_local_rmdir")
let g:netrw_localrmdir= g:netrw_local_rmdir let g:netrw_localrmdir= g:netrw_local_rmdir
call netrw#ErrorMsg(s:NOTE,"g:netrw_local_rmdir is deprecated in favor of g:netrw_localrmdir",86) call netrw#ErrorMsg(s:NOTE,"g:netrw_local_rmdir is deprecated in favor of g:netrw_localrmdir",86)
endif endif
if has("win32") || has("win95") || has("win64") || has("win16")
if g:netrw_cygwin
call s:NetrwInit("g:netrw_localrmdir","rmdir")
else
let g:netrw_localrmdir= expand("$COMSPEC")." /c rmdir"
endif
else
call s:NetrwInit("g:netrw_localrmdir","rmdir")
endif
call s:NetrwInit("g:netrw_liststyle" , s:THINLIST) call s:NetrwInit("g:netrw_liststyle" , s:THINLIST)
" sanity checks " sanity checks
if g:netrw_liststyle < 0 || g:netrw_liststyle >= s:MAXLIST if g:netrw_liststyle < 0 || g:netrw_liststyle >= s:MAXLIST
@ -423,7 +446,6 @@ endif
call s:NetrwInit("g:NetrwTopLvlMenu","Netrw.") call s:NetrwInit("g:NetrwTopLvlMenu","Netrw.")
call s:NetrwInit("g:netrw_win95ftp",1) call s:NetrwInit("g:netrw_win95ftp",1)
call s:NetrwInit("g:netrw_winsize",50) call s:NetrwInit("g:netrw_winsize",50)
if g:netrw_winsize == 0|let g:netrw_winsize= -1|endif
if g:netrw_winsize > 100|let g:netrw_winsize= 100|endif if g:netrw_winsize > 100|let g:netrw_winsize= 100|endif
" --------------------------------------------------------------------- " ---------------------------------------------------------------------
" Default values for netrw's script variables: {{{2 " Default values for netrw's script variables: {{{2
@ -583,37 +605,50 @@ fun! netrw#Explore(indx,dosplit,style,...)
if a:style == 0 " Explore, Sexplore if a:style == 0 " Explore, Sexplore
" call Decho("style=0: Explore or Sexplore") " call Decho("style=0: Explore or Sexplore")
let winsz= (winsz > 0)? (winsz*winheight(0))/100 : -winsz let winsz= (winsz > 0)? (winsz*winheight(0))/100 : -winsz
exe winsz."wincmd s" if winsz == 0|let winsz= ""|endif
exe "noswapfile ".winsz."wincmd s"
" call Decho("exe noswapfile ".winsz."wincmd s")
elseif a:style == 1 "Explore!, Sexplore! elseif a:style == 1 "Explore!, Sexplore!
" call Decho("style=1: Explore! or Sexplore!") " call Decho("style=1: Explore! or Sexplore!")
let winsz= (winsz > 0)? (winsz*winwidth(0))/100 : -winsz let winsz= (winsz > 0)? (winsz*winwidth(0))/100 : -winsz
exe "keepalt ".winsz."wincmd v" if winsz == 0|let winsz= ""|endif
exe "keepalt noswapfile ".winsz."wincmd v"
" call Decho("exe keepalt noswapfile ".winsz."wincmd v")
elseif a:style == 2 " Hexplore elseif a:style == 2 " Hexplore
" call Decho("style=2: Hexplore") " call Decho("style=2: Hexplore")
let winsz= (winsz > 0)? (winsz*winheight(0))/100 : -winsz let winsz= (winsz > 0)? (winsz*winheight(0))/100 : -winsz
exe "keepalt bel ".winsz."wincmd s" if winsz == 0|let winsz= ""|endif
exe "keepalt noswapfile bel ".winsz."wincmd s"
" call Decho("exe keepalt noswapfile bel ".winsz."wincmd s")
elseif a:style == 3 " Hexplore! elseif a:style == 3 " Hexplore!
" call Decho("style=3: Hexplore!") " call Decho("style=3: Hexplore!")
let winsz= (winsz > 0)? (winsz*winheight(0))/100 : -winsz let winsz= (winsz > 0)? (winsz*winheight(0))/100 : -winsz
exe "keepalt abo ".winsz."wincmd s" if winsz == 0|let winsz= ""|endif
exe "keepalt noswapfile abo ".winsz."wincmd s"
" call Decho("exe keepalt noswapfile abo ".winsz."wincmd s")
elseif a:style == 4 " Vexplore elseif a:style == 4 " Vexplore
" call Decho("style=4: Vexplore") " call Decho("style=4: Vexplore")
let winsz= (winsz > 0)? (winsz*winwidth(0))/100 : -winsz let winsz= (winsz > 0)? (winsz*winwidth(0))/100 : -winsz
exe "keepalt lefta ".winsz."wincmd v" if winsz == 0|let winsz= ""|endif
exe "keepalt noswapfile lefta ".winsz."wincmd v"
" call Decho("exe keepalt noswapfile lefta ".winsz."wincmd v")
elseif a:style == 5 " Vexplore! elseif a:style == 5 " Vexplore!
" call Decho("style=5: Vexplore!") " call Decho("style=5: Vexplore!")
let winsz= (winsz > 0)? (winsz*winwidth(0))/100 : -winsz let winsz= (winsz > 0)? (winsz*winwidth(0))/100 : -winsz
exe "keepalt rightb ".winsz."wincmd v" if winsz == 0|let winsz= ""|endif
exe "keepalt noswapfile rightb ".winsz."wincmd v"
" call Decho("exe keepalt noswapfile rightb ".winsz."wincmd v")
elseif a:style == 6 " Texplore elseif a:style == 6 " Texplore
call s:SaveBufVars() call s:SaveBufVars()
" call Decho("style = 6: Texplore") " call Decho("style = 6: Texplore")
exe "keepalt tabnew ".fnameescape(curdir) exe "keepalt tabnew ".fnameescape(curdir)
" call Decho("exe keepalt tabnew ".fnameescape(curdir))
call s:RestoreBufVars() call s:RestoreBufVars()
endif endif
call s:RestoreWinVars() call s:RestoreWinVars()
@ -1335,8 +1370,29 @@ fun! netrw#Obtain(islocal,fname,...)
keepj call netrw#ErrorMsg(s:ERROR,getline(1),5) keepj call netrw#ErrorMsg(s:ERROR,getline(1),5)
endif endif
endif endif
elseif b:netrw_method == 9
" obtain file using sftp
" call Decho("obtain via sftp (method #9)")
if a:fname =~ '/'
let localfile= substitute(a:fname,'^.*/','','')
else
let localfile= a:fname
endif
" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_sftp_cmd." ".shellescape(g:netrw_machine.":".b:netrw_fname,1).shellescape(localfile)." ".shellescape(tgtdir))
exe s:netrw_silentxfer."!".g:netrw_sftp_cmd." ".shellescape(g:netrw_machine.":".b:netrw_fname,1).shellescape(localfile)." ".shellescape(tgtdir)
elseif !exists("b:netrw_method") || b:netrw_method < 0 elseif !exists("b:netrw_method") || b:netrw_method < 0
" call Dfunc("netrw#Obtain : unsupported method") " probably a badly formed url; protocol not recognized
" call Dret("netrw#Obtain : unsupported method")
return
else
" protocol recognized but not supported for Obtain (yet?)
if !exists("g:netrw_quiet")
keepj call netrw#ErrorMsg(s:ERROR,"current protocol not supported for obtaining file",97)
endif
" call Dret("netrw#Obtain : current protocol not supported for obtaining file")
return return
endif endif
@ -1436,6 +1492,7 @@ fun! s:NetrwOptionRestore(vt)
if exists("{a:vt}netrw_magickeep")|let &l:magic = {a:vt}netrw_magickeep |unlet {a:vt}netrw_magickeep|endif if exists("{a:vt}netrw_magickeep")|let &l:magic = {a:vt}netrw_magickeep |unlet {a:vt}netrw_magickeep|endif
if exists("{a:vt}netrw_modkeep") |let &l:mod = {a:vt}netrw_modkeep |unlet {a:vt}netrw_modkeep |endif if exists("{a:vt}netrw_modkeep") |let &l:mod = {a:vt}netrw_modkeep |unlet {a:vt}netrw_modkeep |endif
if exists("{a:vt}netrw_nukeep") |let &l:nu = {a:vt}netrw_nukeep |unlet {a:vt}netrw_nukeep |endif if exists("{a:vt}netrw_nukeep") |let &l:nu = {a:vt}netrw_nukeep |unlet {a:vt}netrw_nukeep |endif
if exists("{a:vt}netrw_rnukeep") |let &l:rnu = {a:vt}netrw_rnukeep |unlet {a:vt}netrw_rnukeep |endif
if exists("{a:vt}netrw_repkeep") |let &l:report = {a:vt}netrw_repkeep |unlet {a:vt}netrw_repkeep |endif if exists("{a:vt}netrw_repkeep") |let &l:report = {a:vt}netrw_repkeep |unlet {a:vt}netrw_repkeep |endif
if exists("{a:vt}netrw_rokeep") |let &l:ro = {a:vt}netrw_rokeep |unlet {a:vt}netrw_rokeep |endif if exists("{a:vt}netrw_rokeep") |let &l:ro = {a:vt}netrw_rokeep |unlet {a:vt}netrw_rokeep |endif
if exists("{a:vt}netrw_selkeep") |let &l:sel = {a:vt}netrw_selkeep |unlet {a:vt}netrw_selkeep |endif if exists("{a:vt}netrw_selkeep") |let &l:sel = {a:vt}netrw_selkeep |unlet {a:vt}netrw_selkeep |endif
@ -1532,7 +1589,7 @@ fun! s:NetrwOptionSave(vt)
let {a:vt}netrw_awkeep = &l:aw let {a:vt}netrw_awkeep = &l:aw
let {a:vt}netrw_bhkeep = &l:bh let {a:vt}netrw_bhkeep = &l:bh
let {a:vt}netrw_blkeep = &l:bl let {a:vt}netrw_blkeep = &l:bl
" let {a:vt}netrw_btkeep = &l:bt let {a:vt}netrw_btkeep = &l:bt
let {a:vt}netrw_bombkeep = &l:bomb let {a:vt}netrw_bombkeep = &l:bomb
let {a:vt}netrw_cedit = &cedit let {a:vt}netrw_cedit = &cedit
let {a:vt}netrw_cikeep = &l:ci let {a:vt}netrw_cikeep = &l:ci
@ -1542,7 +1599,9 @@ fun! s:NetrwOptionSave(vt)
let {a:vt}netrw_cpokeep = &l:cpo let {a:vt}netrw_cpokeep = &l:cpo
let {a:vt}netrw_diffkeep = &l:diff let {a:vt}netrw_diffkeep = &l:diff
let {a:vt}netrw_fenkeep = &l:fen let {a:vt}netrw_fenkeep = &l:fen
let {a:vt}netrw_ffkeep = &l:ff if !exists("g:netrw_ffkeep") || g:netrw_ffkeep == 1
let {a:vt}netrw_ffkeep = &l:ff
endif
let {a:vt}netrw_fokeep = &l:fo " formatoptions let {a:vt}netrw_fokeep = &l:fo " formatoptions
let {a:vt}netrw_gdkeep = &l:gd " gdefault let {a:vt}netrw_gdkeep = &l:gd " gdefault
let {a:vt}netrw_hidkeep = &l:hidden let {a:vt}netrw_hidkeep = &l:hidden
@ -1553,6 +1612,7 @@ fun! s:NetrwOptionSave(vt)
let {a:vt}netrw_magickeep = &l:magic let {a:vt}netrw_magickeep = &l:magic
let {a:vt}netrw_modkeep = &l:mod let {a:vt}netrw_modkeep = &l:mod
let {a:vt}netrw_nukeep = &l:nu let {a:vt}netrw_nukeep = &l:nu
let {a:vt}netrw_rnukeep = &l:rnu
let {a:vt}netrw_repkeep = &l:report let {a:vt}netrw_repkeep = &l:report
let {a:vt}netrw_rokeep = &l:ro let {a:vt}netrw_rokeep = &l:ro
let {a:vt}netrw_selkeep = &l:sel let {a:vt}netrw_selkeep = &l:sel
@ -1973,7 +2033,7 @@ fun! netrw#NetRead(mode,...)
endif endif
let b:netrw_lastfile = choice let b:netrw_lastfile = choice
" call Decho("setl ro") " call Decho("setl ro")
setl ro setl ro nomod
"......................................... ".........................................
" NetRead: (dav) NetRead Method #6 {{{3 " NetRead: (dav) NetRead Method #6 {{{3
@ -2052,7 +2112,7 @@ fun! netrw#NetRead(mode,...)
let result = s:NetrwGetFile(readcmd,tmpfile, b:netrw_method) let result = s:NetrwGetFile(readcmd,tmpfile, b:netrw_method)
let b:netrw_lastfile = choice let b:netrw_lastfile = choice
" call Decho("setl ro") " call Decho("setl ro")
setl ro setl ro nomod
"......................................... ".........................................
" NetRead: (sftp) NetRead Method #9 {{{3 " NetRead: (sftp) NetRead Method #9 {{{3
@ -3675,7 +3735,7 @@ fun! s:NetrwGetBuffer(islocal,dirname)
" call Decho(" re-using w:netrw_treebufnr=".w:netrw_treebufnr) " call Decho(" re-using w:netrw_treebufnr=".w:netrw_treebufnr)
let eikeep= &ei let eikeep= &ei
setl ei=all setl ei=all
exe "sil! keepalt b ".w:netrw_treebufnr exe "sil! noswapfile keepalt b ".w:netrw_treebufnr
let &ei= eikeep let &ei= eikeep
setl ma setl ma
sil! keepj %d sil! keepj %d
@ -3799,10 +3859,10 @@ fun! s:NetrwGetBuffer(islocal,dirname)
setl ei=all setl ei=all
if getline(2) =~ '^" Netrw Directory Listing' if getline(2) =~ '^" Netrw Directory Listing'
" call Decho(" getline(2)<".getline(2).'> matches "Netrw Directory Listing" : using keepalt b '.bufnum) " call Decho(" getline(2)<".getline(2).'> matches "Netrw Directory Listing" : using keepalt b '.bufnum)
exe "sil! keepalt b ".bufnum exe "sil! noswapfile keepalt b ".bufnum
else else
" call Decho(" getline(2)<".getline(2).'> does not match "Netrw Directory Listing" : using b '.bufnum) " call Decho(" getline(2)<".getline(2).'> does not match "Netrw Directory Listing" : using b '.bufnum)
exe "sil! keepalt b ".bufnum exe "sil! noswapfile keepalt b ".bufnum
endif endif
if bufname("%") == '.' if bufname("%") == '.'
" call Decho("exe sil! keepalt file ".fnameescape(getcwd())) " call Decho("exe sil! keepalt file ".fnameescape(getcwd()))
@ -3985,8 +4045,8 @@ fun! s:NetrwListSettings(islocal)
" call Dfunc("s:NetrwListSettings(islocal=".a:islocal.")") " call Dfunc("s:NetrwListSettings(islocal=".a:islocal.")")
" call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo) " call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo)
let fname= bufname("%") let fname= bufname("%")
" call Decho("(NetrwListSettings) setl bt=nofile nobl ma nonu nowrap noro") " " call Decho("(NetrwListSettings) setl bt=nofile nobl ma nonu nowrap noro nornu")
setl bt=nofile nobl ma nonu nowrap noro setl bt=nofile nobl ma nonu nowrap noro nornu
" call Decho("(NetrwListSettings) exe sil! keepalt file ".fnameescape(fname)) " call Decho("(NetrwListSettings) exe sil! keepalt file ".fnameescape(fname))
exe "sil! keepalt file ".fnameescape(fname) exe "sil! keepalt file ".fnameescape(fname)
if g:netrw_use_noswf if g:netrw_use_noswf
@ -4011,9 +4071,11 @@ endfun
" =1: local browsing " =1: local browsing
fun! s:NetrwListStyle(islocal) fun! s:NetrwListStyle(islocal)
" call Dfunc("NetrwListStyle(islocal=".a:islocal.") w:netrw_liststyle=".w:netrw_liststyle) " call Dfunc("NetrwListStyle(islocal=".a:islocal.") w:netrw_liststyle=".w:netrw_liststyle)
let ykeep = @@ let ykeep = @@
let fname = s:NetrwGetWord() let fname = s:NetrwGetWord()
if !exists("w:netrw_liststyle")|let w:netrw_liststyle= g:netrw_liststyle|endif if !exists("w:netrw_liststyle")|let w:netrw_liststyle= g:netrw_liststyle|endif
let svpos = netrw#SavePosn()
let w:netrw_liststyle = (w:netrw_liststyle + 1) % s:MAXLIST let w:netrw_liststyle = (w:netrw_liststyle + 1) % s:MAXLIST
" call Decho("fname<".fname.">") " call Decho("fname<".fname.">")
" call Decho("chgd w:netrw_liststyle to ".w:netrw_liststyle) " call Decho("chgd w:netrw_liststyle to ".w:netrw_liststyle)
@ -4057,18 +4119,11 @@ fun! s:NetrwListStyle(islocal)
" refresh the listing " refresh the listing
" call Decho("refresh the listing") " call Decho("refresh the listing")
let svpos= netrw#SavePosn()
keepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) keepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
keepj call netrw#RestorePosn(svpos)
keepj call s:NetrwCursor() keepj call s:NetrwCursor()
" keep cursor on the filename " restore position; keep cursor on the filename
sil! keepj $ keepj call netrw#RestorePosn(svpos)
let result= search('\%(^\%(|\+\s\)\=\|\s\{2,}\)\zs'.escape(fname,'.\[]*$^').'\%(\s\{2,}\|$\)','bc')
" call Decho("search result=".result." w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'N/A'))
if result <= 0 && exists("w:netrw_bannercnt")
exe "sil! keepj ".w:netrw_bannercnt
endif
let @@= ykeep let @@= ykeep
" call Dret("NetrwListStyle".(exists("w:netrw_liststyle")? ' : w:netrw_liststyle='.w:netrw_liststyle : "")) " call Dret("NetrwListStyle".(exists("w:netrw_liststyle")? ' : w:netrw_liststyle='.w:netrw_liststyle : ""))
@ -4198,6 +4253,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
endif endif
let newdir = a:newdir let newdir = a:newdir
let dolockout = 0 let dolockout = 0
let dorestore = 1
" call Decho("dirname<".dirname.">") " call Decho("dirname<".dirname.">")
" ignore <cr>s when done in the banner " ignore <cr>s when done in the banner
@ -4208,7 +4264,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
" call Decho("#1: quickhelp=".g:netrw_quickhelp." ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)") " call Decho("#1: quickhelp=".g:netrw_quickhelp." ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
let g:netrw_quickhelp= (g:netrw_quickhelp + 1)%len(s:QuickHelp) let g:netrw_quickhelp= (g:netrw_quickhelp + 1)%len(s:QuickHelp)
" call Decho("#2: quickhelp=".g:netrw_quickhelp." ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)") " call Decho("#2: quickhelp=".g:netrw_quickhelp." ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
setl noro ma nowrap setl ma noro nowrap
keepj call setline(line('.'),'" Quick Help: <F1>:help '.s:QuickHelp[g:netrw_quickhelp]) keepj call setline(line('.'),'" Quick Help: <F1>:help '.s:QuickHelp[g:netrw_quickhelp])
setl noma nomod nowrap setl noma nomod nowrap
keepj call netrw#RestorePosn(nbcd_curpos) keepj call netrw#RestorePosn(nbcd_curpos)
@ -4300,6 +4356,14 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
call s:NetrwMenu(0) call s:NetrwMenu(0)
" optional change to window " optional change to window
if g:netrw_chgwin >= 1 if g:netrw_chgwin >= 1
if winnr("$")+1 == g:netrw_chgwin
" if g:netrw_chgwin is set to one more than the last window, then
" vertically split the last window to make that window available.
let curwin= winnr()
exe "keepj keepalt ".g:netrw_chgwin."wincmd ".winnr("$")
vs
exe "keepj keepalt ".g:netrw_chgwin."wincmd ".curwin
endif
exe "keepj keepalt ".g:netrw_chgwin."wincmd w" exe "keepj keepalt ".g:netrw_chgwin."wincmd w"
endif endif
endif endif
@ -4317,11 +4381,18 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
else else
exe "keepj e! ".fnameescape(dirname) exe "keepj e! ".fnameescape(dirname)
endif endif
" call Decho("after e! ".dirname.": hidden=".&hidden." bufhidden<".&bufhidden."> mod=".&mod)
call s:NetrwCursor() call s:NetrwCursor()
" call Decho("COMBAK#1: after e! ".dirname.": hidden=".&hidden." bufhidden<".&bufhidden."> mod=".&mod)
if &hidden || &bufhidden == "hide"
" file came from vim's hidden storage. Don't "restore" options with it.
let dorestore= 0
endif
else else
" call Decho("edit-a-file: remote file: NetrwBrowse will edit it") " call Decho("edit-a-file: remote file: NetrwBrowse will edit it")
endif endif
let dolockout= 1 let dolockout= 1
" call Decho("COMBAK#2: after e! ".dirname.": hidden=".&hidden." bufhidden<".&bufhidden."> mod=".&mod)
" handle g:Netrw_funcref -- call external-to-netrw functions " handle g:Netrw_funcref -- call external-to-netrw functions
" This code will handle g:Netrw_funcref as an individual function reference " This code will handle g:Netrw_funcref as an individual function reference
@ -4488,21 +4559,31 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
" -------------------------------------- " --------------------------------------
" NetrwBrowseChgDir: Restore and Cleanup {{{3 " NetrwBrowseChgDir: Restore and Cleanup {{{3
" -------------------------------------- " --------------------------------------
keepj call s:NetrwOptionRestore("s:") " call Decho("COMBAK#3: after e! ".dirname.": hidden=".&hidden." bufhidden<".&bufhidden."> mod=".&mod)
if dolockout if dorestore
" dorestore is zero'd when a local file was hidden or bufhidden;
" in such a case, we want to keep whatever settings it may have.
" call Decho("doing option restore (dorestore=".dorestore.")")
keepj call s:NetrwOptionRestore("s:")
" else " Decho
" call Decho("skipping option restore (dorestore==0): hidden=".&hidden." bufhidden=".&bufhidden." mod=".&mod)
endif
" call Decho("COMBAK#4: after e! ".dirname.": hidden=".&hidden." bufhidden<".&bufhidden."> mod=".&mod)
if dolockout && dorestore
" call Decho("restore: filewritable(dirname<".dirname.">)=".filewritable(dirname)) " call Decho("restore: filewritable(dirname<".dirname.">)=".filewritable(dirname))
if filewritable(dirname) if filewritable(dirname)
" call Decho("restore: doing modification lockout settings: ma nomod noro") " call Decho("restore: doing modification lockout settings: ma nomod noro")
" call Decho("restore: setl ma nomod noro") " call Decho("restore: setl ma nomod noro")
setl ma nomod noro setl ma noro nomod
" call Decho("restore: ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)") " call Decho("restore: ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
else else
" call Decho("restore: doing modification lockout settings: ma nomod ro") " call Decho("restore: doing modification lockout settings: ma nomod ro")
" call Decho("restore: setl ma nomod noro") " call Decho("restore: setl ma nomod noro")
setl ma nomod ro setl ma ro nomod
" call Decho("restore: ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)") " call Decho("restore: ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
endif endif
endif endif
" call Decho("COMBAK#5: after e! ".dirname.": hidden=".&hidden." bufhidden<".&bufhidden."> mod=".&mod)
let @@= ykeep let @@= ykeep
" call Dret("s:NetrwBrowseChgDir <".dirname."> : curpos<".string(getpos(".")).">") " call Dret("s:NetrwBrowseChgDir <".dirname."> : curpos<".string(getpos(".")).">")
@ -5368,7 +5449,7 @@ fun! s:NetrwMaps(islocal)
nnoremap <buffer> <silent> a :call <SID>NetrwHide(1)<cr> nnoremap <buffer> <silent> a :call <SID>NetrwHide(1)<cr>
nnoremap <buffer> <silent> % :call <SID>NetrwOpenFile(1)<cr> nnoremap <buffer> <silent> % :call <SID>NetrwOpenFile(1)<cr>
nnoremap <buffer> <silent> c :call <SID>NetrwLcd(b:netrw_curdir)<cr> nnoremap <buffer> <silent> c :call <SID>NetrwLcd(b:netrw_curdir)<cr>
nnoremap <buffer> <silent> C :let g:netrw_chgwin= winnr()<cr> nnoremap <buffer> <silent> C :<c-u>call <SID>NetrwSetChgwin()<cr>
nnoremap <buffer> <silent> <cr> :call netrw#LocalBrowseCheck(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord()))<cr> nnoremap <buffer> <silent> <cr> :call netrw#LocalBrowseCheck(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord()))<cr>
nnoremap <buffer> <silent> <s-cr> :call <SID>TreeSqueezeDir(1)<cr> nnoremap <buffer> <silent> <s-cr> :call <SID>TreeSqueezeDir(1)<cr>
nnoremap <buffer> <silent> d :call <SID>NetrwMakeDir("")<cr> nnoremap <buffer> <silent> d :call <SID>NetrwMakeDir("")<cr>
@ -5421,7 +5502,7 @@ fun! s:NetrwMaps(islocal)
inoremap <buffer> <silent> a <c-o>:call <SID>NetrwHide(1)<cr> inoremap <buffer> <silent> a <c-o>:call <SID>NetrwHide(1)<cr>
inoremap <buffer> <silent> c <c-o>:exe "keepjumps lcd ".fnameescape(b:netrw_curdir)<cr> inoremap <buffer> <silent> c <c-o>:exe "keepjumps lcd ".fnameescape(b:netrw_curdir)<cr>
inoremap <buffer> <silent> c <c-o>:call <SID>NetrwLcd(b:netrw_curdir)<cr> inoremap <buffer> <silent> c <c-o>:call <SID>NetrwLcd(b:netrw_curdir)<cr>
inoremap <buffer> <silent> C <c-o>:let g:netrw_chgwin= winnr()<cr> inoremap <buffer> <silent> C <c-o>:call <SID>NetrwSetChgwin()<cr>
inoremap <buffer> <silent> % <c-o>:call <SID>NetrwOpenFile(1)<cr> inoremap <buffer> <silent> % <c-o>:call <SID>NetrwOpenFile(1)<cr>
inoremap <buffer> <silent> - <c-o>:call <SID>NetrwBrowseUpDir(1)<cr> inoremap <buffer> <silent> - <c-o>:call <SID>NetrwBrowseUpDir(1)<cr>
inoremap <buffer> <silent> <cr> <c-o>:call netrw#LocalBrowseCheck(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord()))<cr> inoremap <buffer> <silent> <cr> <c-o>:call netrw#LocalBrowseCheck(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord()))<cr>
@ -5552,7 +5633,7 @@ fun! s:NetrwMaps(islocal)
nnoremap <buffer> <silent> gf :<c-u>call <SID>NetrwForceFile(0,<SID>NetrwGetWord())<cr> nnoremap <buffer> <silent> gf :<c-u>call <SID>NetrwForceFile(0,<SID>NetrwGetWord())<cr>
nnoremap <buffer> <silent> gh :<c-u>call <SID>NetrwHidden(0)<cr> nnoremap <buffer> <silent> gh :<c-u>call <SID>NetrwHidden(0)<cr>
nnoremap <buffer> <silent> gp :<c-u>call <SID>NetrwChgPerm(0,b:netrw_curdir)<cr> nnoremap <buffer> <silent> gp :<c-u>call <SID>NetrwChgPerm(0,b:netrw_curdir)<cr>
nnoremap <buffer> <silent> C :let g:netrw_chgwin= winnr()<cr> nnoremap <buffer> <silent> C :<c-u>call <SID>NetrwSetChgwin()<cr>
nnoremap <buffer> <silent> i :call <SID>NetrwListStyle(0)<cr> nnoremap <buffer> <silent> i :call <SID>NetrwListStyle(0)<cr>
nnoremap <buffer> <silent> I :call <SID>NetrwBannerCtrl(1)<cr> nnoremap <buffer> <silent> I :call <SID>NetrwBannerCtrl(1)<cr>
nnoremap <buffer> <silent> o :call <SID>NetrwSplit(0)<cr> nnoremap <buffer> <silent> o :call <SID>NetrwSplit(0)<cr>
@ -5600,7 +5681,7 @@ fun! s:NetrwMaps(islocal)
inoremap <buffer> <silent> gb <c-o>:<c-u>call <SID>NetrwBookHistHandler(1,b:netrw_curdir)<cr> inoremap <buffer> <silent> gb <c-o>:<c-u>call <SID>NetrwBookHistHandler(1,b:netrw_curdir)<cr>
inoremap <buffer> <silent> gh <c-o>:<c-u>call <SID>NetrwHidden(0)<cr> inoremap <buffer> <silent> gh <c-o>:<c-u>call <SID>NetrwHidden(0)<cr>
inoremap <buffer> <silent> gp <c-o>:<c-u>call <SID>NetrwChgPerm(0,b:netrw_curdir)<cr> inoremap <buffer> <silent> gp <c-o>:<c-u>call <SID>NetrwChgPerm(0,b:netrw_curdir)<cr>
inoremap <buffer> <silent> C <c-o>:let g:netrw_chgwin= winnr()<cr> inoremap <buffer> <silent> C <c-o>:call <SID>NetrwSetChgwin()<cr>
inoremap <buffer> <silent> i <c-o>:call <SID>NetrwListStyle(0)<cr> inoremap <buffer> <silent> i <c-o>:call <SID>NetrwListStyle(0)<cr>
inoremap <buffer> <silent> I <c-o>:call <SID>NetrwBannerCtrl(1)<cr> inoremap <buffer> <silent> I <c-o>:call <SID>NetrwBannerCtrl(1)<cr>
inoremap <buffer> <silent> o <c-o>:call <SID>NetrwSplit(0)<cr> inoremap <buffer> <silent> o <c-o>:call <SID>NetrwSplit(0)<cr>
@ -5972,7 +6053,7 @@ fun! s:NetrwMarkFileCopy(islocal,...)
if a:islocal && s:netrwmftgt_islocal if a:islocal && s:netrwmftgt_islocal
" Copy marked files, local directory to local directory " Copy marked files, local directory to local directory
" call Decho("copy from local to local") " call Decho("copy from local to local")
if !executable(g:netrw_localcopycmd) && g:netrw_localcopycmd !~ '\<cmd\s' if !executable(g:netrw_localcopycmd) && g:netrw_localcopycmd !~ '^'.expand("$COMSPEC").'\s'
call netrw#ErrorMsg(s:ERROR,"g:netrw_localcopycmd<".g:netrw_localcopycmd."> not executable on your system, aborting",91) call netrw#ErrorMsg(s:ERROR,"g:netrw_localcopycmd<".g:netrw_localcopycmd."> not executable on your system, aborting",91)
" call Dfunc("s:NetrwMarkFileMove : g:netrw_localcopycmd<".g:netrw_localcopycmd."> n/a!") " call Dfunc("s:NetrwMarkFileMove : g:netrw_localcopycmd<".g:netrw_localcopycmd."> n/a!")
return return
@ -6545,7 +6626,7 @@ fun! s:NetrwMarkFileMove(islocal)
" move: local -> local " move: local -> local
" call Decho("move from local to local") " call Decho("move from local to local")
" call Decho("local to local move") " call Decho("local to local move")
if !executable(g:netrw_localmovecmd) && g:netrw_localmovecmd !~ '\<cmd\s' if !executable(g:netrw_localmovecmd) && g:netrw_localmovecmd !~ '^'.expand("$COMSPEC").'\s'
call netrw#ErrorMsg(s:ERROR,"g:netrw_localmovecmd<".g:netrw_localmovecmd."> not executable on your system, aborting",90) call netrw#ErrorMsg(s:ERROR,"g:netrw_localmovecmd<".g:netrw_localmovecmd."> not executable on your system, aborting",90)
" call Dfunc("s:NetrwMarkFileMove : g:netrw_localmovecmd<".g:netrw_localmovecmd."> n/a!") " call Dfunc("s:NetrwMarkFileMove : g:netrw_localmovecmd<".g:netrw_localmovecmd."> n/a!")
return return
@ -7487,13 +7568,14 @@ endfun
fun! s:NetrwRefresh(islocal,dirname) fun! s:NetrwRefresh(islocal,dirname)
" call Dfunc("NetrwRefresh(islocal<".a:islocal.">,dirname=".a:dirname.") hide=".g:netrw_hide." sortdir=".g:netrw_sort_direction) " call Dfunc("NetrwRefresh(islocal<".a:islocal.">,dirname=".a:dirname.") hide=".g:netrw_hide." sortdir=".g:netrw_sort_direction)
" at the current time (Mar 19, 2007) all calls to NetrwRefresh() call NetrwBrowseChgDir() first. " at the current time (Mar 19, 2007) all calls to NetrwRefresh() call NetrwBrowseChgDir() first.
" (defunct) NetrwBrowseChgDir() may clear the display; hence a NetrwSavePosn() may not work if its placed here.
" (defunct) Also, NetrwBrowseChgDir() now does a NetrwSavePosn() itself.
setl ma noro setl ma noro
" call Decho("setl ma noro") " call Decho("setl ma noro")
" call Decho("clear buffer<".expand("%")."> with :%d") " call Decho("clear buffer<".expand("%")."> with :%d")
let ykeep = @@ let ykeep = @@
" save the cursor position before refresh.
let screenposn = netrw#SavePosn() let screenposn = netrw#SavePosn()
" call Decho("win#".winnr().": ".winheight(0)."x".winwidth(0)." curfile<".expand("%").">")
" call Decho("clearing buffer prior to refresh") " call Decho("clearing buffer prior to refresh")
sil! keepj %d sil! keepj %d
if a:islocal if a:islocal
@ -7501,6 +7583,8 @@ fun! s:NetrwRefresh(islocal,dirname)
else else
keepj call s:NetrwBrowse(a:islocal,a:dirname) keepj call s:NetrwBrowse(a:islocal,a:dirname)
endif endif
" restore position
keepj call netrw#RestorePosn(screenposn) keepj call netrw#RestorePosn(screenposn)
" restore file marks " restore file marks
@ -7550,6 +7634,21 @@ fun! s:NetrwRefreshDir(islocal,dirname)
" call Dret("s:NetrwRefreshDir") " call Dret("s:NetrwRefreshDir")
endfun endfun
" ---------------------------------------------------------------------
" s:NetrwSetChgwin: set g:netrw_chgwin; a <cr> will use the specified
" window number to do its editing in.
" Supports [count]C where the count, if present, is used to specify
" a window to use for editing via the <cr> mapping.
fun! s:NetrwSetChgwin()
" call Dfunc("s:NetrwSetChgwin() v:count=".v:count)
if v:count > 0
let g:netrw_chgwin= v:count
else
let g:netrw_chgwin= winnr()
endif
" call Dret("s:NetrwSetChgwin")
endfun
" --------------------------------------------------------------------- " ---------------------------------------------------------------------
" s:NetrwSetSort: sets up the sort based on the g:netrw_sort_sequence {{{2 " s:NetrwSetSort: 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
@ -7687,6 +7786,7 @@ fun! s:NetrwSplit(mode)
if a:mode == 0 if a:mode == 0
" remote and o " remote and o
let winsz= (g:netrw_winsize > 0)? (g:netrw_winsize*winheight(0))/100 : -g:netrw_winsize let winsz= (g:netrw_winsize > 0)? (g:netrw_winsize*winheight(0))/100 : -g:netrw_winsize
if winsz == 0|let winsz= ""|endif
" call Decho("exe ".(g:netrw_alto? "bel " : "abo ").winsz."wincmd s") " call Decho("exe ".(g:netrw_alto? "bel " : "abo ").winsz."wincmd s")
exe (g:netrw_alto? "bel " : "abo ").winsz."wincmd s" exe (g:netrw_alto? "bel " : "abo ").winsz."wincmd s"
let s:didsplit= 1 let s:didsplit= 1
@ -7707,6 +7807,7 @@ fun! s:NetrwSplit(mode)
elseif a:mode == 2 elseif a:mode == 2
" remote and v " remote and v
let winsz= (g:netrw_winsize > 0)? (g:netrw_winsize*winwidth(0))/100 : -g:netrw_winsize let winsz= (g:netrw_winsize > 0)? (g:netrw_winsize*winwidth(0))/100 : -g:netrw_winsize
if winsz == 0|let winsz= ""|endif
" call Decho("exe ".(g:netrw_altv? "rightb " : "lefta ").winsz."wincmd v") " call Decho("exe ".(g:netrw_altv? "rightb " : "lefta ").winsz."wincmd v")
exe (g:netrw_altv? "rightb " : "lefta ").winsz."wincmd v" exe (g:netrw_altv? "rightb " : "lefta ").winsz."wincmd v"
let s:didsplit= 1 let s:didsplit= 1
@ -7717,6 +7818,7 @@ fun! s:NetrwSplit(mode)
elseif a:mode == 3 elseif a:mode == 3
" local and o " local and o
let winsz= (g:netrw_winsize > 0)? (g:netrw_winsize*winheight(0))/100 : -g:netrw_winsize let winsz= (g:netrw_winsize > 0)? (g:netrw_winsize*winheight(0))/100 : -g:netrw_winsize
if winsz == 0|let winsz= ""|endif
" call Decho("exe ".(g:netrw_alto? "bel " : "abo ").winsz."wincmd s") " call Decho("exe ".(g:netrw_alto? "bel " : "abo ").winsz."wincmd s")
exe (g:netrw_alto? "bel " : "abo ").winsz."wincmd s" exe (g:netrw_alto? "bel " : "abo ").winsz."wincmd s"
let s:didsplit= 1 let s:didsplit= 1
@ -7755,6 +7857,7 @@ fun! s:NetrwSplit(mode)
elseif a:mode == 5 elseif a:mode == 5
" local and v " local and v
let winsz= (g:netrw_winsize > 0)? (g:netrw_winsize*winwidth(0))/100 : -g:netrw_winsize let winsz= (g:netrw_winsize > 0)? (g:netrw_winsize*winwidth(0))/100 : -g:netrw_winsize
if winsz == 0|let winsz= ""|endif
" call Decho("exe ".(g:netrw_altv? "rightb " : "lefta ").winsz."wincmd v") " call Decho("exe ".(g:netrw_altv? "rightb " : "lefta ").winsz."wincmd v")
exe (g:netrw_altv? "rightb " : "lefta ").winsz."wincmd v" exe (g:netrw_altv? "rightb " : "lefta ").winsz."wincmd v"
let s:didsplit= 1 let s:didsplit= 1
@ -7983,7 +8086,7 @@ fun! s:NetrwTreeListing(dirname)
1d 1d
endwhile endwhile
setl noma nomod ro exe "setl ".g:netrw_bufsettings
" call Dret("NetrwTreeListing : bufname<".expand("%").">") " call Dret("NetrwTreeListing : bufname<".expand("%").">")
return return
@ -8088,7 +8191,7 @@ fun! s:NetrwWideListing()
exe "nmap <buffer> <silent> w /^\\\\|\\s\\s\\zs\\S/\<cr>" exe "nmap <buffer> <silent> w /^\\\\|\\s\\s\\zs\\S/\<cr>"
exe "nmap <buffer> <silent> b ?^\\\\|\\s\\s\\zs\\S?\<cr>" exe "nmap <buffer> <silent> b ?^\\\\|\\s\\s\\zs\\S?\<cr>"
" call Decho("NetrwWideListing) setl noma nomod ro") " call Decho("NetrwWideListing) setl noma nomod ro")
setl noma nomod ro exe "setl ".g:netrw_bufsettings
" call Decho("(NetrwWideListing) ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)") " call Decho("(NetrwWideListing) ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
" call Dret("NetrwWideListing") " call Dret("NetrwWideListing")
return return
@ -8591,7 +8694,7 @@ fun! s:NetrwRemoteListing()
let w:netrw_method= b:netrw_method let w:netrw_method= b:netrw_method
endif endif
if s:method == "ftp" || s:method == "sftp" if s:method == "ftp"
" use ftp to get remote file listing {{{3 " use ftp to get remote file listing {{{3
" call Decho("use ftp to get remote file listing") " call Decho("use ftp to get remote file listing")
let s:method = "ftp" let s:method = "ftp"
@ -8660,7 +8763,7 @@ fun! s:NetrwRemoteListing()
endif endif
endif endif
else else
" use ssh to get remote file listing {{{3 " use ssh to get remote file listing {{{3
" call Decho("use ssh to get remote file listing: s:path<".s:path.">") " call Decho("use ssh to get remote file listing: s:path<".s:path.">")
let listcmd= s:MakeSshCmd(g:netrw_list_cmd) let listcmd= s:MakeSshCmd(g:netrw_list_cmd)
@ -9656,6 +9759,18 @@ fun! netrw#RestorePosn(...)
if a:0 > 0 if a:0 > 0
exe "keepj ".a:1 exe "keepj ".a:1
endif endif
" call Decho("a:1 = ".((a:0 > 0)? a:1 : 'n/a'))
" call Decho("liststyle = ".(exists("liststyle")? liststyle : 'n/a'). " w:netrw_liststyle=".(exists("w:netrw_liststyle")? w:netrw_liststyle : 'n/a'))
if exists("liststyle") && exists("w:netrw_liststyle") && liststyle != w:netrw_liststyle
let usesrch= 1
else
let usesrch= 0
endif
" call Decho("winh = ".(exists("w:netrw_winh")? w:netrw_winh : -1))
" call Decho("winw = ".(exists("w:netrw_winw")? w:netrw_winw : -1))
" call Decho("cur winheight=".winheight(0)." winwidth=".winwidth(0))
" call Decho("w:netrw_winfile = ".(exists("w:netrw_winfile")? w:netrw_winfile : 'n/a'))
" restore window " restore window
if exists("w:netrw_winnr") if exists("w:netrw_winnr")
@ -9675,9 +9790,31 @@ fun! netrw#RestorePosn(...)
endif endif
" restore position " restore position
if exists("w:netrw_line") && exists("w:netrw_col") " when the window's height x width has changed, the line,col is no longer useful
" call Decho("restore posn: exe keepj norm! ".w:netrw_line."G0".w:netrw_col."|") if w:netrw_winh == winheight(0) && w:netrw_winw == winwidth(0) && exists("w:netrw_line") && exists("w:netrw_col") && !usesrch
" call Decho("using posn: exe keepj norm! ".w:netrw_line."G0".w:netrw_col."|")
exe "keepj norm! ".w:netrw_line."G0".w:netrw_col."\<bar>" exe "keepj norm! ".w:netrw_line."G0".w:netrw_col."\<bar>"
elseif exists("w:netrw_winfile")
if !search('\<'.escape(w:netrw_winfile,g:netrw_fname_escape),'cw')
if exists("w:netrw_bannercnt")
" call Decho("using bannercnt: win#".winnr()." ".winheight(0)."x".winwidth(0)." w:netrw_winfile<".w:netrw_winfile.">")
exe "keepj ".w:netrw_bannercnt
norm! 0
else
" go to upper left corner
" call Decho("goto ulc: win#".winnr()." ".winheight(0)."x".winwidth(0)." w:netrw_winfile<".w:netrw_winfile.">")
keepj 1
norm! 0
endif
else
" call Decho("used search: w:netrw_winfile<".w:netrw_winfile.">")
endif
else
" call Decho("goto ulc: win#".winnr()." ".winheight(0)."x".winwidth(0))
keepj 1
norm! 0
endif endif
let &ei= eikeep let &ei= eikeep
@ -9703,12 +9840,32 @@ fun! netrw#SavePosn()
let w:netrw_col = virtcol(".") let w:netrw_col = virtcol(".")
" call Decho("currently, win#".w:netrw_winnr." line#".w:netrw_line." col#".w:netrw_col) " call Decho("currently, win#".w:netrw_winnr." line#".w:netrw_line." col#".w:netrw_col)
" save filename under cursor
" call Decho("line#".line(".")." w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'n/a'))
if exists("w:netrw_bannercnt") && line(".") >= w:netrw_bannercnt && &ft == "netrw"
let winfile = "|let w:netrw_winfile='".s:NetrwGetWord()."'"
else
let winfile= ""
endif
" call Decho("winfile<".winfile.">")
if exists("w:netrw_liststyle")
let liststyle = "|let liststyle=".w:netrw_liststyle
else
let liststyle= ""
endif
" call Decho("liststyle=".liststyle)
" Save top-of-screen line " Save top-of-screen line
keepj norm! H0 keepj norm! H0
let w:netrw_hline= line(".") let w:netrw_hline= line(".")
" save up alternate position information
" use this when window height x width has changed
let w:netrw_winh = winheight(0)
let w:netrw_winw = winwidth(0)
" set up string holding position parameters " set up string holding position parameters
let ret = "let w:netrw_winnr=".w:netrw_winnr."|let w:netrw_line=".w:netrw_line."|let w:netrw_col=".w:netrw_col."|let w:netrw_hline=".w:netrw_hline let ret = "let w:netrw_winnr=".w:netrw_winnr."|let w:netrw_line=".w:netrw_line."|let w:netrw_col=".w:netrw_col."|let w:netrw_hline=".w:netrw_hline."|let w:netrw_winh=".w:netrw_winh."|let w:netrw_winw=".w:netrw_winw.liststyle.winfile
keepj call netrw#RestorePosn() keepj call netrw#RestorePosn()
" call Dret("netrw#SavePosn : winnr=".(exists("w:netrw_winnr")? w:netrw_winnr : "n/a")." line=".(exists("w:netrw_line")? w:netrw_line : "n/a")." col=".(exists("w:netrw_col")? w:netrw_col : "n/a")." hline=".(exists("w:netrw_hline")? w:netrw_hline : "n/a")) " call Dret("netrw#SavePosn : winnr=".(exists("w:netrw_winnr")? w:netrw_winnr : "n/a")." line=".(exists("w:netrw_line")? w:netrw_line : "n/a")." col=".(exists("w:netrw_col")? w:netrw_col : "n/a")." hline=".(exists("w:netrw_hline")? w:netrw_hline : "n/a"))
@ -9883,7 +10040,11 @@ endfun
" a correct command for use with a system() call " a correct command for use with a system() call
fun! s:MakeSshCmd(sshcmd) fun! s:MakeSshCmd(sshcmd)
" call Dfunc("s:MakeSshCmd(sshcmd<".a:sshcmd.">) user<".s:user."> machine<".s:machine.">") " call Dfunc("s:MakeSshCmd(sshcmd<".a:sshcmd.">) user<".s:user."> machine<".s:machine.">")
let sshcmd = substitute(a:sshcmd,'\<HOSTNAME\>',s:user.s:machine,'') if s:user == ""
let sshcmd = substitute(a:sshcmd,'\<HOSTNAME\>',s:machine,'')
else
let sshcmd = substitute(a:sshcmd,'\<HOSTNAME\>',s:user."@".s:machine,'')
endif
if exists("g:netrw_port") && g:netrw_port != "" if exists("g:netrw_port") && g:netrw_port != ""
let sshcmd= substitute(sshcmd,"USEPORT",g:netrw_sshport.' '.g:netrw_port,'') let sshcmd= substitute(sshcmd,"USEPORT",g:netrw_sshport.' '.g:netrw_port,'')
elseif exists("s:port") && s:port != "" elseif exists("s:port") && s:port != ""
@ -10050,7 +10211,7 @@ fun! s:NetrwEnew(...)
keepj call s:NetrwOptionRestore("w:") keepj call s:NetrwOptionRestore("w:")
" call Decho("generate a buffer with keepjumps keepalt enew!") " call Decho("generate a buffer with keepjumps keepalt enew!")
let netrw_keepdiff= &l:diff let netrw_keepdiff= &l:diff
keepj keepalt enew! noswapfile keepj keepalt enew!
let &l:diff= netrw_keepdiff let &l:diff= netrw_keepdiff
" call Decho("bufnr($)=".bufnr("$")." winnr($)=".winnr("$")) " call Decho("bufnr($)=".bufnr("$")." winnr($)=".winnr("$"))
keepj call s:NetrwOptionSave("w:") keepj call s:NetrwOptionSave("w:")
@ -10145,7 +10306,7 @@ fun! s:NetrwLcd(newdir)
else else
call s:NetrwOptionRestore("w:") call s:NetrwOptionRestore("w:")
" call Decho("setl noma nomod nowrap") " call Decho("setl noma nomod nowrap")
setl noma nomod nowrap exe "setl ".g:netrw_bufsettings
" call Decho(" ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)") " call Decho(" ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
let a:newdir= dirname let a:newdir= dirname
" call Dret("s:NetrwBrowse : reusing buffer#".(exists("bufnum")? bufnum : 'N/A')."<".dirname."> getcwd<".getcwd().">") " call Dret("s:NetrwBrowse : reusing buffer#".(exists("bufnum")? bufnum : 'N/A')."<".dirname."> getcwd<".getcwd().">")
@ -10201,7 +10362,7 @@ fun! s:RemotePathAnalysis(dirname)
let s:machine = substitute(a:dirname,dirpat,'\4','') let s:machine = substitute(a:dirname,dirpat,'\4','')
let s:port = substitute(a:dirname,dirpat,'\5','') let s:port = substitute(a:dirname,dirpat,'\5','')
let s:path = substitute(a:dirname,dirpat,'\6','') let s:path = substitute(a:dirname,dirpat,'\6','')
let s:fname = substitute(a:dirname,'^.*/\ze.','','') let s:fname = substitute(s:path,'^.*/\ze.','','')
if s:machine =~ '@' if s:machine =~ '@'
let dirpat = '^\(.*\)@\(.\{-}\)$' let dirpat = '^\(.*\)@\(.\{-}\)$'
let s:user = s:user.'@'.substitute(s:machine,dirpat,'\1','') let s:user = s:user.'@'.substitute(s:machine,dirpat,'\1','')

View File

@ -1,4 +1,4 @@
*diff.txt* For Vim version 7.4. Last change: 2013 Sep 20 *diff.txt* For Vim version 7.4. Last change: 2014 May 20
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -95,7 +95,7 @@ While already in Vim you can start diff mode in three ways.
:difft[his] Make the current window part of the diff windows. This sets :difft[his] Make the current window part of the diff windows. This sets
the options like for "vimdiff". the options like for "vimdiff".
:diffp[atch] {patchfile} *E816* *:diffp* *:diffpatch* :diffp[atch] {patchfile} *E816* *:diffp* *:diffpatch*
Use the current buffer, patch it with the diff found in Use the current buffer, patch it with the diff found in
{patchfile} and open a buffer on the result. The options are {patchfile} and open a buffer on the result. The options are
set as for "vimdiff". set as for "vimdiff".

View File

@ -1,4 +1,4 @@
*pi_netrw.txt* For Vim version 7.4. Last change: 2014 Mar 20 *pi_netrw.txt* For Vim version 7.4. Last change: 2014 May 13
------------------------------------------------ ------------------------------------------------
NETRW REFERENCE MANUAL by Charles E. Campbell NETRW REFERENCE MANUAL by Charles E. Campbell
@ -173,7 +173,7 @@ There are more protocols supported by netrw than just scp and ftp, too: see the
next section, |netrw-externapp|, on how to use these external applications with next section, |netrw-externapp|, on how to use these external applications with
netrw and vim. netrw and vim.
PREVENTING LOADING *netrw-noload* PREVENTING LOADING *netrw-noload*
If you want to use plugins, but for some reason don't wish to use netrw, then If you want to use plugins, but for some reason don't wish to use netrw, then
you need to avoid loading both the plugin and the autoload portions of netrw. you need to avoid loading both the plugin and the autoload portions of netrw.
@ -184,7 +184,7 @@ You may do so by placing the following two lines in your <.vimrc>: >
< <
============================================================================== ==============================================================================
3. Netrw Reference *netrw-ref* {{{1 3. Netrw Reference *netrw-ref* {{{1
Netrw supports several protocols in addition to scp and ftp as mentioned Netrw supports several protocols in addition to scp and ftp as mentioned
in |netrw-start|. These include dav, fetch, http,... well, just look in |netrw-start|. These include dav, fetch, http,... well, just look
@ -291,7 +291,7 @@ SOURCING *netrw-source* {{{2
:Nsource "scp://[user@]machine[[:#]port]/path" uses scp :Nsource "scp://[user@]machine[[:#]port]/path" uses scp
:Nsource "sftp://[user@]machine/path" uses sftp :Nsource "sftp://[user@]machine/path" uses sftp
DIRECTORY LISTING *netrw-trailingslash* *netrw-dirlist* {{{2 DIRECTORY LISTING *netrw-trailingslash* *netrw-dirlist* {{{2
One may browse a directory to get a listing by simply attempting to One may browse a directory to get a listing by simply attempting to
edit the directory: > edit the directory: >
@ -348,9 +348,9 @@ settings are described below, in |netrw-browser-options|, and in
*g:netrw_bufsettings* the settings that netrw buffers have *g:netrw_bufsettings* the settings that netrw buffers have
(default) noma nomod nonu nowrap ro nobl (default) noma nomod nonu nowrap ro nobl
*g:netrw_chgwin* specifies a window number where file edits will take *g:netrw_chgwin* specifies a window number where subsequent file edits
place. (also see |netrw-C|) will take place. (also see |netrw-C|)
(default) not defined (default) -1
*g:Netrw_funcref* specifies a function (or functions) to be called when *g:Netrw_funcref* specifies a function (or functions) to be called when
netrw edits a file. The file is first edited, and netrw edits a file. The file is first edited, and
@ -371,9 +371,9 @@ settings are described below, in |netrw-browser-options|, and in
value of this variable to see if the alternate ftp value of this variable to see if the alternate ftp
method works for your setup. method works for your setup.
*g:netrw_ftp_options* Chosen by default, these options are supposed to turn *g:netrw_ftp_options* Chosen by default, these options are supposed to
interactive prompting off and to restrain ftp from turn interactive prompting off and to restrain ftp
attempting auto-login upon initial connection. from attempting auto-login upon initial connection.
However, it appears that not all ftp implementations However, it appears that not all ftp implementations
support this (ex. ncftp). support this (ex. ncftp).
="-i -n" ="-i -n"
@ -404,8 +404,8 @@ settings are described below, in |netrw-browser-options|, and in
*g:netrw_preview* =0 (default) preview window shown in a horizontally *g:netrw_preview* =0 (default) preview window shown in a horizontally
split window split window
=1 preview window shown in a vertically split window. =1 preview window shown in a vertically split window.
Also affects the "previous window" (see |netrw-P|) in Also affects the "previous window" (see |netrw-P|)
the same way. in the same way.
*g:netrw_scpport* = "-P" : option to use to set port for scp *g:netrw_scpport* = "-P" : option to use to set port for scp
*g:netrw_sshport* = "-p" : option to use to set port for ssh *g:netrw_sshport* = "-p" : option to use to set port for ssh
@ -543,15 +543,17 @@ which contains ftp commands which will be automatically run whenever ftp
starts. You may use this feature to enter a user and password for one site: > starts. You may use this feature to enter a user and password for one site: >
userid userid
password password
< *netrw-windows-netrc* *netrw-windows-s* < *netrw-windows-netrc* *netrw-windows-s*
If |g:netrw_ftp_cmd| contains -s:[path/]MACHINE, then (on Windows machines only) If |g:netrw_ftp_cmd| contains -s:[path/]MACHINE, then (on Windows machines
netrw will substitute the current machine name requested for ftp connections only) netrw will substitute the current machine name requested for ftp
for MACHINE. Hence one can have multiple machine.ftp files containing login connections for MACHINE. Hence one can have multiple machine.ftp files
and password for ftp. Example: > containing login and password for ftp. Example: >
let g:netrw_ftp_cmd= 'c:\Windows\System32\ftp -s:C:\Users\Myself\MACHINE' let g:netrw_ftp_cmd= 'c:\Windows\System32\ftp -s:C:\Users\Myself\MACHINE'
vim ftp://myhost.somewhere.net/ vim ftp://myhost.somewhere.net/
will use a file > will use a file >
C:\Users\Myself\myhost.ftp C:\Users\Myself\myhost.ftp
< <
Often, ftp will need to query the user for the userid and password. Often, ftp will need to query the user for the userid and password.
@ -681,7 +683,7 @@ your <.vimrc> customization file: >
< <
============================================================================== ==============================================================================
6. Transparent Remote File Editing *netrw-transparent* {{{1 6. Transparent Remote File Editing *netrw-transparent* {{{1
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|, |BufWriteCmd|, or |SourceCmd| (invoked via an |:autocmd| for |BufReadCmd|, |BufWriteCmd|, or |SourceCmd|
@ -755,7 +757,7 @@ below, a {netfile} is an url to a remote file.
============================================================================== ==============================================================================
8. Variables and Options *netrw-var* *netrw-settings* {{{1 8. Variables and Options *netrw-var* *netrw-settings* {{{1
(also see: |netrw-options| |netrw-variables| |netrw-protocol| (also see: |netrw-options| |netrw-variables| |netrw-protocol|
|netrw-browser-settings| |netrw-browser-options| ) |netrw-browser-settings| |netrw-browser-options| )
@ -795,7 +797,7 @@ set in the user's <.vimrc> file: (see also |netrw-settings| |netrw-protocol|)
=1 use default method to do ftp > =1 use default method to do ftp >
----------------------------------------------------------------------- -----------------------------------------------------------------------
< <
*netrw-internal-variables* *netrw-internal-variables*
The script will also make use of the following variables internally, albeit The script will also make use of the following variables internally, albeit
temporarily. temporarily.
> >
@ -1042,8 +1044,8 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
<del> Netrw will attempt to remove the file/directory |netrw-del| <del> Netrw will attempt to remove the file/directory |netrw-del|
- Makes Netrw go up one directory |netrw--| - Makes Netrw go up one directory |netrw--|
a Toggles between normal display, |netrw-a| a Toggles between normal display, |netrw-a|
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 browsing directory the current directory |netrw-c| c Make browsing directory the current directory |netrw-c|
C Setting the editing window |netrw-C| C Setting the editing window |netrw-C|
d Make a directory |netrw-d| d Make a directory |netrw-d|
@ -1068,7 +1070,7 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
mx Apply arbitrary shell command to marked files |netrw-mx| mx Apply arbitrary shell command to marked files |netrw-mx|
mz Compress/decompress marked files |netrw-mz| mz Compress/decompress marked files |netrw-mz|
o Enter the file/directory under the cursor in a new |netrw-o| o Enter the file/directory under the cursor in a new |netrw-o|
browser window. A horizontal split is used. browser window. A horizontal split is used.
O Obtain a file specified by cursor |netrw-O| O Obtain a file specified by cursor |netrw-O|
p Preview the file |netrw-p| p Preview the file |netrw-p|
P Browse in the previously used window |netrw-P| P Browse in the previously used window |netrw-P|
@ -1082,7 +1084,7 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
u Change to recently-visited directory |netrw-u| u Change to recently-visited directory |netrw-u|
U Change to subsequently-visited directory |netrw-U| U Change to subsequently-visited directory |netrw-U|
v Enter the file/directory under the cursor in a new |netrw-v| v Enter the file/directory under the cursor in a new |netrw-v|
browser window. A vertical split is used. browser window. A vertical split is used.
x View file with an associated program |netrw-x| x View file with an associated program |netrw-x|
X Execute filename under cursor via |system()| |netrw-X| X Execute filename under cursor via |system()| |netrw-X|
@ -1096,9 +1098,9 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
<rightmouse> (gvim only) delete file/directory using word under <rightmouse> (gvim only) delete file/directory using word under
mouse mouse
<2-leftmouse> (gvim only) when: <2-leftmouse> (gvim only) when:
* in a netrw-selected file, AND * in a netrw-selected file, AND
* |g:netrw_retmap| == 1 AND * |g:netrw_retmap| == 1 AND
* the user doesn't already have a <2-leftmouse> * the user doesn't already have a <2-leftmouse>
mapping defined before netrw is autoloaded, mapping defined before netrw is autoloaded,
then a double clicked leftmouse button will return then a double clicked leftmouse button will return
to the netrw browser window. See |g:netrw_retmap|. to the netrw browser window. See |g:netrw_retmap|.
@ -1234,9 +1236,7 @@ cursor at the left.
There is only one tree listing buffer; using "v" on a displayed subdirectory There is only one tree listing buffer; using "v" on a displayed subdirectory
will split the screen, but the same buffer will be shown twice. will split the screen, but the same buffer will be shown twice.
Associated setting variable: |g:netrw_altv| |g:netrw_winsize| Related Actions: |netrw-cr| |netrw-o| |netrw-t| |netrw-v|
Related Actions |netrw-cr| |netrw-o| |netrw-t| |netrw-v|
Associated setting variables: Associated setting variables:
|g:netrw_altv| control right/left splitting |g:netrw_altv| control right/left splitting
|g:netrw_winsize| control initial sizing |g:netrw_winsize| control initial sizing
@ -1258,11 +1258,12 @@ The wide listing format uses two or more contiguous spaces to delineate
filenames; when using that format, netrw won't be able to recognize or use filenames; when using that format, netrw won't be able to recognize or use
filenames which have two or more contiguous spaces embedded in the name or any filenames which have two or more contiguous spaces embedded in the name or any
trailing spaces. The thin listing format will, however, work with such files. trailing spaces. The thin listing format will, however, work with such files.
This listing format is the most compact. The wide listing format is the most compact.
The tree listing format has a top directory followed by files and directories The tree listing format has a top directory followed by files and directories
preceded by a "|". One may open and close directories by pressing the <cr> preceded by one or more "|"s, which indicate the directory depth. One may
key while atop the directory name. open and close directories by pressing the <cr> key while atop the directory
name.
One may make a preferred listing style your default; see |g:netrw_liststyle|. One may make a preferred listing style your default; see |g:netrw_liststyle|.
As an example, by putting the following line in your .vimrc, > As an example, by putting the following line in your .vimrc, >
@ -1462,8 +1463,16 @@ If files have been marked with |netrw-mf|: (local marked file list)
Marked files (and empty directories) will be deleted; again, you'll be Marked files (and empty directories) will be deleted; again, you'll be
asked to confirm the deletion before it actually takes place. asked to confirm the deletion before it actually takes place.
A further approach is to delete files which match a pattern.
* use :MF pattern (see |netrw-:MF|); then press "D".
* use mr (see |netrw-mr|) which will prompt you for pattern.
This will cause the matching files to be marked. Then,
press "D".
The |g:netrw_rm_cmd|, |g:netrw_rmf_cmd|, and |g:netrw_rmdir_cmd| variables are The |g:netrw_rm_cmd|, |g:netrw_rmf_cmd|, and |g:netrw_rmdir_cmd| variables are
used to control the attempts to remove files and directories. The used to control the attempts to remove remote files and directories. The
g:netrw_rm_cmd is used with files, and its default value is: g:netrw_rm_cmd is used with files, and its default value is:
g:netrw_rm_cmd: ssh HOSTNAME rm g:netrw_rm_cmd: ssh HOSTNAME rm
@ -1471,12 +1480,12 @@ g:netrw_rm_cmd is used with files, and its default value is:
The g:netrw_rmdir_cmd variable is used to support the removal of directories. The g:netrw_rmdir_cmd variable is used to support the removal of directories.
Its default value is: Its default value is:
g:netrw_rmdir_cmd: ssh HOSTNAME rmdir |g:netrw_rmdir_cmd|: ssh HOSTNAME rmdir
If removing a directory fails with g:netrw_rmdir_cmd, netrw then will attempt If removing a directory fails with g:netrw_rmdir_cmd, netrw then will attempt
to remove it again using the g:netrw_rmf_cmd variable. Its default value is: to remove it again using the g:netrw_rmf_cmd variable. Its default value is:
g:netrw_rmf_cmd: ssh HOSTNAME rm -f |g:netrw_rmf_cmd|: ssh HOSTNAME rm -f
Related topics: |netrw-d| Related topics: |netrw-d|
Associated setting variable: |g:netrw_localrmdir| |g:netrw_rm_cmd| Associated setting variable: |g:netrw_localrmdir| |g:netrw_rm_cmd|
@ -1548,11 +1557,12 @@ windows should have.
Return to Explorer~ Return to Explorer~
When one edits a file, for example by pressing <cr> when the When one edits a file, for example by pressing <cr> when the
cursor is atop a file in a netrw browser window, :Rexplore will cursor is atop a file in a netrw browser window, :Rexplore will
return the display to that of the last netrw browser window. return the display to that of the last netrw browser display
in that window.
Return from Explorer~ Return from Explorer~
Conversely, when one is editing a directory, issuing a :Rexplore Conversely, when one is editing a directory, issuing a :Rexplore
will return to editing the last file being edited in that will return to editing the file that was last edited in that
window. window.
The <2-leftmouse> map (which is only available under gvim and The <2-leftmouse> map (which is only available under gvim and
@ -1919,19 +1929,21 @@ MARKING FILES *netrw-:MF* *netrw-mf* {{{2
Netrw has several ways of marking files: Netrw has several ways of marking files:
* One may mark files with the cursor atop a filename and * One may mark files with the cursor atop a filename and
then pressing "mf". then pressing "mf".
* With gvim, in addition one may mark files with * With gvim, in addition one may mark files with
<s-leftmouse>. <s-leftmouse>. (see |netrw-mouse|)
* One may use the :MF command, which takes a list of * One may use the :MF command, which takes a list of
files (for local directories, the list may include files (for local directories, the list may include
wildcards -- see |glob()|) > wildcards -- see |glob()|) >
:MF *.c :MF *.c
< <
* Note that :MF uses |<f-args>| to break the line * Note that :MF uses |<f-args>| to break the line
at spaces. at spaces.
* Mark files based upon the quickfix list (|netrw-qF|)
The following netrw maps make use of marked files: The following netrw maps make use of marked files:
@ -1948,7 +1960,6 @@ The following netrw maps make use of marked files:
|netrw-mT| Generate tags using marked files |netrw-mT| Generate tags using marked files
|netrw-mx| Apply shell command to marked files |netrw-mx| Apply shell command to marked files
|netrw-mz| Compress/Decompress marked files |netrw-mz| Compress/Decompress marked files
|netrw-qF| Mark files using quickfix list
|netrw-O| Obtain marked files |netrw-O| Obtain marked files
|netrw-R| Rename marked files |netrw-R| Rename marked files
@ -2350,7 +2361,7 @@ your browsing preferences. (see also: |netrw-settings|)
2: errors 2: errors
*g:netrw_fastbrowse* =0: slow speed directory browsing; *g:netrw_fastbrowse* =0: slow speed directory browsing;
never re-uses directory listings, never re-uses directory listings;
always obtains directory listings. always obtains directory listings.
=1: medium speed directory browsing; =1: medium speed directory browsing;
re-use directory listings only re-use directory listings only
@ -2373,6 +2384,11 @@ your browsing preferences. (see also: |netrw-settings|)
trading off accuracy (ie. up-to-date listing) trading off accuracy (ie. up-to-date listing)
versus speed. versus speed.
*g:netrw_ffkeep* (default: doesn't exist)
If this variable exists and is zero, then
netrw will not do a save and restore for
|'fileformat'|.
*g:netrw_fname_escape* =' ?&;%' *g:netrw_fname_escape* =' ?&;%'
Used on filenames before remote reading/writing Used on filenames before remote reading/writing
@ -2518,13 +2534,13 @@ your browsing preferences. (see also: |netrw-settings|)
default: =0 default: =0
*g:netrw_rm_cmd* command for removing files *g:netrw_rm_cmd* command for removing remote files
default: "ssh USEPORT HOSTNAME rm" default: "ssh USEPORT HOSTNAME rm"
*g:netrw_rmdir_cmd* command for removing directories *g:netrw_rmdir_cmd* command for removing remote directories
default: "ssh USEPORT HOSTNAME rmdir" default: "ssh USEPORT HOSTNAME rmdir"
*g:netrw_rmf_cmd* command for removing softlinks *g:netrw_rmf_cmd* command for removing remote softlinks
default: "ssh USEPORT HOSTNAME rm -f" default: "ssh USEPORT HOSTNAME rm -f"
*g:netrw_sort_by* sort by "name", "time", or "size" *g:netrw_sort_by* sort by "name", "time", or "size"
@ -2634,6 +2650,9 @@ your browsing preferences. (see also: |netrw-settings|)
If g:netrw_winsize is less than zero, then If g:netrw_winsize is less than zero, then
the absolute value of g:netrw_winsize lines the absolute value of g:netrw_winsize lines
or columns will be used for the new window. or columns will be used for the new window.
If g:netrw_winsize is zero, then a normal
split will be made (ie. |'equalalways'| will
take effect, for example).
default: 50 (for 50%) default: 50 (for 50%)
*g:netrw_xstrlen* Controls how netrw computes string lengths, *g:netrw_xstrlen* Controls how netrw computes string lengths,
@ -2830,6 +2849,15 @@ One may select a netrw window for editing with the "C" mapping, or by setting
g:netrw_chgwin to the selected window number. Subsequent selection of a file g:netrw_chgwin to the selected window number. Subsequent selection of a file
to edit (|netrw-cr|) will use that window. to edit (|netrw-cr|) will use that window.
* C by itself, will select the current window for editing via
|netrw-cr|
* [count]C the count will be used as the window number to be used
for editing via |netrw-cr|.
Using >
let g:netrw_chgwin= -1
will restore the default editing behavior (ie. use the current window).
Related topics: |netrw-cr| |g:netrw_browse_split| Related topics: |netrw-cr| |g:netrw_browse_split|
Associated setting variables: |g:netrw_chgwin| Associated setting variables: |g:netrw_chgwin|
@ -3118,6 +3146,15 @@ Associated setting variables: |g:netrw_chgwin|
all netrw's mouse mappings, not just the <leftmouse> one. all netrw's mouse mappings, not just the <leftmouse> one.
(see |g:netrw_mousemaps|) (see |g:netrw_mousemaps|)
*netrw-p16*
P16. When editing remote files (ex. :e ftp://hostname/path/file),
under Windows I get an |E303| message complaining that its unable
to open a swap file.
(romainl) It looks like you are starting Vim from a protected
directory. Start if from your $HOME or another writable
directory.
============================================================================== ==============================================================================
11. Debugging Netrw Itself *netrw-debug* {{{1 11. Debugging Netrw Itself *netrw-debug* {{{1
@ -3177,6 +3214,32 @@ which is loaded automatically at startup (assuming :set nocp).
============================================================================== ==============================================================================
12. History *netrw-history* {{{1 12. History *netrw-history* {{{1
v152: Apr 08, 2014 * uses the |'noswapfile'| option (requires
vim 7.4 with patch 213)
* (Enno Nagel) turn |'rnu'| off in netrw
buffers.
* (Quinn Strahl) suggested that netrw
allow regular window splitting to occur,
thereby allowing |'equalalways'| to take
effect.
* (qingtian zhao) normally, netrw will
save and restore the |'fileformat'|;
however, sometimes that isn't wanted
Apr 14, 2014 * whenever netrw marks a buffer as ro,
it will also mark it as nomod.
Apr 16, 2014 * sftp protocol now supported by
netrw#Obtain(); this means that one
may use "mc" to copy a remote file
to a local file using sftp, and that
the |netrw-O| command can obtain remote
files via sftp.
* added [count]C support (see |netrw-C|)
Apr 18, 2014 * when |g:netrw_chgwin| is one more than
the last window, then vertically split
the last window and use it as the
chgwin window.
May 09, 2014 * SavePosn was "saving filename under cursor"
from a non-netrw window when using :Rex.
v151: Jan 22, 2014 * extended :Rexplore to return to buffer v151: Jan 22, 2014 * extended :Rexplore to return to buffer
prior to Explore or editing a directory prior to Explore or editing a directory
* (Ken Takata) netrw gave error when * (Ken Takata) netrw gave error when

View File

@ -1201,6 +1201,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
+mouse various.txt /*+mouse* +mouse various.txt /*+mouse*
+mouse_dec various.txt /*+mouse_dec* +mouse_dec various.txt /*+mouse_dec*
+mouse_gpm various.txt /*+mouse_gpm* +mouse_gpm various.txt /*+mouse_gpm*
+mouse_jsbterm various.txt /*+mouse_jsbterm*
+mouse_netterm various.txt /*+mouse_netterm* +mouse_netterm various.txt /*+mouse_netterm*
+mouse_pterm various.txt /*+mouse_pterm* +mouse_pterm various.txt /*+mouse_pterm*
+mouse_sgr various.txt /*+mouse_sgr* +mouse_sgr various.txt /*+mouse_sgr*
@ -1415,6 +1416,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
/\%>c pattern.txt /*\/\\%>c* /\%>c pattern.txt /*\/\\%>c*
/\%>l pattern.txt /*\/\\%>l* /\%>l pattern.txt /*\/\\%>l*
/\%>v pattern.txt /*\/\\%>v* /\%>v pattern.txt /*\/\\%>v*
/\%C pattern.txt /*\/\\%C*
/\%U pattern.txt /*\/\\%U* /\%U pattern.txt /*\/\\%U*
/\%V pattern.txt /*\/\\%V* /\%V pattern.txt /*\/\\%V*
/\%[] pattern.txt /*\/\\%[]* /\%[] pattern.txt /*\/\\%[]*
@ -4313,6 +4315,7 @@ E881 autocmd.txt /*E881*
E882 eval.txt /*E882* E882 eval.txt /*E882*
E883 eval.txt /*E883* E883 eval.txt /*E883*
E884 eval.txt /*E884* E884 eval.txt /*E884*
E885 sign.txt /*E885*
E89 message.txt /*E89* E89 message.txt /*E89*
E90 message.txt /*E90* E90 message.txt /*E90*
E91 options.txt /*E91* E91 options.txt /*E91*
@ -5980,6 +5983,7 @@ g:netrw_dynamic_maxfilenamelen pi_netrw.txt /*g:netrw_dynamic_maxfilenamelen*
g:netrw_errorlvl pi_netrw.txt /*g:netrw_errorlvl* g:netrw_errorlvl pi_netrw.txt /*g:netrw_errorlvl*
g:netrw_fastbrowse pi_netrw.txt /*g:netrw_fastbrowse* g:netrw_fastbrowse pi_netrw.txt /*g:netrw_fastbrowse*
g:netrw_fetch_cmd pi_netrw.txt /*g:netrw_fetch_cmd* g:netrw_fetch_cmd pi_netrw.txt /*g:netrw_fetch_cmd*
g:netrw_ffkeep pi_netrw.txt /*g:netrw_ffkeep*
g:netrw_fname_escape pi_netrw.txt /*g:netrw_fname_escape* g:netrw_fname_escape pi_netrw.txt /*g:netrw_fname_escape*
g:netrw_ftp pi_netrw.txt /*g:netrw_ftp* g:netrw_ftp pi_netrw.txt /*g:netrw_ftp*
g:netrw_ftp_browse_reject pi_netrw.txt /*g:netrw_ftp_browse_reject* g:netrw_ftp_browse_reject pi_netrw.txt /*g:netrw_ftp_browse_reject*
@ -7084,6 +7088,7 @@ netrw-p12 pi_netrw.txt /*netrw-p12*
netrw-p13 pi_netrw.txt /*netrw-p13* netrw-p13 pi_netrw.txt /*netrw-p13*
netrw-p14 pi_netrw.txt /*netrw-p14* netrw-p14 pi_netrw.txt /*netrw-p14*
netrw-p15 pi_netrw.txt /*netrw-p15* netrw-p15 pi_netrw.txt /*netrw-p15*
netrw-p16 pi_netrw.txt /*netrw-p16*
netrw-p2 pi_netrw.txt /*netrw-p2* netrw-p2 pi_netrw.txt /*netrw-p2*
netrw-p3 pi_netrw.txt /*netrw-p3* netrw-p3 pi_netrw.txt /*netrw-p3*
netrw-p4 pi_netrw.txt /*netrw-p4* netrw-p4 pi_netrw.txt /*netrw-p4*

View File

@ -1,4 +1,4 @@
*todo.txt* For Vim version 7.4. Last change: 2014 May 13 *todo.txt* For Vim version 7.4. Last change: 2014 May 22
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -55,6 +55,9 @@ directory exists. (Sergio Gallelli, 2013 Dec 29)
Problem using ":try" inside ":execute". (ZyX, 2013 Sep 15) Problem using ":try" inside ":execute". (ZyX, 2013 Sep 15)
Setting 'ttymouse' empty causes Dec mouse to be detected. (Elijah Griffin,
2014 May 13)
Python: ":py raw_input('prompt')" doesn't work. (Manu Hack) Python: ":py raw_input('prompt')" doesn't work. (Manu Hack)
MS-Windows: Crash opening very long file name starting with "\\". MS-Windows: Crash opening very long file name starting with "\\".
@ -87,11 +90,17 @@ Also fixes wrong result from executable().
Update from Ken Takata, 2014 Jan 10. Newer 2014 Apr 3. Update from Ken Takata, 2014 Jan 10. Newer 2014 Apr 3.
Win32: use 64 bit stat() if possible. (Ken Takata, 2014 May 12) Win32: use 64 bit stat() if possible. (Ken Takata, 2014 May 12)
Needs more tests. More tests May 14.
Idea: For a window in the middle (has window above and below it), use
right-mouse-drag on the status line to move a window up/down without changing
it's height? It's like dragging the status bar above it at the same time.
Can we make ":unlet $VAR" use unsetenv() to delete the env var? Can we make ":unlet $VAR" use unsetenv() to delete the env var?
What for systems that don't have unsetenv()? What for systems that don't have unsetenv()?
Patch to make getchar() work for typing Esc. (Yasuhiro Matsumoto, 2014 May 13)
Patch for problem that v:register is set to '_' after deleting into the black Patch for problem that v:register is set to '_' after deleting into the black
hole register. hole register.
@ -152,7 +161,7 @@ normal spell file. (Enno Nagel, 2014 Mar 29)
Update by Taylor Hedberg, 2013 May 30. Update by Taylor Hedberg, 2013 May 30.
Updated for Vim 7.4 by Ken Takata, 2013 Oct 5. Updated for Vim 7.4 by Ken Takata, 2013 Oct 5.
Update by Christian Brabandt, 2014 May 9. Remarks by Ken Takata. Update by Christian Brabandt, 2014 May 9. Remarks by Ken Takata.
Update by Christian 2014 May 12 Update by Christian 2014 May 12, github link on May 15
When typing the first character of a command, e.g. "f", then using a menu, the When typing the first character of a command, e.g. "f", then using a menu, the
menu item doesn't work. Clear typeahead when using a menu? menu item doesn't work. Clear typeahead when using a menu?
@ -608,7 +617,7 @@ Patch to make "z=" work when 'spell' is off. Does this have nasty side
effects? (Christian Brabandt, 2012 Aug 5, Update 2013 Aug 12) effects? (Christian Brabandt, 2012 Aug 5, Update 2013 Aug 12)
Would also need to do this for spellbadword() and spellsuggest(). Would also need to do this for spellbadword() and spellsuggest().
Patch for variable tabstops. Patch for variable tabstops. On github (Christian Brabandt, 2014 May 15)
On 64 bit MS-Windows "long" is only 32 bits, but we sometimes need to store a On 64 bit MS-Windows "long" is only 32 bits, but we sometimes need to store a
64 bits value. Change all number options to use nropt_T and define it to the 64 bits value. Change all number options to use nropt_T and define it to the

View File

@ -1,4 +1,4 @@
*various.txt* For Vim version 7.4. Last change: 2014 May 02 *various.txt* For Vim version 7.4. Last change: 2014 May 22
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -379,6 +379,7 @@ N *+mouse* Mouse handling |mouse-using|
N *+mouseshape* |'mouseshape'| N *+mouseshape* |'mouseshape'|
B *+mouse_dec* Unix only: Dec terminal mouse handling |dec-mouse| B *+mouse_dec* Unix only: Dec terminal mouse handling |dec-mouse|
N *+mouse_gpm* Unix only: Linux console mouse handling |gpm-mouse| N *+mouse_gpm* Unix only: Linux console mouse handling |gpm-mouse|
N *+mouse_jsbterm* JSB mouse handling |jsbterm-mouse|
B *+mouse_netterm* Unix only: netterm mouse handling |netterm-mouse| B *+mouse_netterm* Unix only: netterm mouse handling |netterm-mouse|
N *+mouse_pterm* QNX only: pterm mouse handling |qnx-terminal| N *+mouse_pterm* QNX only: pterm mouse handling |qnx-terminal|
N *+mouse_sysmouse* Unix only: *BSD console mouse handling |sysmouse| N *+mouse_sysmouse* Unix only: *BSD console mouse handling |sysmouse|

View File

@ -20,7 +20,7 @@
if &cp || exists("g:loaded_netrwPlugin") if &cp || exists("g:loaded_netrwPlugin")
finish finish
endif endif
let g:loaded_netrwPlugin = "v151" let g:loaded_netrwPlugin = "v152"
if v:version < 702 if v:version < 702
echohl WarningMsg echohl WarningMsg
echo "***warning*** you need vim version 7.2 for this version of netrw" echo "***warning*** you need vim version 7.2 for this version of netrw"

View File

@ -2,7 +2,7 @@
" Language: C++ " Language: C++
" Current Maintainer: vim-jp (https://github.com/vim-jp/cpp-vim) " Current Maintainer: vim-jp (https://github.com/vim-jp/cpp-vim)
" Previous Maintainer: Ken Shan <ccshan@post.harvard.edu> " Previous Maintainer: Ken Shan <ccshan@post.harvard.edu>
" Last Change: 2012 Jun 14 " Last Change: 2014 May 14
" For version 5.x: Clear all syntax items " For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded " For version 6.x: Quit when a syntax file was already loaded
@ -39,6 +39,7 @@ if !exists("cpp_no_cpp11")
syn keyword cppExceptions noexcept syn keyword cppExceptions noexcept
syn keyword cppStorageClass constexpr decltype syn keyword cppStorageClass constexpr decltype
syn keyword cppConstant nullptr syn keyword cppConstant nullptr
syn region cppRawString matchgroup=cppRawDelimiter start=+\%(u8\|[uLU]\)\=R"\z([[:alnum:]_{}[\]#<>%:;.?*\+\-/\^&|~!=,"']\{,16}\)(+ end=+)\z1"+ contains=@Spell
endif endif
" The minimum and maximum operators in GNU C++ " The minimum and maximum operators in GNU C++
@ -62,6 +63,8 @@ if version >= 508 || !exists("did_cpp_syntax_inits")
HiLink cppStructure Structure HiLink cppStructure Structure
HiLink cppBoolean Boolean HiLink cppBoolean Boolean
HiLink cppConstant Constant HiLink cppConstant Constant
HiLink cppRawDelimiter Delimiter
HiLink cppRawString String
delcommand HiLink delcommand HiLink
endif endif