annotate runtime/plugin/netrwPlugin.vim @ 2420:6de9efd58dc0 vim73

Updated runtime files. New netrw plugin version.
author Bram Moolenaar <bram@vim.org>
date Tue, 27 Jul 2010 22:50:36 +0200
parents b9e314fe473f
children e52d87a2bb3e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
534
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
1 " netrwPlugin.vim: Handles file transfer and remote directory listing across a network
1118
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
2 " PLUGIN SECTION
2420
6de9efd58dc0 Updated runtime files. New netrw plugin version.
Bram Moolenaar <bram@vim.org>
parents: 2152
diff changeset
3 " Date: Jul 27, 2010
1118
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
4 " Maintainer: Charles E Campbell, Jr <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
534
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
5 " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1668
diff changeset
6 " Copyright: Copyright (C) 1999-2008 Charles E. Campbell, Jr. {{{1
534
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
7 " Permission is hereby granted to use and distribute this code,
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
8 " with or without modifications, provided that this copyright
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
9 " notice is copied with it. Like anything else that's free,
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
10 " netrw.vim, netrwPlugin.vim, and netrwSettings.vim are provided
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
11 " *as is* and comes with no warranty of any kind, either
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
12 " expressed or implied. By using this plugin, you agree that
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
13 " in no event will the copyright holder be liable for any damages
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
14 " resulting from the use of this software.
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
15 "
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
16 " But be doers of the Word, and not only hearers, deluding your own selves {{{1
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
17 " (James 1:22 RSV)
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
18 " =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
19 " Load Once: {{{1
1118
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
20 if &cp || exists("g:loaded_netrwPlugin")
534
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
21 finish
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
22 endif
2420
6de9efd58dc0 Updated runtime files. New netrw plugin version.
Bram Moolenaar <bram@vim.org>
parents: 2152
diff changeset
23 let g:loaded_netrwPlugin = "v139"
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1702
diff changeset
24 if v:version < 702
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1702
diff changeset
25 echohl WarningMsg | echo "***netrw*** you need vim version 7.2 for this version of netrw" | echohl None
553
249173daa651 updated for version 7.0157
vimboss
parents: 534
diff changeset
26 finish
249173daa651 updated for version 7.0157
vimboss
parents: 534
diff changeset
27 endif
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1702
diff changeset
28 let s:keepcpo = &cpo
534
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
29 set cpo&vim
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
30
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
31 " ---------------------------------------------------------------------
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
32 " Public Interface: {{{1
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
33
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
34 " Local Browsing: {{{2
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
35 augroup FileExplorer
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
36 au!
649
8157079cea85 updated for version 7.0191
vimboss
parents: 557
diff changeset
37 au BufEnter * silent! call s:LocalBrowse(expand("<amatch>"))
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
38 au VimEnter * silent! call s:VimEnter(expand("<amatch>"))
1118
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
39 if has("win32") || has("win95") || has("win64") || has("win16")
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
40 au BufEnter .* silent! call s:LocalBrowse(expand("<amatch>"))
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
41 endif
534
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
42 augroup END
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
43
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
44 " Network Browsing Reading Writing: {{{2
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
45 augroup Network
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
46 au!
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
47 if has("win32") || has("win95") || has("win64") || has("win16")
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1668
diff changeset
48 au BufReadCmd file://* exe "silent doau BufReadPre ".fnameescape(netrw#RFC2396(expand("<amatch>")))|exe 'e '.fnameescape(substitute(netrw#RFC2396(expand("<amatch>")),'file://\(.*\)','\1',""))|exe "bwipe ".fnameescape(expand("<amatch>"))|exe "silent doau BufReadPost ".fnameescape(netrw#RFC2396(expand("<amatch>")))
534
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
49 else
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1668
diff changeset
50 au BufReadCmd file://* exe "silent doau BufReadPre ".fnameescape(netrw#RFC2396(expand("<amatch>")))|exe 'e '.fnameescape(substitute(netrw#RFC2396(expand("<amatch>")),'file://\(.*\)','\1',""))|exe "bwipe ".fnameescape(expand("<amatch>"))|exe "silent doau BufReadPost ".fnameescape(netrw#RFC2396(expand("<amatch>")))
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1668
diff changeset
51 au BufReadCmd file://localhost/* exe "silent doau BufReadPre ".fnameescape(netrw#RFC2396(expand("<amatch>")))|exe 'e '.fnameescape(substitute(netrw#RFC2396(expand("<amatch>")),'file://localhost/\(.*\)','\1',""))|exe "bwipe ".fnameescape(substitute(expand("<amatch>"),'file://\(\k\+@\)\=','',''))|exe "silent doau BufReadPost ".fnameescape(netrw#RFC2396(expand("<amatch>")))
534
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
52 endif
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1702
diff changeset
53 au BufReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,davs://*,rsync://*,sftp://* exe "silent doau BufReadPre ".fnameescape(expand("<amatch>"))|call netrw#Nread(2,expand("<amatch>"))|exe "silent doau BufReadPost ".fnameescape(expand("<amatch>"))
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1702
diff changeset
54 au FileReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,davs://*,rsync://*,sftp://* exe "silent doau FileReadPre ".fnameescape(expand("<amatch>"))|call netrw#Nread(1,expand("<amatch>"))|exe "silent doau FileReadPost ".fnameescape(expand("<amatch>"))
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1668
diff changeset
55 au BufWriteCmd ftp://*,rcp://*,scp://*,dav://*,davs://*,rsync://*,sftp://* exe "silent doau BufWritePre ".fnameescape(expand("<amatch>"))|exe 'Nwrite '.fnameescape(expand("<amatch>"))|exe "silent doau BufWritePost ".fnameescape(expand("<amatch>"))
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1668
diff changeset
56 au FileWriteCmd ftp://*,rcp://*,scp://*,dav://*,davs://*,rsync://*,sftp://* exe "silent doau FileWritePre ".fnameescape(expand("<amatch>"))|exe "'[,']".'Nwrite '.fnameescape(expand("<amatch>"))|exe "silent doau FileWritePost ".fnameescape(expand("<amatch>"))
1118
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
57 try
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1668
diff changeset
58 au SourceCmd ftp://*,rcp://*,scp://*,http://*,dav://*,davs://*,rsync://*,sftp://* exe 'Nsource '.fnameescape(expand("<amatch>"))
1118
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
59 catch /^Vim\%((\a\+)\)\=:E216/
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1668
diff changeset
60 au SourcePre ftp://*,rcp://*,scp://*,http://*,dav://*,davs://*,rsync://*,sftp://* exe 'Nsource '.fnameescape(expand("<amatch>"))
1118
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
61 endtry
534
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
62 augroup END
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
63
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
64 " Commands: :Nread, :Nwrite, :NetUserPass {{{2
1618
46bbe11644e0 updated for version 7.2a
vimboss
parents: 1118
diff changeset
65 com! -count=1 -nargs=* Nread call netrw#NetrwSavePosn()<bar>call netrw#NetRead(<count>,<f-args>)<bar>call netrw#NetrwRestorePosn()
46bbe11644e0 updated for version 7.2a
vimboss
parents: 1118
diff changeset
66 com! -range=% -nargs=* Nwrite call netrw#NetrwSavePosn()<bar><line1>,<line2>call netrw#NetWrite(<f-args>)<bar>call netrw#NetrwRestorePosn()
534
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
67 com! -nargs=* NetUserPass call NetUserPass(<f-args>)
1618
46bbe11644e0 updated for version 7.2a
vimboss
parents: 1118
diff changeset
68 com! -nargs=* Nsource call netrw#NetrwSavePosn()<bar>call netrw#NetSource(<f-args>)<bar>call netrw#NetrwRestorePosn()
534
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
69
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
70 " Commands: :Explore, :Sexplore, Hexplore, Vexplore {{{2
1118
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
71 com! -nargs=* -bar -bang -count=0 -complete=dir Explore call netrw#Explore(<count>,0,0+<bang>0,<q-args>)
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
72 com! -nargs=* -bar -bang -count=0 -complete=dir Sexplore call netrw#Explore(<count>,1,0+<bang>0,<q-args>)
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
73 com! -nargs=* -bar -bang -count=0 -complete=dir Hexplore call netrw#Explore(<count>,1,2+<bang>0,<q-args>)
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
74 com! -nargs=* -bar -bang -count=0 -complete=dir Vexplore call netrw#Explore(<count>,1,4+<bang>0,<q-args>)
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
75 com! -nargs=* -bar -count=0 -complete=dir Texplore call netrw#Explore(<count>,0,6 ,<q-args>)
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
76 com! -nargs=* -bar -bang Nexplore call netrw#Explore(-1,0,0,<q-args>)
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
77 com! -nargs=* -bar -bang Pexplore call netrw#Explore(-2,0,0,<q-args>)
534
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
78
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
79 " Commands: NetrwSettings {{{2
1618
46bbe11644e0 updated for version 7.2a
vimboss
parents: 1118
diff changeset
80 com! -nargs=0 NetrwSettings call netrwSettings#NetrwSettings()
46bbe11644e0 updated for version 7.2a
vimboss
parents: 1118
diff changeset
81 com! -bang NetrwClean call netrw#NetrwClean(<bang>0)
534
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
82
649
8157079cea85 updated for version 7.0191
vimboss
parents: 557
diff changeset
83 " Maps:
2420
6de9efd58dc0 Updated runtime files. New netrw plugin version.
Bram Moolenaar <bram@vim.org>
parents: 2152
diff changeset
84 if !exists("g:netrw_nogx") && maparg('gx','n') == ""
1118
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
85 if !hasmapto('<Plug>NetrwBrowseX')
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
86 nmap <unique> gx <Plug>NetrwBrowseX
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
87 endif
1618
46bbe11644e0 updated for version 7.2a
vimboss
parents: 1118
diff changeset
88 nno <silent> <Plug>NetrwBrowseX :call netrw#NetrwBrowseX(expand("<cWORD>"),0)<cr>
649
8157079cea85 updated for version 7.0191
vimboss
parents: 557
diff changeset
89 endif
8157079cea85 updated for version 7.0191
vimboss
parents: 557
diff changeset
90
534
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
91 " ---------------------------------------------------------------------
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
92 " LocalBrowse: {{{2
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
93 fun! s:LocalBrowse(dirname)
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
94 " unfortunate interaction -- debugging calls can't be used here;
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
95 " the BufEnter event causes triggering when attempts to write to
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
96 " the DBG buffer are made.
1118
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
97 " echomsg "dirname<".a:dirname.">"
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
98 if has("amiga")
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
99 " The check against '' is made for the Amiga, where the empty
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
100 " string is the current directory and not checking would break
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
101 " things such as the help command.
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
102 if a:dirname != '' && isdirectory(a:dirname)
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
103 silent! call netrw#LocalBrowseCheck(a:dirname)
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
104 endif
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
105 elseif isdirectory(a:dirname)
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
106 " echomsg "dirname<".dirname."> isdir"
2b8ff9e3c520 updated for version 7.1a
vimboss
parents: 755
diff changeset
107 silent! call netrw#LocalBrowseCheck(a:dirname)
534
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
108 endif
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
109 " not a directory, ignore it
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
110 endfun
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
111
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
112 " ---------------------------------------------------------------------
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
113 " s:VimEnter: {{{2
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
114 fun! s:VimEnter(dirname)
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
115 windo if a:dirname != expand("%")|call s:LocalBrowse(expand("%:p"))|endif
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
116 1wincmd w
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
117 endfun
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
118
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 2034
diff changeset
119 " ---------------------------------------------------------------------
534
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
120 " NetrwStatusLine: {{{1
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
121 fun! NetrwStatusLine()
755
d01e3133478f updated for version 7.0224
vimboss
parents: 718
diff changeset
122 " let g:stlmsg= "Xbufnr=".w:netrw_explore_bufnr." bufnr=".bufnr("%")." Xline#".w:netrw_explore_line." line#".line(".")
d01e3133478f updated for version 7.0224
vimboss
parents: 718
diff changeset
123 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")
534
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
124 let &stl= s:netrw_explore_stl
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
125 if exists("w:netrw_explore_bufnr")|unlet w:netrw_explore_bufnr|endif
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
126 if exists("w:netrw_explore_line")|unlet w:netrw_explore_line|endif
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
127 return ""
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
128 else
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
129 return "Match ".w:netrw_explore_mtchcnt." of ".w:netrw_explore_listlen
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
130 endif
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
131 endfun
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
132
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
133 " ------------------------------------------------------------------------
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
134 " NetUserPass: set username and password for subsequent ftp transfer {{{1
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
135 " Usage: :call NetUserPass() -- will prompt for userid and password
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
136 " :call NetUserPass("uid") -- will prompt for password
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
137 " :call NetUserPass("uid","password") -- sets global userid and password
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
138 fun! NetUserPass(...)
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
139
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
140 " get/set userid
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
141 if a:0 == 0
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
142 " call Dfunc("NetUserPass(a:0<".a:0.">)")
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
143 if !exists("g:netrw_uid") || g:netrw_uid == ""
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
144 " via prompt
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
145 let g:netrw_uid= input('Enter username: ')
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
146 endif
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
147 else " from command line
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
148 " call Dfunc("NetUserPass(a:1<".a:1.">) {")
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
149 let g:netrw_uid= a:1
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
150 endif
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
151
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
152 " get password
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
153 if a:0 <= 1 " via prompt
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
154 " call Decho("a:0=".a:0." case <=1:")
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
155 let g:netrw_passwd= inputsecret("Enter Password: ")
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
156 else " from command line
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
157 " call Decho("a:0=".a:0." case >1: a:2<".a:2.">")
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
158 let g:netrw_passwd=a:2
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
159 endif
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
160 " call Dret("NetUserPass")
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
161 endfun
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
162
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
163 " ------------------------------------------------------------------------
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
164 " Modelines And Restoration: {{{1
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
165 let &cpo= s:keepcpo
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
166 unlet s:keepcpo
c6296b0ad9ea updated for version 7.0151
vimboss
parents:
diff changeset
167 " vim:ts=8 fdm=marker