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 for scp, look at |netrw-ssh-hack|).
:NetUserPass [uid [password]] -- prompts as needed
:call NetUserPass() -- prompts for uid and password
:call NetUserPass("uid") -- prompts for password
:call NetUserPass("uid","password") -- sets global uid and password
(Related topics: |ftp| |netrw-userpass| |netrw-start|)
NETRW VARIABLES AND SETTINGS *netrw-variables* {{{2
(Also see:
|netrw-browser-var| : netrw browser option variables
|netrw-protocol| : file transfer protocol option variables
|netrw-settings| : additional file transfer options
|netrw-browser-options| : these options affect browsing directories
)
Netrw provides a lot of variables which allow you to customize netrw to your
preferences. One way to look at them is via the command :NetrwSettings (see
|netrw-settings|) which will display your current netrw settings. Most such
settings are described below, in |netrw-browser-options|, and in
|netrw-externapp|:
*b:netrw_lastfile* last file Network-read/written retained on a
per-buffer basis (supports plain :Nw )
*g:netrw_bufsettings* the settings that netrw buffers have
(default) noma nomod nonu nowrap ro nobl
*g:netrw_chgwin* specifies a window number where subsequent file edits
will take place. (also see |netrw-C|)
(default) -1
*g:Netrw_funcref* specifies a function (or functions) to be called when
netrw edits a file. The file is first edited, and
then the function reference (|Funcref|) is called.
This variable may also hold a |List| of Funcrefs.
(default) not defined. (the capital in g:Netrw...
is required by its holding a function reference)
>
Example: place in .vimrc; affects all file opening
fun! MyFuncRef()
endfun
let g:Netrw_funcref= function("MyFuncRef")
<
*g:Netrw_UserMaps* specifies a function or |List| of functions which can
be used to set up user-specified maps and functionality.
See |netrw-usermaps|
*g:netrw_ftp* if it doesn't exist, use default ftp
=0 use default ftp (uid password)
=1 use alternate ftp method (user uid password)
If you're having trouble with ftp, try changing the
value of this variable to see if the alternate ftp
method works for your setup.
*g:netrw_ftp_options* Chosen by default, these options are supposed to
turn interactive prompting off and to restrain ftp
from attempting auto-login upon initial connection.
However, it appears that not all ftp implementations
support this (ex. ncftp).
="-i -n"
*g:netrw_ftpextracmd* default: doesn't exist
If this variable exists, then any string it contains
will be placed into the commands set to your ftp
client. As an example:
="passive"
*g:netrw_ftpmode* ="binary" (default)
="ascii"
*g:netrw_ignorenetrc* =0 (default for linux, cygwin)
=1 If you have a <.netrc> file but it doesn't work and
you want it ignored, then set this variable as
shown. (default for Windows + cmd.exe)
*g:netrw_menu* =0 disable netrw's menu
=1 (default) netrw's menu enabled
*g:netrw_uid* (ftp) user-id, retained on a per-vim-session basis
*s:netrw_passwd* (ftp) password, retained on a per-vim-session basis
*g:netrw_preview* =0 (default) preview window shown in a horizontally
split window
=1 preview window shown in a vertically split window.
Also affects the "previous window" (see |netrw-P|)
in the same way.
The |g:netrw_alto| variable may be used to provide
additional splitting control:
g:netrw_preview g:netrw_alto result
0 0 |:aboveleft|
0 1 |:belowright|
1 0 |:topleft|
1