0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

updated for version 7.1b

This commit is contained in:
Bram Moolenaar 2007-05-10 18:00:30 +00:00
parent 2b64440353
commit 7aa9f6a03a
8 changed files with 178 additions and 101 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 21, 2007 " Date: May 05, 2007
" Version: 108 " Version: 109
" Maintainer: Charles E Campbell, Jr <NdrOchip@ScampbellPfamily.AbizM-NOSPAM> " Maintainer: Charles E Campbell, Jr <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
" Copyright: Copyright (C) 1999-2007 Charles E. Campbell, Jr. {{{1 " Copyright: Copyright (C) 1999-2007 Charles E. Campbell, Jr. {{{1
@ -30,7 +30,7 @@ if !exists("s:NOTE")
let s:WARNING = 1 let s:WARNING = 1
let s:ERROR = 2 let s:ERROR = 2
endif endif
let g:loaded_netrw = "v108" let g:loaded_netrw = "v109"
if v:version < 700 if v:version < 700
call netrw#ErrorMsg(s:WARNING,"you need vim version 7.0 or later for version ".g:loaded_netrw." of netrw",1) call netrw#ErrorMsg(s:WARNING,"you need vim version 7.0 or later for version ".g:loaded_netrw." of netrw",1)
finish finish
@ -224,6 +224,12 @@ endif
if !exists("g:netrw_mkdir_cmd") if !exists("g:netrw_mkdir_cmd")
let g:netrw_mkdir_cmd= g:netrw_ssh_cmd." USEPORT HOSTNAME mkdir" let g:netrw_mkdir_cmd= g:netrw_ssh_cmd." USEPORT HOSTNAME mkdir"
endif endif
if !exists("g:netrw_scpport")
let g:netrw_scpport= "-P"
endif
if !exists("g:netrw_sshport")
let g:netrw_sshport= "-p"
endif
if !exists("g:netrw_rename_cmd") if !exists("g:netrw_rename_cmd")
let g:netrw_rename_cmd= g:netrw_ssh_cmd." USEPORT HOSTNAME mv" let g:netrw_rename_cmd= g:netrw_ssh_cmd." USEPORT HOSTNAME mv"
endif endif
@ -287,6 +293,9 @@ endif
if !exists("g:NetrwTopLvlMenu") if !exists("g:NetrwTopLvlMenu")
let g:NetrwTopLvlMenu= "Netrw." let g:NetrwTopLvlMenu= "Netrw."
endif endif
if !exists("g:netrw_use_errorwindow")
let g:netrw_use_errorwindow= 1
endif
if !exists("g:netrw_win95ftp") if !exists("g:netrw_win95ftp")
let g:netrw_win95ftp= 1 let g:netrw_win95ftp= 1
endif endif
@ -373,8 +382,9 @@ endfun
" =============================== " ===============================
" NetOptionSave: save options and set to "standard" form {{{2 " NetOptionSave: save options and set to "standard" form {{{2
"DechoTabOn
fun! s:NetOptionSave() fun! s:NetOptionSave()
" call Dfunc("s:NetOptionSave()") " call Dfunc("s:NetOptionSave() win#".winnr()." buf#".bufnr("."))
if !exists("w:netrw_optionsave") if !exists("w:netrw_optionsave")
let w:netrw_optionsave= 1 let w:netrw_optionsave= 1
else else
@ -413,12 +423,13 @@ fun! s:NetOptionSave()
silent! let w:netrw_regslash= @/ silent! let w:netrw_regslash= @/
" call Dret("s:NetOptionSave") " call Dret("s:NetOptionSave")
" call Dret("s:NetOptionSave : win#".winnr()." buf#".bufnr("."))
endfun endfun
" ------------------------------------------------------------------------ " ------------------------------------------------------------------------
" NetOptionRestore: restore options {{{2 " NetOptionRestore: restore options {{{2
fun! s:NetOptionRestore() fun! s:NetOptionRestore()
" call Dfunc("s:NetOptionRestore()") " call Dfunc("s:NetOptionRestore() win#".winnr()." buf#".bufnr("."))
if !exists("w:netrw_optionsave") if !exists("w:netrw_optionsave")
" call Dret("s:NetOptionRestore : w:netrw_optionsave doesn't exist") " call Dret("s:NetOptionRestore : w:netrw_optionsave doesn't exist")
return return
@ -463,7 +474,7 @@ fun! s:NetOptionRestore()
if exists("w:netrw_regstar") |silent! let @*= w:netrw_regstar |unlet w:netrw_regstar |endif if exists("w:netrw_regstar") |silent! let @*= w:netrw_regstar |unlet w:netrw_regstar |endif
if exists("w:netrw_regslash")|silent! let @/= w:netrw_regslash|unlet w:netrw_regslash|endif if exists("w:netrw_regslash")|silent! let @/= w:netrw_regslash|unlet w:netrw_regslash|endif
" call Dret("s:NetOptionRestore : restored user options") " call Dret("s:NetOptionRestore : win#".winnr()." buf#".bufnr("."))
endfun endfun
" --------------------------------------------------------------------- " ---------------------------------------------------------------------
@ -727,7 +738,7 @@ fun! netrw#NetRead(mode,...)
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 != ""
let useport= " -P ".g:netrw_port let useport= " ".g:netrw_scpport." ".g:netrw_port
else else
let useport= "" let useport= ""
endif endif
@ -1088,7 +1099,7 @@ fun! netrw#NetWrite(...) range
" call Decho("write via scp (method #4)") " call Decho("write via scp (method #4)")
let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape) let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape)
if exists("g:netrw_port") && g:netrw_port != "" if exists("g:netrw_port") && g:netrw_port != ""
let useport= " -P ".g:netrw_port let useport= " ".g:netrw_scpport." ".g:netrw_port
else else
let useport= "" let useport= ""
endif endif
@ -1661,7 +1672,7 @@ endfun
" with the requested remote hostname first. " with the requested remote hostname first.
fun! s:NetBrowse(islocal,dirname) fun! s:NetBrowse(islocal,dirname)
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
" call Dfunc("NetBrowse(islocal=".a:islocal." dirname<".a:dirname.">) liststyle=".w:netrw_liststyle." ".g:loaded_netrw." buf#".bufnr("%")) " call Dfunc("NetBrowse(islocal=".a:islocal." dirname<".a:dirname.">) liststyle=".w:netrw_liststyle." ".g:loaded_netrw." buf#".bufnr("%")."<".bufname("%").">")
" call Dredir("ls!") " call Dredir("ls!")
if exists("s:netrw_skipbrowse") if exists("s:netrw_skipbrowse")
@ -1756,7 +1767,7 @@ fun! s:NetBrowse(islocal,dirname)
" handle g:netrw_keepdir: set vim's current directory to netrw's notion of the current directory {{{3 " handle g:netrw_keepdir: set vim's current directory to netrw's notion of the current directory {{{3
if !g:netrw_keepdir if !g:netrw_keepdir
" call Decho("handle keepdir:") " call Decho("handle keepdir: (g:netrw_keepdir=".g:netrw_keepdir.")")
" call Decho('exe cd '.escape(b:netrw_curdir,s:netrw_cd_escape)) " call Decho('exe cd '.escape(b:netrw_curdir,s:netrw_cd_escape))
try try
exe 'cd '.escape(b:netrw_curdir,s:netrw_cd_escape) exe 'cd '.escape(b:netrw_curdir,s:netrw_cd_escape)
@ -1839,17 +1850,18 @@ fun! s:NetGetBuffer(islocal,dirname)
else else
" find buffer number of buffer named precisely the same as dirname {{{3 " find buffer number of buffer named precisely the same as dirname {{{3
" call Dredir("ls!")
let dirname= a:dirname let dirname= a:dirname
" call Decho("find buffer<".dirname.">'s number ") " call Decho("find buffer<".dirname.">'s number ")
let bufnum= bufnr(escape(dirname,'\')) let bufnum= bufnr(escape(dirname,'\'))
" call Decho("findbuf: bufnum=bufnr('".escape(dirname,'\')."')=".bufnum." (initial)") " call Decho("findbuf1: bufnum=bufnr('".escape(dirname,'\')."')=".bufnum." (initial)")
let ibuf= 1 let ibuf= 1
if bufnum > 0 && bufname(bufnum) != dirname if bufnum > 0 && bufname(bufnum) != dirname
let buflast = bufnr("$") let buflast = bufnr("$")
" call Decho("findbuf: buflast=".buflast) " call Decho("findbuf2: buflast=".buflast)
while ibuf <= buflast while ibuf <= buflast
let bname= bufname(ibuf) let bname= bufname(ibuf)
" call Decho("findbuf: ibuf=".ibuf. " bufname<".bufname(ibuf)."> dirname<".dirname.">") " call Decho("findbuf3: dirname<".dirname."> bufname(".ibuf.")<".bname.">")
if bname != '' && bname !~ '/' && dirname =~ '/'.bname.'$' | break | endif if bname != '' && bname !~ '/' && dirname =~ '/'.bname.'$' | break | endif
if bname =~ '^'.dirname.'\=$' | break | endif if bname =~ '^'.dirname.'\=$' | break | endif
let ibuf= ibuf + 1 let ibuf= ibuf + 1
@ -1859,7 +1871,7 @@ fun! s:NetGetBuffer(islocal,dirname)
else else
let bufnum= ibuf let bufnum= ibuf
endif endif
" call Decho("findbuf: bufnum=".bufnum." (final)") " call Decho("findbuf4: bufnum=".bufnum)
endif endif
endif endif
@ -1871,11 +1883,16 @@ fun! s:NetGetBuffer(islocal,dirname)
call s:NetrwSafeOptions() call s:NetrwSafeOptions()
" name the buffer " name the buffer
if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST
" call Decho('silent! keepalt file NetrwTreeListing')
silent! keepalt file NetrwTreeListing silent! keepalt file NetrwTreeListing
else else
exe 'silent! keepalt file '.escape(dirname,s:netrw_cd_escape) " call Decho('exe silent! keepalt file '.escape(dirname,s:netrw_cd_escape))
" let v:errmsg= "" " Decho
let escdirname= escape(dirname,s:netrw_cd_escape)
exe 'silent! keepalt file '.escdirname
" call Decho("errmsg<".v:errmsg."> bufnr(".escdirname.")=".bufnr(escdirname)."<".bufname(bufnr(escdirname)).">")
endif endif
" call Decho("named enew buffer<".expand("%").">") " call Decho("named enew buffer#".bufnr("%")."<".bufname("%").">")
else " Re-use the buffer else " Re-use the buffer
@ -1947,7 +1964,7 @@ endfun
" --------------------------------------------------------------------- " ---------------------------------------------------------------------
" s:PerformListing: {{{2 " s:PerformListing: {{{2
fun! s:PerformListing(islocal) fun! s:PerformListing(islocal)
" call Dfunc("s:PerformListing(islocal=".a:islocal.")") " call Dfunc("s:PerformListing(islocal=".a:islocal.") buf(%)=".bufnr("%")."<".bufname("%").">")
" if exists("g:netrw_silent") && g:netrw_silent == 0 && &ch >= 1 " Decho " if exists("g:netrw_silent") && g:netrw_silent == 0 && &ch >= 1 " Decho
" call Decho("(netrw) Processing your browsing request...") " call Decho("(netrw) Processing your browsing request...")
@ -1956,7 +1973,7 @@ fun! s:PerformListing(islocal)
" call Decho('w:netrw_liststyle='.(exists("w:netrw_liststyle")? w:netrw_liststyle : 'n/a')) " call Decho('w:netrw_liststyle='.(exists("w:netrw_liststyle")? w:netrw_liststyle : 'n/a'))
if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("w:netrw_treedict") if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("w:netrw_treedict")
" force a refresh for tree listings " force a refresh for tree listings
" call Decho("clear buffer<".expand("%")."> with :%d") " call Decho("force refresh for treelisting: clear buffer<".expand("%")."> with :%d")
setlocal ma noro setlocal ma noro
keepjumps %d keepjumps %d
endif endif
@ -3248,7 +3265,7 @@ endfun
" NetTreeDir: determine tree directory given current cursor position {{{2 " NetTreeDir: determine tree directory given current cursor position {{{2
" (full path directory with trailing slash returned) " (full path directory with trailing slash returned)
fun! s:NetTreeDir() fun! s:NetTreeDir()
" call Dfunc("NetTreeDir() curline#".line(".")."<".getline(".")."> b:netrw_curdir<".b:netrw_curdir."> tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")) " call Dfunc("NetTreeDir() curline#".line(".")."<".getline(".")."> b:netrw_curdir<".b:netrw_curdir."> tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%").">")
let treedir= b:netrw_curdir let treedir= b:netrw_curdir
" call Decho("set initial treedir<".treedir.">") " call Decho("set initial treedir<".treedir.">")
@ -3848,7 +3865,7 @@ fun! netrw#NetObtain(vismode,...) range
let path = substitute(curdir,'scp://[^/]\+/','','e') let path = substitute(curdir,'scp://[^/]\+/','','e')
" call Decho("path<".path.">") " call Decho("path<".path.">")
if exists("g:netrw_port") && g:netrw_port != "" if exists("g:netrw_port") && g:netrw_port != ""
let useport= " -P ".g:netrw_port let useport= " ".g:netrw_scpport." ".g:netrw_port
else else
let useport= "" let useport= ""
endif endif
@ -4056,7 +4073,7 @@ endfun
" --------------------------------------------------------------------- " ---------------------------------------------------------------------
" LocalListing: does the job of "ls" for local directories {{{2 " LocalListing: does the job of "ls" for local directories {{{2
fun! s:LocalListing() fun! s:LocalListing()
" call Dfunc("LocalListing() &ma=".&ma." &mod=".&mod." &ro=".&ro) " call Dfunc("LocalListing() &ma=".&ma." &mod=".&mod." &ro=".&ro." buf(%)=".buf("%"))
" if exists("b:netrw_curdir") |call Decho('b:netrw_curdir<'.b:netrw_curdir.">") |else|call Decho("b:netrw_curdir doesn't exist") |endif " if exists("b:netrw_curdir") |call Decho('b:netrw_curdir<'.b:netrw_curdir.">") |else|call Decho("b:netrw_curdir doesn't exist") |endif
" if exists("g:netrw_sort_by")|call Decho('g:netrw_sort_by<'.g:netrw_sort_by.">")|else|call Decho("g:netrw_sort_by doesn't exist")|endif " if exists("g:netrw_sort_by")|call Decho('g:netrw_sort_by<'.g:netrw_sort_by.">")|else|call Decho("g:netrw_sort_by doesn't exist")|endif
@ -4438,9 +4455,10 @@ endfun
" dosplit==1: the window will be split before running the local " dosplit==1: the window will be split before running the local
" browser " browser
fun! netrw#Explore(indx,dosplit,style,...) fun! netrw#Explore(indx,dosplit,style,...)
" call Dfunc("netrw#Explore(indx=".a:indx." dosplit=".a:dosplit." style=".a:style.",a:1<".a:1.">) &modified=".&modified) " call Dfunc("netrw#Explore(indx=".a:indx." dosplit=".a:dosplit." style=".a:style.",a:1<".a:1.">) &modified=".&modified." a:0=".a:0)
if !exists("b:netrw_curdir") if !exists("b:netrw_curdir")
let b:netrw_curdir= getcwd() let b:netrw_curdir= getcwd()
" call Decho("set b:netrw_curdir<".b:netrw_curdir."> (used getcwd)")
endif endif
let curfile= b:netrw_curdir let curfile= b:netrw_curdir
" call Decho("curfile<".curfile.">") " call Decho("curfile<".curfile.">")
@ -4489,6 +4507,7 @@ fun! netrw#Explore(indx,dosplit,style,...)
endif endif
norm! 0 norm! 0
if a:0 > 0
" call Decho("a:1<".a:1.">") " call Decho("a:1<".a:1.">")
if a:1 =~ '^\~' && (has("unix") || (exists("g:netrw_cygwin") && g:netrw_cygwin)) if a:1 =~ '^\~' && (has("unix") || (exists("g:netrw_cygwin") && g:netrw_cygwin))
let dirname= substitute(a:1,'\~',expand("$HOME"),'') let dirname= substitute(a:1,'\~',expand("$HOME"),'')
@ -4499,10 +4518,13 @@ fun! netrw#Explore(indx,dosplit,style,...)
let dirname= dirname."/" let dirname= dirname."/"
endif endif
" call Decho("using dirname<".dirname."> (case: ".(exists("b:netrw_curdir")? "b:netrw_curdir" : "getcwd()").")") " call Decho("using dirname<".dirname."> (case: ".(exists("b:netrw_curdir")? "b:netrw_curdir" : "getcwd()").")")
elseif a:1 =~ '\$'
let dirname= expand(a:1)
else else
let dirname= a:1 let dirname= a:1
" call Decho("using dirname<".dirname.">") " call Decho("using dirname<".dirname.">")
endif endif
endif
if dirname =~ '^\*/' if dirname =~ '^\*/'
" Explore */pattern " Explore */pattern
@ -4919,33 +4941,61 @@ endfun
" 2=error = s:ERROR " 2=error = s:ERROR
" Mar 19, 2007 : max errnum currently is 49 " Mar 19, 2007 : max errnum currently is 49
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.")") " call Dfunc("netrw#ErrorMsg(level=".a:level." msg<".a:msg."> errnum=".a:errnum.") g:netrw_use_errorwindow=".g:netrw_use_errorwindow)
if a:level == 1
let level= "**warning** (netrw) "
elseif a:level == 2
let level= "**error** (netrw) "
else
let level= "**note** (netrw) "
endif
if g:netrw_use_errorwindow
" (default) netrw creates a one-line window to show error/warning
" messages (reliably displayed)
" record current window number for NetRestorePosn()'s benefit " record current window number for NetRestorePosn()'s benefit
let s:winBeforeErr= winnr() let s:winBeforeErr= winnr()
" getting messages out reliably is just plain difficult! " getting messages out reliably is just plain difficult!
" This attempt splits the current window, creating a one line window. " This attempt splits the current window, creating a one line window.
let errbufnum= bufnr("NetrwMessage") if bufexists("NetrwMessage") && bufwinnr("NetrwMessage") > 0
exe bufwinnr("NetrwMessage")."wincmd w"
set ma noro
call setline(line("$")+1,level.a:msg)
$
else
bo 1split bo 1split
enew enew
setlocal bt=nofile setlocal bt=nofile
file NetrwMessage file NetrwMessage
call setline(line("$"),level.a:msg)
put ='***netrw*** '.a:msg endif
if &fo !~ '[ta]' if &fo !~ '[ta]'
syn clear syn clear
syn match netrwMesg "^\*\*\*netrw\*\*\*" syn match netrwMesgNote "^\*\*note\*\*"
if a:level == s:WARNING syn match netrwMesgWarning "^\*\*warning\*\*"
hi link netrwMesg WarningMsg syn match netrwMesgError "^\*\*error\*\*"
elseif a:level == s:ERROR hi link netrwMesgWarning WarningMsg
hi link netrwMesg Error hi link netrwMesgError Error
endif endif
endif
1d
setlocal noma ro bh=wipe setlocal noma ro bh=wipe
else
" (optional) netrw will show messages using echomsg. Even if the
" message doesn't appear, at least it'll be recallable via :messages
redraw!
if a:level == s:WARNING
echohl WarningMsg
elseif a:level == s:ERROR
echohl Error
endif
echomsg level.a:msg
" call Decho("echomsg ***netrw*** ".a:msg)
echohl None
endif
" call Dret("netrw#ErrorMsg") " call Dret("netrw#ErrorMsg")
endfun endfun
@ -5045,9 +5095,9 @@ fun! s:MakeSshCmd(sshcmd)
" call Dfunc("s:MakeSshCmd(sshcmd<".a:sshcmd.">)") " call Dfunc("s:MakeSshCmd(sshcmd<".a:sshcmd.">)")
let sshcmd = substitute(a:sshcmd,'\<HOSTNAME\>',s:user.s:machine,'') let sshcmd = substitute(a:sshcmd,'\<HOSTNAME\>',s:user.s:machine,'')
if exists("g:netrw_port") && g:netrw_port != "" if exists("g:netrw_port") && g:netrw_port != ""
let sshcmd= substitute(sshcmd,"USEPORT",'-P '.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 != ""
let sshcmd= substitute(sshcmd,"USEPORT",'-P '.s:port,'') let sshcmd= substitute(sshcmd,"USEPORT",g:netrw_sshport.' '.s:port,'')
else else
let sshcmd= substitute(sshcmd,"USEPORT ",'','') let sshcmd= substitute(sshcmd,"USEPORT ",'','')
endif endif
@ -5058,7 +5108,7 @@ endfun
" --------------------------------------------------------------------- " ---------------------------------------------------------------------
" s:NetrwEnew: opens a new buffer, passes netrw buffer variables through {{{2 " s:NetrwEnew: opens a new buffer, passes netrw buffer variables through {{{2
fun! s:NetrwEnew(curdir) fun! s:NetrwEnew(curdir)
" call Dfunc("s:NetrwEnew(curdir<".a:curdir.">) expand(%)<".expand("%").">") " call Dfunc("s:NetrwEnew(curdir<".a:curdir.">) buf#".bufnr("%")."<".bufname("%").">")
" grab a function-local copy of buffer variables " grab a function-local copy of buffer variables
if exists("b:netrw_bannercnt") |let netrw_bannercnt = b:netrw_bannercnt |endif if exists("b:netrw_bannercnt") |let netrw_bannercnt = b:netrw_bannercnt |endif
@ -5113,7 +5163,7 @@ fun! s:NetrwEnew(curdir)
endif endif
endif endif
" call Dret("s:NetrwEnew : buf#".bufnr("%")) " call Dret("s:NetrwEnew : buf#".bufnr("%")."<".bufname("%").">")
endfun endfun
" ------------------------------------------------------------------------ " ------------------------------------------------------------------------

View File

@ -1,4 +1,4 @@
*change.txt* For Vim version 7.1a. Last change: 2007 Jan 07 *change.txt* For Vim version 7.1b. Last change: 2007 Jan 07
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar

View File

@ -1,4 +1,4 @@
*mbyte.txt* For Vim version 7.1a. Last change: 2006 Aug 11 *mbyte.txt* For Vim version 7.1b. Last change: 2006 Aug 11
VIM REFERENCE MANUAL by Bram Moolenaar et al. VIM REFERENCE MANUAL by Bram Moolenaar et al.

View File

@ -1,4 +1,4 @@
*pi_netrw.txt* For Vim version 7.1a. Last change: 2007 May 05 *pi_netrw.txt* For Vim version 7.1b. Last change: 2007 May 08
----------------------------------------------------- -----------------------------------------------------
NETRW REFERENCE MANUAL by Charles E. Campbell, Jr. NETRW REFERENCE MANUAL by Charles E. Campbell, Jr.
@ -195,10 +195,16 @@ DIRECTORY LISTING *netrw-dirlist*
*netrw-login* *netrw-password* *netrw-login* *netrw-password*
CHANGING USERID AND PASSWORD *netrw-chgup* *netrw-userpass* CHANGING USERID AND PASSWORD *netrw-chgup* *netrw-userpass*
Attempts to use ftp will prompt you for a user-id and a password. Attempts to use ftp will prompt you for a user-id and a password.
These will be saved in g:netrw_uid and g:netrw_passwd Subsequent uses These will be saved in global variables g:netrw_uid and
of ftp will re-use those. If you need to use a different user id g:netrw_passwd; subsequent uses of ftp will re-use those two items to
and/or password, you'll want to call NetUserPass() first. simplify the further use of ftp. However, if you need to use a
different user id and/or password, you'll want to call NetUserPass()
first. To work around the need to enter passwords, check if your ftp
supports a <.netrc> file in your home directory. Also see
|netrw-passwd| (and if you're using ssh/scp hoping to figure out how
to not need to use passwords, look at |netrw-listhack|).
:NetUserPass [uid [password]] -- prompts as needed :NetUserPass [uid [password]] -- prompts as needed
:call NetUserPass() -- prompts for uid and password :call NetUserPass() -- prompts for uid and password
@ -207,7 +213,7 @@ DIRECTORY LISTING *netrw-dirlist*
VARIABLES *netrw-variables* VARIABLES *netrw-variables*
(see also: |netrw-browse-var| |netrw-protocol| |netrw-settings| |netrw-var|) (also see: |netrw-browse-var| |netrw-protocol| |netrw-settings| |netrw-var|)
*b:netrw_lastfile* last file Network-read/written retained on a per-buffer *b:netrw_lastfile* last file Network-read/written retained on a per-buffer
basis (supports plain :Nw ) basis (supports plain :Nw )
@ -249,6 +255,16 @@ VARIABLES *netrw-variables*
Controls the quoting character used during scp and ftp Controls the quoting character used during scp and ftp
commands. commands.
*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_use_errorwindow* =1 : messages from netrw will use a separate one
line window. This window provides reliable
delivery of messages. (default)
=0 : messages from netrw will use echoerr ;
messages don't always seem to show up this
way, but one doesn't have to quit the window.
*g:netrw_win95ftp* =1 if using Win95, will remove four trailing blank *g:netrw_win95ftp* =1 if using Win95, will remove four trailing blank
lines that o/s's ftp "provides" on transfers lines that o/s's ftp "provides" on transfers
=0 force normal ftp behavior (no trailing line removal) =0 force normal ftp behavior (no trailing line removal)
@ -518,8 +534,8 @@ below, a {netfile} is an url to a remote file.
The <netrw.vim> script provides several variables which act as options to The <netrw.vim> script provides several variables which act as options to
ffect <netrw.vim>'s behavior. These variables typically may be set in the ffect <netrw.vim>'s behavior. These variables typically may be set in the
user's <.vimrc> file: user's <.vimrc> file:
(see also: |netrw-settings| |netrw-browse-var| |netrw-protocol| (also see:
|netrw-settings|) > |netrw-settings| |netrw-browse-var| |netrw-protocol| |netrw-settings|) >
------------- -------------
Netrw Options Netrw Options
@ -1463,8 +1479,8 @@ Especially with the remote directory browser, constantly entering the password
is tedious. is tedious.
For Linux/Unix systems, the book "Linux Server Hacks - 100 industrial strength For Linux/Unix systems, the book "Linux Server Hacks - 100 industrial strength
tips & tools" by Rob Flickenger (O'Reilly, ISBN 0-596-00461-3), gives a tip tips & tools" by Rob Flickenger (O'Reilly, ISBN 0-596-00461-3) gives a tip
for setting up no-password ssh and scp, plus discusses associated security for setting up no-password ssh and scp and discusses associated security
issues. It used to be available at http://hacks.oreilly.com/pub/h/66 , issues. It used to be available at http://hacks.oreilly.com/pub/h/66 ,
but apparently that address is now being redirected to some "hackzine". but apparently that address is now being redirected to some "hackzine".
I'll attempt a summary: I'll attempt a summary:
@ -1496,7 +1512,7 @@ settings. You may change any of their values; when you save the file, the
settings therein will be used. One may also press "?" on any of the lines for settings therein will be used. One may also press "?" on any of the lines for
help on what each of the variables do. help on what each of the variables do.
(see also: |netrw-browse-var| |netrw-protocol| |netrw-var| |netrw-variables|) (also see: |netrw-browse-var| |netrw-protocol| |netrw-var| |netrw-variables|)
============================================================================== ==============================================================================
@ -1729,6 +1745,16 @@ which is loaded automatically at startup (assuming :set nocp).
============================================================================== ==============================================================================
12. History *netrw-history* {{{1 12. History *netrw-history* {{{1
v109: Mar 26, 2007 * if a directory name includes a "$" character,
Explore() will use expand() in an attempt to
decipher the name.
May 07, 2007 * g:netrw_use_errorwindow now allows one to
have error messages go to a reliable window
or to use a less reliable but recallable
echoerr method
May 07, 2007 * g:netrw_scpport and g:netrw_sshport support
use of -P and -p, respectively, to set port
for scp/ssh.
v108: Jan 03, 2007 * included preview map (|netrw-p|), supporting v108: Jan 03, 2007 * included preview map (|netrw-p|), supporting
remote browsing remote browsing
* netrw can now source remote files * netrw can now source remote files
@ -1739,7 +1765,7 @@ which is loaded automatically at startup (assuming :set nocp).
(list, remove/delete, rename) (list, remove/delete, rename)
Jan 31, 2007 * Luis Florit reported that @* was an invalid Jan 31, 2007 * Luis Florit reported that @* was an invalid
register. The @* register is now only saved and register. The @* register is now only saved and
restored if 'guioptions' contains "a". restored if |'guioptions'| contains "a".
Feb 02, 2007 * Fixed a bug that cropped up when writing files Feb 02, 2007 * Fixed a bug that cropped up when writing files
via scp using cygwin via scp using cygwin
Feb 08, 2007 * tree listing mode managed to stop working again; Feb 08, 2007 * tree listing mode managed to stop working again;
@ -1836,7 +1862,7 @@ which is loaded automatically at startup (assuming :set nocp).
was preventing use of the "x" key with browsing. was preventing use of the "x" key with browsing.
Jun 05, 2006 * g:netrw_nogx available to prevent making the gx Jun 05, 2006 * g:netrw_nogx available to prevent making the gx
map (see |g:netrw_nogx|) map (see |g:netrw_nogx|)
* bugfix, Explore woulnd't change directory * bugfix, Explore wouldn't change directory
properly (vim ., :Explore subdirname) properly (vim ., :Explore subdirname)
Jun 06, 2006 * moved history to 2nd line in Netrw menu Jun 06, 2006 * moved history to 2nd line in Netrw menu
* fixed delete for unix-based systems * fixed delete for unix-based systems
@ -1857,7 +1883,7 @@ which is loaded automatically at startup (assuming :set nocp).
now bypassed only when it is now bypassed only when it is
v95: * bugfix - Hiding mode worked correctly (don't show any file v95: * bugfix - Hiding mode worked correctly (don't show any file
matching any of the g:netrw_hide patterns), but matching any of the g:netrw_hide patterns), but
but showing mode was showing only those files that didn't showing mode was showing only those files that didn't
match any of the g:netrw_hide patterns. Instead, it now match any of the g:netrw_hide patterns. Instead, it now
shows all files that match any of the g:netrw_hide patterns shows all files that match any of the g:netrw_hide patterns
(the difference between a logical and and logical or). (the difference between a logical and and logical or).
@ -1892,7 +1918,7 @@ which is loaded automatically at startup (assuming :set nocp).
v81: * FocusGained also used to refresh/wipe local browser directory v81: * FocusGained also used to refresh/wipe local browser directory
buffers buffers
* (bugfix) netrw was leaving [Scratch] buffers behind when the * (bugfix) netrw was leaving [Scratch] buffers behind when the
the user had the "hidden" option set. The 'hidden' option is user had the "hidden" option set. The 'hidden' option is
now bypassed. now bypassed.
v80: * ShellCmdPost event used in conjunction with g:netrw_fastbrowse v80: * ShellCmdPost event used in conjunction with g:netrw_fastbrowse
to refresh/wipe local browser directory buffers. to refresh/wipe local browser directory buffers.

View File

@ -1,4 +1,4 @@
*usr_toc.txt* For Vim version 7.1a. Last change: 2006 Apr 24 *usr_toc.txt* For Vim version 7.1b. Last change: 2006 Apr 24
VIM USER MANUAL - by Bram Moolenaar VIM USER MANUAL - by Bram Moolenaar

View File

@ -1,7 +1,7 @@
" Vim indent file " Vim indent file
" Language: xinetd.conf(5) configuration file " Language: xinetd.conf(5) configuration file
" Maintainer: Nikolai Weibull <now@bitwi.se> " Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2006-04-19 " Latest Revision: 2006-12-20
if exists("b:did_indent") if exists("b:did_indent")
finish finish
@ -10,6 +10,7 @@ let b:did_indent = 1
setlocal indentexpr=GetXinetdIndent() setlocal indentexpr=GetXinetdIndent()
setlocal indentkeys=0{,0},!^F,o,O setlocal indentkeys=0{,0},!^F,o,O
setlocal nosmartindent
if exists("*GetXinetdIndent") if exists("*GetXinetdIndent")
finish finish

View File

@ -72,7 +72,7 @@ getviscol2(col, coladd)
} }
/* /*
* Go to column "wcol", and add/insert white space as neccessary to get the * Go to column "wcol", and add/insert white space as necessary to get the
* cursor in that column. * cursor in that column.
* The caller must have saved the cursor line for undo! * The caller must have saved the cursor line for undo!
*/ */
@ -137,7 +137,7 @@ getvpos(pos, wcol)
coladvance2(pos, addspaces, finetune, wcol) coladvance2(pos, addspaces, finetune, wcol)
pos_T *pos; pos_T *pos;
int addspaces; /* change the text to achieve our goal? */ int addspaces; /* change the text to achieve our goal? */
int finetune; /* change char offset for the excact column */ int finetune; /* change char offset for the exact column */
colnr_T wcol; /* column to move to */ colnr_T wcol; /* column to move to */
{ {
#endif #endif
@ -1994,7 +1994,7 @@ static struct modmasktable
/* /*
* Shifted key terminal codes and their unshifted equivalent. * Shifted key terminal codes and their unshifted equivalent.
* Don't add mouse codes here, they are handled seperately! * Don't add mouse codes here, they are handled separately!
*/ */
#define MOD_KEYS_ENTRY_SIZE 5 #define MOD_KEYS_ENTRY_SIZE 5
@ -2825,7 +2825,7 @@ get_pseudo_mouse_code(button, is_click, is_drag)
#endif #endif
return mouse_table[i].pseudo_code; return mouse_table[i].pseudo_code;
} }
return (int)KE_IGNORE; /* not recongnized, ignore it */ return (int)KE_IGNORE; /* not recognized, ignore it */
} }
#endif /* FEAT_MOUSE */ #endif /* FEAT_MOUSE */
@ -3538,7 +3538,7 @@ update_mouseshape(shape_idx)
#ifdef FEAT_CRYPT #ifdef FEAT_CRYPT
/* /*
* Optional encryption suypport. * Optional encryption support.
* Mohsin Ahmed, mosh@sasi.com, 98-09-24 * Mohsin Ahmed, mosh@sasi.com, 98-09-24
* Based on zip/crypt sources. * Based on zip/crypt sources.
* *
@ -3799,7 +3799,7 @@ typedef struct ff_visited
/* /*
* We might have to manage several visited lists during a search. * We might have to manage several visited lists during a search.
* This is expecially needed for the tags option. If tags is set to: * This is especially needed for the tags option. If tags is set to:
* "./++/tags,./++/TAGS,++/tags" (replace + with *) * "./++/tags,./++/TAGS,++/tags" (replace + with *)
* So we have to do 3 searches: * So we have to do 3 searches:
* 1) search from the current files directory downward for the file "tags" * 1) search from the current files directory downward for the file "tags"
@ -3825,7 +3825,7 @@ typedef struct ff_visited_list_hdr
/* /*
* '**' can be expanded to several directory levels. * '**' can be expanded to several directory levels.
* Set the default maximium depth. * Set the default maximum depth.
*/ */
#define FF_MAX_STAR_STAR_EXPAND ((char_u)30) #define FF_MAX_STAR_STAR_EXPAND ((char_u)30)
/* /*
@ -4174,7 +4174,7 @@ vim_findfile_init(path, filename, stopdirs, level, free_visited, need_dir,
/* /*
* copy wc_path and add restricts to the '**' wildcard. * copy wc_path and add restricts to the '**' wildcard.
* The octett after a '**' is used as a (binary) counter. * The octet after a '**' is used as a (binary) counter.
* So '**3' is transposed to '**^C' ('^C' is ASCII value 3) * So '**3' is transposed to '**^C' ('^C' is ASCII value 3)
* or '**76' is transposed to '**N'( 'N' is ASCII value 76). * or '**76' is transposed to '**N'( 'N' is ASCII value 76).
* For EBCDIC you get different character values. * For EBCDIC you get different character values.
@ -4507,7 +4507,7 @@ vim_findfile(search_ctx)
/* /*
* Here we copy until the next path separator or the end of * Here we copy until the next path separator or the end of
* the path. If we stop at a path separator, there is * the path. If we stop at a path separator, there is
* still somthing else left. This is handled below by * still something else left. This is handled below by
* pushing every directory returned from expand_wildcards() * pushing every directory returned from expand_wildcards()
* on the stack again for further search. * on the stack again for further search.
*/ */

View File

@ -128,7 +128,7 @@
* | +---------------------------+ | * | +---------------------------+ |
* +------------------------------------------------------+ * +------------------------------------------------------+
* *
* They all start with a BRANCH for "\|" alternaties, even when there is only * They all start with a BRANCH for "\|" alternatives, even when there is only
* one alternative. * one alternative.
*/ */
@ -3110,7 +3110,7 @@ static unsigned reg_tofreelen;
/* /*
* These variables are set when executing a regexp to speed up the execution. * These variables are set when executing a regexp to speed up the execution.
* Which ones are set depends on whethere a single-line or multi-line match is * Which ones are set depends on whether a single-line or multi-line match is
* done: * done:
* single-line multi-line * single-line multi-line
* reg_match &regmatch_T NULL * reg_match &regmatch_T NULL
@ -5038,7 +5038,7 @@ regmatch(scan)
reg_save(&(((regbehind_T *)rp) - 1)->save_after, &backpos); reg_save(&(((regbehind_T *)rp) - 1)->save_after, &backpos);
/* start looking for a match with operand at the current /* start looking for a match with operand at the current
* postion. Go back one character until we find the * position. Go back one character until we find the
* result, hitting the start of the line or the previous * result, hitting the start of the line or the previous
* line (for multi-line matching). * line (for multi-line matching).
* Set behind_pos to where the match should end, BHPOS * Set behind_pos to where the match should end, BHPOS
@ -6623,7 +6623,7 @@ regtilde(source, magic)
/* copy prefix */ /* copy prefix */
len = (int)(p - newsub); /* not including ~ */ len = (int)(p - newsub); /* not including ~ */
mch_memmove(tmpsub, newsub, (size_t)len); mch_memmove(tmpsub, newsub, (size_t)len);
/* interpretate tilde */ /* interpret tilde */
mch_memmove(tmpsub + len, reg_prev_sub, (size_t)prevlen); mch_memmove(tmpsub + len, reg_prev_sub, (size_t)prevlen);
/* copy postfix */ /* copy postfix */
if (!magic) if (!magic)
@ -6862,7 +6862,7 @@ vim_regsub_both(source, dest, copy, magic, backslash)
{ {
if (c == K_SPECIAL && src[0] != NUL && src[1] != NUL) if (c == K_SPECIAL && src[0] != NUL && src[1] != NUL)
{ {
/* Copy a specialy key as-is. */ /* Copy a special key as-is. */
if (copy) if (copy)
{ {
*dst++ = c; *dst++ = c;
@ -7046,7 +7046,7 @@ exit:
#ifdef FEAT_EVAL #ifdef FEAT_EVAL
/* /*
* Used for the submatch() function: get the string from tne n'th submatch in * Used for the submatch() function: get the string from the n'th submatch in
* allocated memory. * allocated memory.
* Returns NULL when not in a ":s" command and for a non-existing submatch. * Returns NULL when not in a ":s" command and for a non-existing submatch.
*/ */