| 
									
										
										
										
											2005-09-29 18:26:07 +00:00
										 |  |  | " netrwPlugin.vim: Handles file transfer and remote directory listing across a network | 
					
						
							| 
									
										
										
										
											2007-05-05 17:10:09 +00:00
										 |  |  | "            PLUGIN SECTION | 
					
						
							| 
									
										
										
										
											2021-08-29 21:55:35 +02:00
										 |  |  | " Date:		Feb 09, 2021 | 
					
						
							| 
									
										
										
										
											2020-01-09 21:46:04 +01:00
										 |  |  | " Maintainer:	Charles E Campbell <NcampObell@SdrPchip.AorgM-NOSPAM> | 
					
						
							| 
									
										
										
										
											2005-09-29 18:26:07 +00:00
										 |  |  | " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim | 
					
						
							| 
									
										
										
										
											2021-08-29 21:55:35 +02:00
										 |  |  | " Copyright:    Copyright (C) 1999-2021 Charles E. Campbell {{{1 | 
					
						
							| 
									
										
										
										
											2005-09-29 18:26:07 +00:00
										 |  |  | "               Permission is hereby granted to use and distribute this code, | 
					
						
							|  |  |  | "               with or without modifications, provided that this copyright | 
					
						
							|  |  |  | "               notice is copied with it. Like anything else that's free, | 
					
						
							|  |  |  | "               netrw.vim, netrwPlugin.vim, and netrwSettings.vim are provided | 
					
						
							|  |  |  | "               *as is* and comes with no warranty of any kind, either | 
					
						
							|  |  |  | "               expressed or implied. By using this plugin, you agree that | 
					
						
							|  |  |  | "               in no event will the copyright holder be liable for any damages | 
					
						
							|  |  |  | "               resulting from the use of this software. | 
					
						
							|  |  |  | " | 
					
						
							|  |  |  | "  But be doers of the Word, and not only hearers, deluding your own selves {{{1 | 
					
						
							|  |  |  | "  (James 1:22 RSV) | 
					
						
							|  |  |  | " =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- | 
					
						
							|  |  |  | " Load Once: {{{1 | 
					
						
							| 
									
										
										
										
											2007-05-05 17:10:09 +00:00
										 |  |  | if &cp || exists("g:loaded_netrwPlugin") | 
					
						
							| 
									
										
										
										
											2005-09-29 18:26:07 +00:00
										 |  |  |  finish | 
					
						
							|  |  |  | endif | 
					
						
							| 
									
										
										
										
											2021-08-29 21:55:35 +02:00
										 |  |  | let g:loaded_netrwPlugin = "v171" | 
					
						
							| 
									
										
										
										
											2010-01-06 20:54:52 +01:00
										 |  |  | let s:keepcpo = &cpo | 
					
						
							| 
									
										
										
										
											2005-09-29 18:26:07 +00:00
										 |  |  | set cpo&vim | 
					
						
							| 
									
										
										
										
											2014-01-23 14:24:41 +01:00
										 |  |  | "DechoRemOn | 
					
						
							| 
									
										
										
										
											2005-09-29 18:26:07 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " --------------------------------------------------------------------- | 
					
						
							|  |  |  | " Public Interface: {{{1 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-01-23 14:24:41 +01:00
										 |  |  | " Local Browsing Autocmds: {{{2 | 
					
						
							| 
									
										
										
										
											2005-09-29 18:26:07 +00:00
										 |  |  | augroup FileExplorer | 
					
						
							|  |  |  |  au! | 
					
						
							| 
									
										
										
										
											2014-03-22 21:02:50 +01:00
										 |  |  |  au BufLeave *  if &ft != "netrw"|let w:netrw_prvfile= expand("%:p")|endif | 
					
						
							| 
									
										
										
										
											2014-01-23 14:24:41 +01:00
										 |  |  |  au BufEnter *	sil call s:LocalBrowse(expand("<amatch>")) | 
					
						
							|  |  |  |  au VimEnter *	sil call s:VimEnter(expand("<amatch>")) | 
					
						
							| 
									
										
										
										
											2007-05-05 17:10:09 +00:00
										 |  |  |  if has("win32") || has("win95") || has("win64") || has("win16") | 
					
						
							| 
									
										
										
										
											2014-01-23 14:24:41 +01:00
										 |  |  |   au BufEnter .* sil call s:LocalBrowse(expand("<amatch>")) | 
					
						
							| 
									
										
										
										
											2007-05-05 17:10:09 +00:00
										 |  |  |  endif | 
					
						
							| 
									
										
										
										
											2005-09-29 18:26:07 +00:00
										 |  |  | augroup END | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Network Browsing Reading Writing: {{{2 | 
					
						
							|  |  |  | augroup Network | 
					
						
							|  |  |  |  au! | 
					
						
							| 
									
										
										
										
											2019-07-19 22:05:51 +02:00
										 |  |  |  au BufReadCmd   file://*											call netrw#FileUrlEdit(expand("<amatch>")) | 
					
						
							|  |  |  |  au BufReadCmd   ftp://*,rcp://*,scp://*,http://*,https://*,dav://*,davs://*,rsync://*,sftp://*	exe "sil doau BufReadPre ".fnameescape(expand("<amatch>"))|call netrw#Nread(2,expand("<amatch>"))|exe "sil doau BufReadPost ".fnameescape(expand("<amatch>")) | 
					
						
							| 
									
										
										
										
											2015-01-07 16:57:10 +01:00
										 |  |  |  au FileReadCmd  ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://*	exe "sil doau FileReadPre ".fnameescape(expand("<amatch>"))|call netrw#Nread(1,expand("<amatch>"))|exe "sil doau FileReadPost ".fnameescape(expand("<amatch>")) | 
					
						
							|  |  |  |  au BufWriteCmd  ftp://*,rcp://*,scp://*,http://*,file://*,dav://*,davs://*,rsync://*,sftp://*			exe "sil doau BufWritePre ".fnameescape(expand("<amatch>"))|exe 'Nwrite '.fnameescape(expand("<amatch>"))|exe "sil doau BufWritePost ".fnameescape(expand("<amatch>")) | 
					
						
							|  |  |  |  au FileWriteCmd ftp://*,rcp://*,scp://*,http://*,file://*,dav://*,davs://*,rsync://*,sftp://*			exe "sil doau FileWritePre ".fnameescape(expand("<amatch>"))|exe "'[,']".'Nwrite '.fnameescape(expand("<amatch>"))|exe "sil doau FileWritePost ".fnameescape(expand("<amatch>")) | 
					
						
							| 
									
										
										
										
											2019-09-20 14:38:13 +02:00
										 |  |  |  try | 
					
						
							| 
									
										
										
										
											2015-01-07 16:57:10 +01:00
										 |  |  |   au SourceCmd   ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://*	exe 'Nsource '.fnameescape(expand("<amatch>")) | 
					
						
							| 
									
										
										
										
											2019-09-20 14:38:13 +02:00
										 |  |  |  catch /^Vim\%((\a\+)\)\=:E216/ | 
					
						
							| 
									
										
										
										
											2015-01-07 16:57:10 +01:00
										 |  |  |   au SourcePre   ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://*	exe 'Nsource '.fnameescape(expand("<amatch>")) | 
					
						
							| 
									
										
										
										
											2007-05-05 17:10:09 +00:00
										 |  |  |  endtry | 
					
						
							| 
									
										
										
										
											2005-09-29 18:26:07 +00:00
										 |  |  | augroup END | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Commands: :Nread, :Nwrite, :NetUserPass {{{2 | 
					
						
							| 
									
										
										
										
											2016-02-20 15:47:01 +01:00
										 |  |  | com! -count=1 -nargs=*	Nread		let s:svpos= winsaveview()<bar>call netrw#NetRead(<count>,<f-args>)<bar>call winrestview(s:svpos) | 
					
						
							|  |  |  | com! -range=% -nargs=*	Nwrite		let s:svpos= winsaveview()<bar><line1>,<line2>call netrw#NetWrite(<f-args>)<bar>call winrestview(s:svpos) | 
					
						
							| 
									
										
										
										
											2005-09-29 18:26:07 +00:00
										 |  |  | com! -nargs=*		NetUserPass	call NetUserPass(<f-args>) | 
					
						
							| 
									
										
										
										
											2016-02-20 15:47:01 +01:00
										 |  |  | com! -nargs=*	        Nsource		let s:svpos= winsaveview()<bar>call netrw#NetSource(<f-args>)<bar>call winrestview(s:svpos) | 
					
						
							| 
									
										
										
										
											2019-07-19 22:05:51 +02:00
										 |  |  | com! -nargs=?		Ntree		call netrw#SetTreetop(1,<q-args>) | 
					
						
							| 
									
										
										
										
											2005-09-29 18:26:07 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-01-23 14:24:41 +01:00
										 |  |  | " Commands: :Explore, :Sexplore, Hexplore, Vexplore, Lexplore {{{2 | 
					
						
							| 
									
										
										
										
											2007-05-05 17:10:09 +00:00
										 |  |  | com! -nargs=* -bar -bang -count=0 -complete=dir	Explore		call netrw#Explore(<count>,0,0+<bang>0,<q-args>) | 
					
						
							|  |  |  | com! -nargs=* -bar -bang -count=0 -complete=dir	Sexplore	call netrw#Explore(<count>,1,0+<bang>0,<q-args>) | 
					
						
							|  |  |  | com! -nargs=* -bar -bang -count=0 -complete=dir	Hexplore	call netrw#Explore(<count>,1,2+<bang>0,<q-args>) | 
					
						
							|  |  |  | com! -nargs=* -bar -bang -count=0 -complete=dir	Vexplore	call netrw#Explore(<count>,1,4+<bang>0,<q-args>) | 
					
						
							|  |  |  | com! -nargs=* -bar       -count=0 -complete=dir	Texplore	call netrw#Explore(<count>,0,6        ,<q-args>) | 
					
						
							|  |  |  | com! -nargs=* -bar -bang			Nexplore	call netrw#Explore(-1,0,0,<q-args>) | 
					
						
							|  |  |  | com! -nargs=* -bar -bang			Pexplore	call netrw#Explore(-2,0,0,<q-args>) | 
					
						
							| 
									
										
										
										
											2015-01-07 16:57:10 +01:00
										 |  |  | com! -nargs=* -bar -bang -count=0 -complete=dir Lexplore	call netrw#Lexplore(<count>,<bang>0,<q-args>) | 
					
						
							| 
									
										
										
										
											2005-09-29 18:26:07 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Commands: NetrwSettings {{{2 | 
					
						
							| 
									
										
										
										
											2008-06-24 20:19:36 +00:00
										 |  |  | com! -nargs=0	NetrwSettings	call netrwSettings#NetrwSettings() | 
					
						
							| 
									
										
										
										
											2014-03-22 21:02:50 +01:00
										 |  |  | com! -bang	NetrwClean	call netrw#Clean(<bang>0) | 
					
						
							| 
									
										
										
										
											2005-09-29 18:26:07 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-02-01 21:47:16 +00:00
										 |  |  | " Maps: | 
					
						
							| 
									
										
										
										
											2015-01-07 16:57:10 +01:00
										 |  |  | if !exists("g:netrw_nogx") | 
					
						
							|  |  |  |  if maparg('gx','n') == "" | 
					
						
							|  |  |  |   if !hasmapto('<Plug>NetrwBrowseX') | 
					
						
							|  |  |  |    nmap <unique> gx <Plug>NetrwBrowseX | 
					
						
							|  |  |  |   endif | 
					
						
							| 
									
										
										
										
											2019-11-10 22:09:11 +01:00
										 |  |  |   nno <silent> <Plug>NetrwBrowseX :call netrw#BrowseX(netrw#GX(),netrw#CheckIfRemote(netrw#GX()))<cr> | 
					
						
							| 
									
										
										
										
											2015-01-07 16:57:10 +01:00
										 |  |  |  endif | 
					
						
							| 
									
										
										
										
											2021-08-29 21:55:35 +02:00
										 |  |  |  if maparg('gx','x') == "" | 
					
						
							| 
									
										
										
										
											2015-01-07 16:57:10 +01:00
										 |  |  |   if !hasmapto('<Plug>NetrwBrowseXVis') | 
					
						
							| 
									
										
										
										
											2021-08-29 21:55:35 +02:00
										 |  |  |    xmap <unique> gx <Plug>NetrwBrowseXVis | 
					
						
							| 
									
										
										
										
											2015-01-07 16:57:10 +01:00
										 |  |  |   endif | 
					
						
							| 
									
										
										
										
											2021-08-29 21:55:35 +02:00
										 |  |  |   xno <silent> <Plug>NetrwBrowseXVis :<c-u>call netrw#BrowseXVis()<cr> | 
					
						
							| 
									
										
										
										
											2007-05-05 17:10:09 +00:00
										 |  |  |  endif | 
					
						
							| 
									
										
										
										
											2006-02-01 21:47:16 +00:00
										 |  |  | endif | 
					
						
							| 
									
										
										
										
											2015-10-30 14:37:44 +01:00
										 |  |  | if exists("g:netrw_usetab") && g:netrw_usetab | 
					
						
							|  |  |  |  if maparg('<c-tab>','n') == "" | 
					
						
							|  |  |  |   nmap <unique> <c-tab> <Plug>NetrwShrink | 
					
						
							|  |  |  |  endif | 
					
						
							|  |  |  |  nno <silent> <Plug>NetrwShrink :call netrw#Shrink()<cr> | 
					
						
							|  |  |  | endif | 
					
						
							| 
									
										
										
										
											2006-02-01 21:47:16 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-09-29 18:26:07 +00:00
										 |  |  | " --------------------------------------------------------------------- | 
					
						
							| 
									
										
										
										
											2014-01-23 14:24:41 +01:00
										 |  |  | " LocalBrowse: invokes netrw#LocalBrowseCheck() on directory buffers {{{2 | 
					
						
							| 
									
										
										
										
											2005-09-29 18:26:07 +00:00
										 |  |  | fun! s:LocalBrowse(dirname) | 
					
						
							| 
									
										
										
										
											2014-01-23 14:24:41 +01:00
										 |  |  |   " Unfortunate interaction -- only DechoMsg debugging calls can be safely used here. | 
					
						
							|  |  |  |   " Otherwise, the BufEnter event gets triggered when attempts to write to | 
					
						
							| 
									
										
										
										
											2005-09-29 18:26:07 +00:00
										 |  |  |   " the DBG buffer are made. | 
					
						
							| 
									
										
										
										
											2019-09-20 14:38:13 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-05-21 21:01:10 +02:00
										 |  |  |   if !exists("s:vimentered") | 
					
						
							| 
									
										
										
										
											2014-01-23 14:24:41 +01:00
										 |  |  |    " If s:vimentered doesn't exist, then the VimEnter event hasn't fired.  It will, | 
					
						
							|  |  |  |    " and so s:VimEnter() will then be calling this routine, but this time with s:vimentered defined. | 
					
						
							|  |  |  | "   call Dfunc("s:LocalBrowse(dirname<".a:dirname.">)  (s:vimentered doesn't exist)") | 
					
						
							|  |  |  | "   call Dret("s:LocalBrowse") | 
					
						
							| 
									
										
										
										
											2013-05-21 21:01:10 +02:00
										 |  |  |    return | 
					
						
							|  |  |  |   endif | 
					
						
							| 
									
										
										
										
											2014-01-23 14:24:41 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | "  call Dfunc("s:LocalBrowse(dirname<".a:dirname.">)  (s:vimentered=".s:vimentered.")") | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-05 17:10:09 +00:00
										 |  |  |   if has("amiga") | 
					
						
							|  |  |  |    " The check against '' is made for the Amiga, where the empty | 
					
						
							|  |  |  |    " string is the current directory and not checking would break | 
					
						
							|  |  |  |    " things such as the help command. | 
					
						
							| 
									
										
										
										
											2014-01-23 14:24:41 +01:00
										 |  |  | "   call Decho("(LocalBrowse) dirname<".a:dirname.">  (isdirectory, amiga)") | 
					
						
							| 
									
										
										
										
											2007-05-05 17:10:09 +00:00
										 |  |  |    if a:dirname != '' && isdirectory(a:dirname) | 
					
						
							| 
									
										
										
										
											2011-04-01 18:03:16 +02:00
										 |  |  |     sil! call netrw#LocalBrowseCheck(a:dirname) | 
					
						
							| 
									
										
										
										
											2015-01-07 16:57:10 +01:00
										 |  |  |     if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt | 
					
						
							| 
									
										
										
										
											2014-03-22 21:02:50 +01:00
										 |  |  |      exe w:netrw_bannercnt | 
					
						
							|  |  |  |     endif | 
					
						
							| 
									
										
										
										
											2007-05-05 17:10:09 +00:00
										 |  |  |    endif | 
					
						
							| 
									
										
										
										
											2014-01-23 14:24:41 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-05-05 17:10:09 +00:00
										 |  |  |   elseif isdirectory(a:dirname) | 
					
						
							| 
									
										
										
										
											2014-03-22 21:02:50 +01:00
										 |  |  | "   call Decho("(LocalBrowse) dirname<".a:dirname."> ft=".&ft."  (isdirectory, not amiga)") | 
					
						
							|  |  |  | "   call Dredir("LocalBrowse ft last set: ","verbose set ft") | 
					
						
							| 
									
										
										
										
											2021-08-29 21:55:35 +02:00
										 |  |  |    " Jul 13, 2021: for whatever reason, preceding the following call with | 
					
						
							|  |  |  |    " a   sil!  causes an unbalanced if-endif vim error | 
					
						
							|  |  |  |    call netrw#LocalBrowseCheck(a:dirname) | 
					
						
							| 
									
										
										
										
											2015-01-07 16:57:10 +01:00
										 |  |  |    if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt | 
					
						
							| 
									
										
										
										
											2014-03-22 21:02:50 +01:00
										 |  |  |     exe w:netrw_bannercnt | 
					
						
							|  |  |  |    endif | 
					
						
							| 
									
										
										
										
											2014-01-23 14:24:41 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |   else | 
					
						
							|  |  |  |    " not a directory, ignore it | 
					
						
							|  |  |  | "   call Decho("(LocalBrowse) dirname<".a:dirname."> not a directory, ignoring...") | 
					
						
							| 
									
										
										
										
											2005-09-29 18:26:07 +00:00
										 |  |  |   endif | 
					
						
							| 
									
										
										
										
											2014-01-23 14:24:41 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | "  call Dret("s:LocalBrowse") | 
					
						
							| 
									
										
										
										
											2005-09-29 18:26:07 +00:00
										 |  |  | endfun | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-05-14 23:24:24 +02:00
										 |  |  | " --------------------------------------------------------------------- | 
					
						
							| 
									
										
										
										
											2014-01-23 14:24:41 +01:00
										 |  |  | " s:VimEnter: after all vim startup stuff is done, this function is called. {{{2 | 
					
						
							|  |  |  | "             Its purpose: to look over all windows and run s:LocalBrowse() on | 
					
						
							|  |  |  | "             them, which checks if they're directories and will create a directory | 
					
						
							|  |  |  | "             listing when appropriate. | 
					
						
							|  |  |  | "             It also sets s:vimentered, letting s:LocalBrowse() know that s:VimEnter() | 
					
						
							|  |  |  | "             has already been called. | 
					
						
							| 
									
										
										
										
											2010-05-14 23:24:24 +02:00
										 |  |  | fun! s:VimEnter(dirname) | 
					
						
							| 
									
										
										
										
											2014-01-23 14:24:41 +01:00
										 |  |  | "  call Dfunc("s:VimEnter(dirname<".a:dirname.">) expand(%)<".expand("%").">") | 
					
						
							| 
									
										
										
										
											2021-08-29 21:55:35 +02:00
										 |  |  |   if has('nvim') || v:version < 802 | 
					
						
							|  |  |  |   " Johann Höchtl: reported that the call range... line causes an E488: Trailing characters | 
					
						
							|  |  |  |   "                error with neovim. I suspect its because neovim hasn't updated with recent | 
					
						
							|  |  |  |   "                vim patches. As is, this code will have problems with popup terminals | 
					
						
							|  |  |  |   "                instantiated before the VimEnter event runs. | 
					
						
							|  |  |  |   " Ingo Karkat  : E488 also in Vim 8.1.1602 | 
					
						
							| 
									
										
										
										
											2013-05-21 21:01:10 +02:00
										 |  |  |   let curwin       = winnr() | 
					
						
							|  |  |  |   let s:vimentered = 1 | 
					
						
							| 
									
										
										
										
											2014-01-23 14:24:41 +01:00
										 |  |  |   windo call s:LocalBrowse(expand("%:p")) | 
					
						
							| 
									
										
										
										
											2010-07-28 18:17:41 +02:00
										 |  |  |   exe curwin."wincmd w" | 
					
						
							| 
									
										
										
										
											2021-08-29 21:55:35 +02:00
										 |  |  |  else | 
					
						
							|  |  |  |   " the following complicated expression comes courtesy of lacygoill; largely does the same thing as the windo and  | 
					
						
							|  |  |  |   " wincmd which are commented out, but avoids some side effects. Allows popup terminal before VimEnter. | 
					
						
							|  |  |  |   let s:vimentered = 1 | 
					
						
							|  |  |  |   call range(1, winnr('$'))->map({_, v -> win_execute(win_getid(v), 'call expand("%:p")->s:LocalBrowse()')}) | 
					
						
							|  |  |  |  endif | 
					
						
							| 
									
										
										
										
											2014-01-23 14:24:41 +01:00
										 |  |  | "  call Dret("s:VimEnter") | 
					
						
							| 
									
										
										
										
											2010-05-14 23:24:24 +02:00
										 |  |  | endfun | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-09-29 18:26:07 +00:00
										 |  |  | " --------------------------------------------------------------------- | 
					
						
							|  |  |  | " NetrwStatusLine: {{{1 | 
					
						
							|  |  |  | fun! NetrwStatusLine() | 
					
						
							| 
									
										
										
										
											2006-03-14 22:51:38 +00:00
										 |  |  | "  let g:stlmsg= "Xbufnr=".w:netrw_explore_bufnr." bufnr=".bufnr("%")." Xline#".w:netrw_explore_line." line#".line(".") | 
					
						
							|  |  |  |   if !exists("w:netrw_explore_bufnr") || w:netrw_explore_bufnr != bufnr("%") || !exists("w:netrw_explore_line") || w:netrw_explore_line != line(".") || !exists("w:netrw_explore_list") | 
					
						
							| 
									
										
										
										
											2005-09-29 18:26:07 +00:00
										 |  |  |    let &stl= s:netrw_explore_stl | 
					
						
							|  |  |  |    if exists("w:netrw_explore_bufnr")|unlet w:netrw_explore_bufnr|endif | 
					
						
							|  |  |  |    if exists("w:netrw_explore_line")|unlet w:netrw_explore_line|endif | 
					
						
							|  |  |  |    return "" | 
					
						
							|  |  |  |   else | 
					
						
							|  |  |  |    return "Match ".w:netrw_explore_mtchcnt." of ".w:netrw_explore_listlen | 
					
						
							|  |  |  |   endif | 
					
						
							|  |  |  | endfun | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " ------------------------------------------------------------------------ | 
					
						
							|  |  |  | " NetUserPass: set username and password for subsequent ftp transfer {{{1 | 
					
						
							|  |  |  | "   Usage:  :call NetUserPass()			-- will prompt for userid and password | 
					
						
							|  |  |  | "	    :call NetUserPass("uid")		-- will prompt for password | 
					
						
							|  |  |  | "	    :call NetUserPass("uid","password") -- sets global userid and password | 
					
						
							|  |  |  | fun! NetUserPass(...) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |  " get/set userid | 
					
						
							|  |  |  |  if a:0 == 0 | 
					
						
							|  |  |  | "  call Dfunc("NetUserPass(a:0<".a:0.">)") | 
					
						
							|  |  |  |   if !exists("g:netrw_uid") || g:netrw_uid == "" | 
					
						
							|  |  |  |    " via prompt | 
					
						
							|  |  |  |    let g:netrw_uid= input('Enter username: ') | 
					
						
							|  |  |  |   endif | 
					
						
							|  |  |  |  else	" from command line | 
					
						
							|  |  |  | "  call Dfunc("NetUserPass(a:1<".a:1.">) {") | 
					
						
							|  |  |  |   let g:netrw_uid= a:1 | 
					
						
							|  |  |  |  endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |  " get password | 
					
						
							|  |  |  |  if a:0 <= 1 " via prompt | 
					
						
							|  |  |  | "  call Decho("a:0=".a:0." case <=1:") | 
					
						
							|  |  |  |   let g:netrw_passwd= inputsecret("Enter Password: ") | 
					
						
							|  |  |  |  else " from command line | 
					
						
							|  |  |  | "  call Decho("a:0=".a:0." case >1: a:2<".a:2.">") | 
					
						
							|  |  |  |   let g:netrw_passwd=a:2 | 
					
						
							|  |  |  |  endif | 
					
						
							|  |  |  | "  call Dret("NetUserPass") | 
					
						
							|  |  |  | endfun | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " ------------------------------------------------------------------------ | 
					
						
							|  |  |  | " Modelines And Restoration: {{{1 | 
					
						
							|  |  |  | let &cpo= s:keepcpo | 
					
						
							|  |  |  | unlet s:keepcpo | 
					
						
							|  |  |  | " vim:ts=8 fdm=marker |