Nvim :help
pages, generated
from source
using the tree-sitter-vimdoc parser.
set nocp " 'compatible' is not set filetype plugin on " plugins are enabled
vim scp://hostname/path/to/file
vim ftp://hostname/path/to/file
machine HOSTNAME login USERID password "PASSWORD" machine HOSTNAME login USERID password "PASSWORD" ... default login USERID password "PASSWORD"
let g:netrw_ftp_cmd= 'c:\Windows\System32\ftp -s:C:\Users\MyUserName\MACHINE'
userid passwordfor each site in a separate file: c:\Users\MyUserName\MachineName.
vim . vim /home/userid/path
vim scp://hostname/ vim ftp://hostname/path/to/dir/
:let g:loaded_netrw = 1 :let g:loaded_netrwPlugin = 1
g:netrw_dav_cmd
= "cadaver" if cadaver is executable
dav: g:netrw_dav_cmd = "curl -o" elseif curl is available
fetch: g:netrw_fetch_cmd
= "fetch -o" if fetch is available
ftp: g:netrw_ftp_cmd
= "ftp"
http: g:netrw_http_cmd
= "elinks" if elinks is available
http: g:netrw_http_cmd = "links" elseif links is available
http: g:netrw_http_cmd = "curl" elseif curl is available
http: g:netrw_http_cmd = "wget" elseif wget is available
http: g:netrw_http_cmd = "fetch" elseif fetch is available
http: g:netrw_http_put_cmd
= "curl -T"
rcp: g:netrw_rcp_cmd
= "rcp"
rsync: g:netrw_rsync_cmd
= "rsync" (see g:netrw_rsync_sep)
scp: g:netrw_scp_cmd
= "scp -q"
sftp: g:netrw_sftp_cmd
= "sftp"
file: g:netrw_file_cmd
= "elinks" or "links"g:netrw_http_xcmd
: the option string for http://... protocols are
specified via this variable and may be independently overridden. By
default, the option arguments for the http-handling commands are:elinks : "-source >" links : "-dump >" curl : "-L -o" wget : "-q -O" fetch : "-o"
let g:netrw_http_xcmd= "-dump >"
:e ftp://[user@]machine/path
:w ftp://[user@]machine/path
:so ftp://[user@]machine/path
:e scp://[user]@hostname/path/ :e ftp://[user]@hostname/path/
:Nread [protocol]://[user]@hostname/path/
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 noblg:netrw_chgwin
specifies a window number where subsequent file edits
will take place. (also see netrw-C)
(default) -1g: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-usermapsg: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 enabledg:netrw_nogx
if this variable exists, then the "gx" map will not
be available (see netrw-gx)g:netrw_uid
(ftp) user-id, retained on a per-vim-session basis
s:netrw_passwd
(ftp) password, retained on a per-vim-session basisg: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 1 :botright
To control sizing, see g:netrw_winsizeg:netrw_scpport
= "-P" : option to use to set port for scp
g:netrw_sshport
= "-p" : option to use to set port for sshg:netrw_sepchr
=\0xff
=\0x01 for enc == euc-jp (and perhaps it should be for
others, too, please let me know)
Separates priority codes from filenames internally.
See netrw-p12.g:netrw_silent
=0 : transfers done normally
=1 : transfers done silentlyg:netrw_use_errorwindow
=2: messages from netrw will use a popup window
Move the mouse and pause to remove the popup window.
=1 : messages from netrw will use a separate one
line window. This window provides reliable
delivery of messages.
=0 : (default) 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
lines that o/s's ftp "provides" on transfers
=0 force normal ftp behavior (no trailing line removal)g:netrw_cygwin
=1 assume scp under windows is from cygwin. Also
permits network browsing to use ls with time and
size sorting (default if windows)
=0 assume Windows' scp accepts windows-style paths
Network browsing uses dir instead of ls
This option is ignored if you're using unixg:netrw_use_nt_rcp
=0 don't use the rcp of WinNT, Win2000 and WinXP
=1 use WinNT's rcp in binary mode (default)example: vim scp://user@host/somefile example: vim scp://user@host/subdir1/subdir2/somefile
example: vim scp://user@host//somefile example: vim scp://user@host//subdir1/subdir2/somefile
ex. vim ftp://hostname/path/to/file
netrw-putty
netrw-pscp
netrw-psftp
One may modify any protocol's implementing external application by setting a
variable (ex. scp uses the variable g:netrw_scp_cmd, which is defaulted to
"scp -q"). As an example, consider using PuTTY:let g:netrw_scp_cmd = '"c:\Program Files\PuTTY\pscp.exe" -q -batch' let g:netrw_sftp_cmd= '"c:\Program Files\PuTTY\psftp.exe"'
vim rcp://[user@]machine/path vim scp://[user@]machine/path
vim ftp://[user@]machine[[:#]portnumber]/path
userid password
netrw-windows-netrc
netrw-windows-s
If g:netrw_ftp_cmd contains -s:[path/]MACHINE, then (on Windows machines
only) netrw will substitute the current machine name requested for ftp
connections for MACHINE. Hence one can have multiple machine.ftp files
containing login and password for ftp. Example:let g:netrw_ftp_cmd= 'c:\Windows\System32\ftp -s:C:\Users\Myself\MACHINE' vim ftp://myhost.somewhere.net/will use a file
C:\Users\Myself\myhost.ftp
netrw-urls
+=================================+============================+============+
| Reading | Writing | Uses |
+=================================+============================+============+
| DAV: | | |
| dav://host/path | | cadaver |
| :Nread dav://host/path | :Nwrite dav://host/path | cadaver |
+---------------------------------+----------------------------+------------+
| DAV + SSL: | | |
| davs://host/path | | cadaver |
| :Nread davs://host/path | :Nwrite davs://host/path | cadaver |
+---------------------------------+----------------------------+------------+
| FETCH: | | |
| fetch://[user@]host/path | | |
| fetch://[user@]host:http/path | Not Available | fetch |
| :Nread fetch://[user@]host/path| | |
+---------------------------------+----------------------------+------------+
| FILE: | | |
| file:///* | file:///* | |
| file://localhost/* | file://localhost/* | |
+---------------------------------+----------------------------+------------+
| FTP: (*3) | (*3) | |
| ftp://[user@]host/path | ftp://[user@]host/path | ftp (*2) |
| :Nread ftp://host/path | :Nwrite ftp://host/path | ftp+.netrc |
| :Nread host path | :Nwrite host path | ftp+.netrc |
| :Nread host uid pass path | :Nwrite host uid pass path | ftp |
+---------------------------------+----------------------------+------------+
| HTTP: wget is executable: (*4) | | |
| http://[user@]host/path | Not Available | wget |
+---------------------------------+----------------------------+------------+
| HTTP: fetch is executable (*4) | | |
| http://[user@]host/path | Not Available | fetch |
+---------------------------------+----------------------------+------------+
| RCP: | | |
| rcp://[user@]host/path | rcp://[user@]host/path | rcp |
+---------------------------------+----------------------------+------------+
| RSYNC: | | |
| rsync://[user@]host/path | rsync://[user@]host/path | rsync |
| :Nread rsync://host/path | :Nwrite rsync://host/path | rsync |
| :Nread rcp://host/path | :Nwrite rcp://host/path | rcp |
+---------------------------------+----------------------------+------------+
| SCP: | | |
| scp://[user@]host/path | scp://[user@]host/path | scp |
| :Nread scp://host/path | :Nwrite scp://host/path | scp (*1) |
+---------------------------------+----------------------------+------------+
| SFTP: | | |
| sftp://[user@]host/path | sftp://[user@]host/path | sftp |
| :Nread sftp://host/path | :Nwrite sftp://host/path | sftp (*1) |
+=================================+============================+============+machine {full machine name} login {user-id} password "{password}" default login {user-id} password "{password}"Your ftp client must handle the use of <.netrc> on its own, but if the
set nocp if version >= 600 filetype plugin indent on endif
" Augroup VimStartup: augroup VimStartup au! au VimEnter * if expand("%") == "" | e . | endif augroup END
vim ftp://[user@]machine/path ... :wqSee netrw-activate for more on how to encourage your vim to use plugins such as netrw.
:e URL :r URL :w URLinstead, as appropriate) -- see netrw-urls. In the explanations below, a
{netfile}
is a URL to a remote file.:Nwrite
:Nw
:[range]Nw[rite] Write the specified lines to the current
file as specified in b:netrw_lastfile.
(related: netrw-nwrite){netfile}
[{netfile}
]...
Write the specified lines to the {netfile}
.:Nread
:Nr
:Nr[ead] Read the lines from the file specified in b:netrw_lastfile
into the current buffer. (related: netrw-nread){netfile}
{netfile}
...
Read the {netfile}
after the current line.:Nsource
:Ns
:Ns[ource] {netfile}
Source the {netfile}
.
To start up vim using a remote .vimrc, one may use
the following (all on one line) (tnx to Antoine Mechelynck)vim -u NORC -N --cmd "runtime plugin/netrwPlugin.vim" --cmd "source scp://HOSTNAME/.vimrc"
NetUserPass()
If g:netrw_uid and s:netrw_passwd don't exist,
this function will query the user for them.
(related: netrw-userpass)netrw-options
------------- Netrw Options ------------- Option Meaning -------------- -----------------------------------------------
-----------------------------------------------------------------------
netrw-internal-variables
The script will also make use of the following variables internally, albeit
temporarily.
------------------- Temporary Variables ------------------- Variable Meaning -------- ------------------------------------
------------------------------------------------------------
------------------------ Protocol Control Options ------------------------ Option Type Setting Meaning --------- -------- -------------- ---------------------------
g:netrw_rsync_sep
var ="/" used to separate the hostname
from the file spec
g:netrw_scp_cmd var ="scp -q"
g:netrw_sftp_cmd var ="sftp"-------------------------------------------------------------------------
let g:netrw_ftp_cmd= "ftp -p"
IF g:netrw_ftp !exists or is not 1 IF g:netrw_ftp exists and is 1 ---------------------------------- ------------------------------
---------------------------------------------------------------------
:%! {g:netrw_ftp_cmd} -i [-n]
netrw-cadaver
To handle the SSL certificate dialog for untrusted servers, one may pull
down the certificate and place it into /usr/ssl/cert.pem. This operation
renders the server treatment as "trusted".netrw-fixup
netreadfixup
If your ftp for whatever reason generates unwanted lines (such as AUTH
messages) you may write a NetReadFixup() function:
function! NetReadFixup(method,line1,line2) " a:line1: first new line in current file " a:line2: last new line in current file if a:method == 1 "rcp elseif a:method == 2 "ftp + <.netrc> elseif a:method == 3 "ftp + machine,uid,password,filename elseif a:method == 4 "scp elseif a:method == 5 "http/wget elseif a:method == 6 "dav/cadaver elseif a:method == 7 "rsync elseif a:method == 8 "fetch elseif a:method == 9 "sftp else " complain endif endfunctionThe NetReadFixup() function will be called if it exists and thus allows you to customize your reading process. As a further example, <netrw.vim> contains just such a function to handle Windows 95 ftp. For whatever reason, Windows 95's ftp dumps four blank lines at the end of a transfer, and so it is desirable to automate their removal. Here's some code taken from <netrw.vim> itself:
if has("win95") && g:netrw_win95ftp fun! NetReadFixup(method, line1, line2) if method == 3 " ftp (no <.netrc>) let fourblanklines= line2 - 3 silent fourblanklines .. "," .. line2 .. "g/^\s*/d" endif endfunction endif(Related topics: ftp netrw-userpass netrw-start)
vim /your/directory/ vim . vim c:\your\directory\
vim [protocol]://[user@]hostname/path/
vim ftp://ftp.home.vim.org/pub/vim/
netrw-getftype
netrw-filigree
netrw-ftype
The getftype() function is used to append a bit of filigree to indicate
filetype to locally listed files:netrw-quickmap
netrw-quickmaps
QUICK REFERENCE: MAPS netrw-browse-maps
{{{2
--- ----------------- ---- Map Quick Explanation Link --- ----------------- ----
<F1>
Causes Netrw to issue help
<cr>
Netrw will enter the directory or read the file netrw-cr
<del>
Netrw will attempt to remove the file/directory netrw-del
<c-h>
Edit file hiding list netrw-ctrl-h
<c-l>
Causes Netrw to refresh the directory listing netrw-ctrl-l
<c-r>
Browse using a gvim server netrw-ctrl-r
<c-tab>
Shrink/expand a netrw/explore window netrw-c-tab
- Makes Netrw go up one directory netrw--
a Cycles between normal display, netrw-a
hiding (suppress display of files matching g:netrw_list_hide)
and showing (display only files which match g:netrw_list_hide)
cd Make browsing directory the current directory netrw-cd
C Setting the editing window netrw-C
d Make a directory netrw-d
D Attempt to remove the file(s)/directory(ies) netrw-D
gb Go to previous bookmarked directory netrw-gb
gd Force treatment as directory netrw-gd
gf Force treatment as file netrw-gf
gh Quick hide/unhide of dot-files netrw-gh
gn Make top of tree the directory below the cursor netrw-gn
gp Change local-only file permissions netrw-gp
i Cycle between thin, long, wide, and tree listings netrw-i
I Toggle the displaying of the banner netrw-I
mb Bookmark current directory netrw-mb
mc Copy marked files to marked-file target directory netrw-mc
md Apply diff to marked files (up to 3) netrw-md
me Place marked files on arg list and edit them netrw-me
mf Mark a file netrw-mf
mF Unmark files netrw-mF
mg Apply vimgrep to marked files netrw-mg
mh Toggle marked file suffices' presence on hiding list netrw-mh
mm Move marked files to marked-file target directory netrw-mm
mr Mark files using a shell-style regexp netrw-mr
mt Current browsing directory becomes markfile target netrw-mt
mT Apply ctags to marked files netrw-mT
mu Unmark all marked files netrw-mu
mv Apply arbitrary vim command to marked files netrw-mv
mx Apply arbitrary shell command to marked files netrw-mx
mX Apply arbitrary shell command to marked files en bloc|netrw-mX|
mz Compress/decompress marked files netrw-mz
o Enter the file/directory under the cursor in a new netrw-o
browser window. A horizontal split is used.
O Obtain a file specified by cursor netrw-O
p Preview the file netrw-p
P Browse in the previously used window netrw-P
qb List bookmarked directories and history netrw-qb
qf Display information on file netrw-qf
qF Mark files using a quickfix list netrw-qF
qL Mark files using a location-list netrw-qL
r Reverse sorting order netrw-r
R Rename the designated file(s)/directory(ies) netrw-R
s Select sorting style: by name, time, or file size netrw-s
S Specify suffix priority for name-sorting netrw-S
t Enter the file/directory under the cursor in a new tab|netrw-t|
u Change to recently-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
browser window. A vertical split is used.
x View file with an associated program netrw-x
X Execute filename under cursor via system() netrw-Xnetrw-mouse
netrw-leftmouse
netrw-middlemouse
netrw-rightmouse
<leftmouse>
(gvim only) selects word under mouse as if a <cr>
had been pressed (ie. edit file, change directory)
<middlemouse>
(gvim only) same as P selecting word under mouse;
see netrw-P
<rightmouse>
(gvim only) delete file/directory using word under
mouse
<2-leftmouse>
(gvim only) when:
* in a netrw-selected file, AND
* g:netrw_retmap == 1 AND
* the user doesn't already have a <2-leftmouse>
mapping defined before netrw is autoloaded,
then a double clicked leftmouse button will return
to the netrw browser window. See g:netrw_retmap.
<s-leftmouse>
(gvim only) like mf, will mark files. Dragging
the shifted leftmouse will mark multiple files.
(see netrw-mf)netrw-quickcom
netrw-quickcoms
QUICK REFERENCE: COMMANDS netrw-explore-cmds
netrw-browse-cmds
{{{2
:NetrwClean[!]............................................|netrw-clean|
:NetrwSettings............................................|netrw-settings|
:Ntree....................................................|netrw-ntree|
:Explore[!] [dir] Explore directory of current file......|netrw-explore|
:Hexplore[!] [dir] Horizontal Split & Explore.............|netrw-explore|
:Lexplore[!] [dir] Left Explorer Toggle...................|netrw-explore|
:Nexplore[!] [dir] Vertical Split & Explore...............|netrw-explore|
:Pexplore[!] [dir] Vertical Split & Explore...............|netrw-explore|
:Rexplore Return to Explorer.....................|netrw-explore|
:Sexplore[!] [dir] Split & Explore directory .............|netrw-explore|
:Texplore[!] [dir] Tab & Explore..........................|netrw-explore|
:Vexplore[!] [dir] Vertical Split & Explore...............|netrw-explore|mb
.netrwbook
Bookmarks are retained in between sessions of vim in a file called .netrwbook
as a List, which is typically stored in the first directory on the user's
'runtimepath'; entries are kept in sorted order.netrw-:NetrwMB
Additionally, one may use :NetrwMB to bookmark files or directories.:NetrwMB[!] [files/directories]
<cr>
(the return key) will select the file or directory.
Directories will themselves be listed, and files will be opened using the
protocol given in the original read request.<cr>
will cause the file to appear in a new tab.<leftmouse>
button. In addition, if<2-leftmouse>
mapping defined before
netrw is loadednetrw-s-cr
Squeezing the Current Tree-Listing Directory~<s-cr>
mapping may be used to squeeze (close) the
directory currently containing the cursor.nmap <buffer> <silent> <nowait> YOURKEYCOMBO <Plug>NetrwTreeSqueeze
netrw-o
netrw-horiz
{{{2<cr>
. However, the "o" map
allows one to open a new window to hold the new directory listing or file. A
horizontal split is used. (for vertical splitting, see netrw-v)netrw-t
{{{2<cr>
. The "t" map
allows one to open a new window holding the new directory listing or file in
a new tab.netrw-v
{{{2<cr>
. However, the "v" map
allows one to open a new window to hold the new directory listing or file. A
vertical split is used. (for horizontal splitting, see netrw-o)netrw-ctrl-r
{{{2<c-r>
map on a file (not a directory) in the netrw browser, and it
will use a gvim server (see g:netrw_servername). Subsequent use of <cr>
(see netrw-cr) will re-use that server for editing files.<cr>
will open files<cr>
key while atop the directory
name.let g:netrw_liststyle= 3the tree style will become your default listing style.
vim . (use i until a tree display shows) navigate to a file v (edit as desired in vertically split window) ctrl-w h (to return to the netrw listing) P (edit newly selected file in the previous window) ctrl-w h (to return to the netrw listing) P (edit newly selected file in the previous window) ...etc...
netrw-gb
{{{2{cnt}
gbnetrw-u
netrw-updir
{{{2.netrwhist
See g:netrw_dirhistmax for how to control the quantity of history stack
slots. The file ".netrwhist" holds history when netrw (and vim) is not
active. By default, its stored on the first directory on the user's
'runtimepath'.netrw-U
netrw-downdir
{{{2:Ntree [dirname]Without a "dirname", the current line is used (and any leading depth information is elided). With a "dirname", the specified directory name is used.
netrw-gx
CUSTOMIZING BROWSING WITH A SPECIAL HANDLER netrw-x
netrw-handler
{{{2
(also see netrw_filehandler)* when Exploring, hit the "x" key * when editing, hit gx with the cursor atop the special filename
:let g:netrw_browsex_viewer= "kfmclient exec"
:let g:netrw_browsex_viewer= "xdg-open"
Ex. mypgm.html x -> NFH_html("scp://user@host/some/path/mypgm.html")
" NFH_suffix(filename) fun! NFH_suffix(filename) ..do something special with filename.. endfun
@ -> AT ! -> EXCLAMATION % -> PERCENT : -> COLON = -> EQUAL ? -> QUESTION , -> COMMA - -> MINUS ; -> SEMICOLON $ -> DOLLAR + -> PLUS ~ -> TILDE
file.rcs,v -> NFH_rcsCOMMAv()
[email protected]with a request. (remove the embedded NOSPAM first)
netrw-curdir
{cnt}mBIf there are marked files, then mB will remove them from the bookmark list.
:NetrwMB! [files/directories]Related Topics: netrw-gb how to return (go) to a bookmark netrw-mb how to make a bookmark netrw-qb how to list bookmarks
netrw-explore
netrw-hexplore
netrw-nexplore
netrw-pexplore
netrw-rexplore
netrw-sexplore
netrw-texplore
netrw-vexplore
netrw-lexplore
DIRECTORY EXPLORATION COMMANDS {{{2:Explore
:[N]Hexplore[!] [dir]... Horizontal Split & Explore :Hexplore
:[N]Lexplore[!] [dir]... Left Explorer Toggle :Lexplore
:[N]Sexplore[!] [dir]... Split&Explore current file's directory :Sexplore
:[N]Vexplore[!] [dir]... Vertical Split & Explore :Vexplore
:Texplore [dir]... Tab & Explore :Texplore
:Rexplore ... Return to/from Explorer :Rexplore
:Nexplore
:Pexplore............. go to previous matching file :Pexplore
netrw-:Explore
:Explore will open the local-directory browser on the current file's
directory (or on directory [dir] if specified). The window will be
split only if the file has been modified and 'hidden' is not set,
otherwise the browsing window will take over that window. Normally
the splitting is taken horizontally.
Also see: netrw-:Rexplore
:Explore! is like :Explore, but will use vertical splitting.netrw-:Hexplore
:Hexplore [dir] does an :Explore with :belowright horizontal splitting.
:Hexplore! [dir] does an :Explore with :aboveleft horizontal splitting.netrw-:Lexplore
:[N]Lexplore [dir] toggles a full height Explorer window on the left hand side
of the current tab. It will open a netrw window on the current
directory if [dir] is omitted; a :Lexplore [dir] will show the
specified directory in the left-hand side browser display no matter
from which window the command is issued.netrw-:Sexplore
:[N]Sexplore will always split the window before invoking the local-directory
browser. As with Explore, the splitting is normally done
horizontally.
:[N]Sexplore! [dir] is like :Sexplore, but the splitting will be done vertically.netrw-:Texplore
:Texplore [dir] does a :tabnew before generating the browser windownetrw-:Vexplore
:[N]Vexplore [dir] does an :Explore with :leftabove vertical splitting.
:[N]Vexplore! [dir] does an :Explore with :rightbelow vertical splitting.:Explore /some/path
netrw-:Rexplore
:Rexplore This command is a little different from the other Explore commands
as it doesn't necessarily open an Explorer window.<cr>
while the cursor is atop a filename in a netrw
browser window, a :Rexplore issued while editing that file will
return the display to that of the last netrw browser display in
that window.<2-leftmouse>
map (which is only available under gvim and
cooperative terms) does the same as :Rexplore.netrw-star
netrw-starpat
netrw-starstar
netrw-starstarpat
netrw-grep
EXPLORING WITH STARS AND PATTERNS {{{2:Explorewill clear the explore list.
<s-down>
== Nexplore, and
<s-up>
== Pexplore.:Explore */*.c :Nexplore :Nexplore :Pexplore
let g:netrw_list_hide= '\(^\|\s\s\)\zs\.\S\+'Effectively, this makes the effect of a netrw-gh command the initial setting. What it means:
netrw-sort-sequence
'[\/]$,\<core\%(\.\d\+\)\=,\.[a-np-z]$,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$, \.info$,\.swp$,\.bak$,\~$'
'[\/]$,\.[a-np-z]$,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,\.info$, \.swp$,\.bak$,\~$'
gf
gd
<cr>
when atop the ../ directory
entry in the listing.ssh HOSTNAME ls -FLa
<c-h>
map. As an
example, to hide files which begin with a ".", one may use the <c-h>
map to
set the hiding list to '^\..*' (or one may put let g:netrw_list_hide= '^\..*'
in one's <.vimrc>). One may then use the "a" key to show all files, hide
matching files, or to show only the matching files.netrw-gh
netrw-hide
As a quick shortcut, one may pressghto toggle between hiding files which begin with a period (dot) and not hiding them.
netrw-gitignore
Netrw provides a helper function 'netrw_gitignore#Hide()' that, when used with
g:netrw_list_hide automatically hides all git-ignored files.'./.gitignore' './.git/info/exclude' global gitignore file: `git config --global core.excludesfile` system gitignore file: `git config --system core.excludesfile`
Example: let g:netrw_list_hide= netrw_gitignore#Hide() Git-ignored files are hidden in Netrw. Example: let g:netrw_list_hide= netrw_gitignore#Hide('my_gitignore_file') Function can take additional files with git-ignore patterns. Example: let g:netrw_list_hide= netrw_gitignore#Hide() .. '.*\.swp$' Combining 'netrw_gitignore#Hide' with custom patterns.
ssh-keygen -t rsa (saving the file in ~/.ssh/id_rsa as prompted)
<CR>
when asked for passphrase (twice) for no
passphrase. If you do use a passphrase, you will also need to use
ssh-agent so you only have to type the passphrase once per session.
If you don't use a passphrase, simply logging onto your local
computer or getting access to the keyfile in any way will suffice
to access any ssh servers which have that key authorized for login.~/.ssh/id_rsa ~/.ssh/id_rsa.pub
cd mkdir -p .ssh chmod 0700 .ssh
ssh {serverhostname} cat '>>' '~/.ssh/authorized_keys2' < ~/.ssh/id_rsa.pub
ssh {serverhostname} cat '>>' '~/.ssh/authorized_keys' < ~/.ssh/id_rsa.pub
ssh {serverhostname}and you should be log onto the server machine without further need to type anything.
ssh-agent $SHELL ssh-add ssh {serverhostname}You will be prompted for your key passphrase when you use ssh-add, but not subsequently when you use ssh. For use with vim, you can use
ssh-agent vimand, when next within vim, use
:!ssh-addAlternatively, you can apply ssh-agent to the terminal you're planning on running vim in:
ssh-agent xterm &and do ssh-add whenever you need.
netrw-d
{{{2<CR>
at that point will abort the making of the
directory. Attempts to make a local directory that already exists (as either
a file or a directory) will be detected, reported on, and ignored.<s-leftmouse>
. (see netrw-mouse):MF *.c
<s-leftmouse>
using gvim. One may unmark all files by pressing
"mu" (see netrw-mu).highlight clear netrwMarkFile hi link netrwMarkFile ..whatever..
<s-leftmouse>
to
mark one or more files. You may mark multiple files by dragging the shifted
leftmouse. (see netrw-mouse)markfilelist
global_markfilelist
local_markfilelist
All marked files are entered onto the global marked file list; there is only
one such list. In addition, every netrw buffer also has its own buffer-local
marked file list; since netrw buffers are associated with specific
directories, this means that each directory has its own local marked file
list. The various commands which operate on marked files use one or the other
of the marked file lists.netrw-mv
{{{2
(See netrw-mf and netrw-mr for how to mark files)
(uses the local marked-file list)netrw-mx
{{{2
(See netrw-mf and netrw-mr for how to mark files)
(uses the local marked-file list)netrw-mX
{{{2
(See netrw-mf and netrw-mr for how to mark files)
(uses the global marked-file list)command filesThis approach is useful, for example, to select files and make a tarball:
(mark files) mX Enter command: tar cf mynewtarball.tar
netrw-ma
netrw-mA
(See netrw-mf and netrw-mr for how to mark files)
(uses the global marked-file list)netrw-cb
netrw-cB
(See netrw-mf and netrw-mr for how to mark files)
(uses the global marked-file list)netrw-mz
{{{2
(See netrw-mf and netrw-mr for how to mark files)
(uses the local marked file list)netrw-mc
{{{2
(See netrw-mf and netrw-mr for how to mark files)
(Uses the global marked file list)netrw-md
{{{2
(See netrw-mf and netrw-mr for how to mark files)
(uses the global marked file list)netrw-me
{{{2
(See netrw-mf and netrw-mr for how to mark files)
(uses the global marked file list)netrw-mg
{{{2
(See netrw-mf and netrw-mr for how to mark files)
(uses the global marked file list)/pattern/[g][j] ! /pattern/[g][j] pattern
mr ...file-pattern... mg /pattern/j
netrw-mh
{{{2
(See netrw-mf and netrw-mr for how to mark files)
(uses the local marked file list)netrw-mm
{{{2
(See netrw-mf and netrw-mr for how to mark files)
(uses the global marked file list)netrw-ms
{{{2
(See netrw-mf and netrw-mr for how to mark files)
(uses the local marked file list)netrw-mt
{{{2
(See netrw-mf and netrw-mr for how to mark files)netrw-:MT
This command uses <q-args>, so spaces in the directory name are
permitted without escaping.<c-leftmouse>
netrw-mT
{{{2
(See netrw-mf and netrw-mr for how to mark files)
(uses the global marked file list)let g:netrw_ctags= "hdrtag"
netrw-Tb
{{{2netrw-Th
{{{2netrw-browser-settings
--- ----------- Var Explanation --- -----------
g:netrw_altfile
some like CTRL-^ to return to the last
edited file. Choose that by setting this
parameter to 1.
Others like CTRL-^ to return to the
netrw browsing buffer. Choose that by setting
this parameter to 0.
default: =0g:netrw_alto
change from above splitting to below splitting
by setting this variable (see netrw-o)
default: =&sb (see 'sb')g:netrw_altv
change from left splitting to right splitting
by setting this variable (see netrw-v)
default: =&spr (see 'spr')g:netrw_banner
enable/suppress the banner
=0: suppress the banner
=1: banner is enabled (default)g:netrw_bannerbackslash
if this variable exists and is not zero, the
banner will be displayed with backslashes
rather than forward slashes.g:netrw_browse_split
when browsing, <cr>
will open the file by:
=0: re-using the same window (default)
=1: horizontally splitting the window first
=2: vertically splitting the window first
=3: open file in new tab
=4: act like "P" (ie. open previous window)
Note that g:netrw_preview may be used
to get vertical splitting instead of
horizontal splitting.
=[servername,tab-number,window-number]
Given a List such as this, a remote server
named by the "servername" will be used for
editing. It will also use the specified tab
and window numbers to perform editing
(see clientserver, netrw-ctrl-r)
This option does not affect the production of
:Lexplore windows.g:netrw_browsex_viewer
specify user's preference for a viewer:"kfmclient exec" "gnome-open"
"-"
g:netrw_browsex_support_remote
specify if the specified viewer supports a
remote URL. (see netrw-handler).g:netrw_chgperm
Unix/Linux: "chmod PERM FILENAME"
Windows: "cacls FILENAME /e /p PERM"
Used to change access permission for a file.g:netrw_clipboard
=1
By default, netrw will attempt to insure that
the clipboard's values will remain unchanged.
However, some users report that they have
speed problems with this; consequently, this
option, when set to zero, lets such users
prevent netrw from saving and restoring the
clipboard (the latter is done only as needed).
That means that if the clipboard is changed
(inadvertently) by normal netrw operation that
it will not be restored to its prior state.g:netrw_compress
="gzip"
Will compress marked files with this
commandg:Netrw_corehandler
Allows one to specify something additional
to do when handling <core>
files via netrw's
browser's "x" command (see netrw-x). If
present, g:Netrw_corehandler specifies
either one or more function references
(see Funcref). (the capital g:Netrw...
is required its holding a function reference)g:netrw_ctags
="ctags"
The default external program used to create
tagsg:netrw_cursor
= 2 (default)
This option controls the use of the
'cursorline' (cul) and 'cursorcolumn'
(cuc) settings by netrw:g:netrw_decompress
= { ".gz" : "gunzip" ,
".bz2" : "bunzip2" ,
".zip" : "unzip" ,
".tar" : "tar -xf"}
A dictionary mapping suffices to
decompression programs.g:netrw_dirhistmax
=10: controls maximum quantity of past
history. May be zero to suppress
history.
(related: netrw-qb netrw-u netrw-U)g:netrw_dynamic_maxfilenamelen
=32: enables dynamic determination of
g:netrw_maxfilenamelen, which affects
local file long listing.g:netrw_errorlvl
=0: error levels greater than or equal to
this are permitted to be displayed
0: notes
1: warnings
2: errorsg:netrw_fastbrowse
=0: slow speed directory browsing;
never re-uses directory listings;
always obtains directory listings.
=1: medium speed directory browsing;
re-use directory listings only
when remote directory browsing.
(default value)
=2: fast directory browsing;
only obtains directory listings when the
directory hasn't been seen before
(or netrw-ctrl-l is used).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
=' ?&;%'
Used on filenames before remote reading/writingg:netrw_ftp_browse_reject
ftp can produce a number of errors and warnings
that can show up as "directories" and "files"
in the listing. This pattern is used to
remove such embedded messages. By default its
value is:
'^total\s\+\d\+$\|
^Trying\s\+\d\+.*$\|
^KERBEROS_V\d rejected\|
^Security extensions not\|
No such file\|
: connect to address [0-9a-fA-F:]*
: No route to host$'g:netrw_ftp_list_cmd
options for passing along to ftp for directory
listing. Defaults:
unix or g:netrw_cygwin set: : "ls -lF"
otherwise "dir"g:netrw_ftp_sizelist_cmd
options for passing along to ftp for directory
listing, sorted by size of file.
Defaults:
unix or g:netrw_cygwin set: : "ls -slF"
otherwise "dir"g:netrw_ftp_timelist_cmd
options for passing along to ftp for directory
listing, sorted by time of last modification.
Defaults:
unix or g:netrw_cygwin set: : "ls -tlF"
otherwise "dir"g:netrw_glob_escape
='[]*?`{~$' (unix)
='[]*?`{$' (windows
These characters in directory names are
escaped before applying glob()g:netrw_gx
="<cfile>"
This option controls how gx (netrw-gx) picks
up the text under the cursor. See expand()
for possibilities.g:netrw_hide
Controlled by the "a" map (see netrw-a)
=0 : show all
=1 : show not-hidden files
=2 : show hidden files only
default: =1g:netrw_home
The home directory for where bookmarks and
history are saved (as .netrwbook and
.netrwhist).
Netrw uses expand() on the string.
default: stdpath("data") (see stdpath())g:netrw_keepdir
=1 (default) keep current directory immune from
the browsing directory.
=0 keep the current directory the same as the
browsing directory.
The current browsing directory is contained in
b:netrw_curdir (also see netrw-cd)g:netrw_keepj
="keepj" (default) netrw attempts to keep the
:jumps table unaffected.
="" netrw will not use :keepjumps with
exceptions only for the
saving/restoration of position.g:netrw_list_cmd
command for listing remote directories
default: (if ssh is executable)
"ssh HOSTNAME ls -FLa"g:netrw_list_cmd_options
If this variable exists, then its contents are
appended to the g:netrw_list_cmd. For
example, use "2>/dev/null" to get rid of banner
messages on unix systems.g:netrw_liststyle
Set the default listing style:
= 0: thin listing (one file per line)
= 1: long listing (one file per line with time
stamp information and file size)
= 2: wide listing (multiple files in columns)
= 3: tree style listingg:netrw_list_hide
comma-separated pattern list for hiding files
Patterns are regular expressions (see regexp)
There's some special support for git-ignore
files: you may add the output from the helper
function 'netrw_gitignore#Hide() automatically
hiding all gitignored files.
For more details see netrw-gitignore.
default: ""let g:netrw_list_hide= '.*\.swp$' let g:netrw_list_hide= netrw_gitignore#Hide() .. '.*\.swp$'
g:netrw_localcopycmd
="cp" Linux/Unix/MacOS/Cygwin
=expand("$COMSPEC") Windows
Copies marked files (netrw-mf) to target
directory (netrw-mt, netrw-mc)g:netrw_localcopycmdopt
='' Linux/Unix/MacOS/Cygwin
=' \c copy' Windows
Options for the g:netrw_localcopycmdg:netrw_localcopydircmd
="cp" Linux/Unix/MacOS/Cygwin
=expand("$COMSPEC") Windows
Copies directories to target directory.
(netrw-mc, netrw-mt)g:netrw_localcopydircmdopt
=" -R" Linux/Unix/MacOS/Cygwin
=" /c xcopy /e /c /h/ /i /k" Windows
Options for g:netrw_localcopydircmdg:netrw_localmkdir
="mkdir" Linux/Unix/MacOS/Cygwin
=expand("$COMSPEC") Windows
command for making a local directoryg:netrw_localmkdiropt
="" Linux/Unix/MacOS/Cygwin
=" /c mkdir" Windows
Options for g:netrw_localmkdirg:netrw_localmovecmd
="mv" Linux/Unix/MacOS/Cygwin
=expand("$COMSPEC") Windows
Moves marked files (netrw-mf) to target
directory (netrw-mt, netrw-mm)g:netrw_localmovecmdopt
="" Linux/Unix/MacOS/Cygwin
=" /c move" Windows
Options for g:netrw_localmovecmdg:netrw_localrmdir
="rmdir" Linux/Unix/MacOS/Cygwin
=expand("$COMSPEC") Windows
Remove directory command (rmdir)
This variable is only used if your vim is
earlier than 7.4 or if your vim doesn't
have patch#1107. Otherwise, delete()
is used with the "d" option.g:netrw_maxfilenamelen
=32 by default, selected so as to make long
listings fit on 80 column displays.
If your screen is wider, and you have file
or directory names longer than 32 bytes,
you may set this option to keep listings
columnar.g:netrw_mkdir_cmd
command for making a remote directory
via ssh (also see g:netrw_remote_mkdir)
default: "ssh USEPORT HOSTNAME mkdir"g:netrw_mousemaps
=1 (default) enables mouse buttons while
browsing to:
leftmouse : open file/directory
shift-leftmouse : mark file
middlemouse : same as P
rightmouse : remove file/directory
=0: disables mouse mapsg:netrw_nobeval
doesn't exist (default)
If this variable exists, then balloon
evaluation will be suppressed
(see 'ballooneval')g:netrw_sizestyle
not defined: actual bytes (default)
="b" : actual bytes (default)
="h" : human-readable (ex. 5k, 4m, 3g)
uses 1000 base
="H" : human-readable (ex. 5K, 4M, 3G)
uses 1024 base
The long listing (netrw-i) and query-file
maps (netrw-qf) will display file size
using the specified style.g:netrw_usetab
if this variable exists and is non-zero, then
the <tab>
map supporting shrinking/expanding a
Lexplore or netrw window will be enabled.
(see netrw-c-tab)g:netrw_remote_mkdir
command for making a remote directory
via ftp (also see g:netrw_mkdir_cmd)
default: "mkdir"g:netrw_retmap
if it exists and is set to one, then:
* if in a netrw-selected file, AND
* no normal-mode <2-leftmouse>
mapping exists,
then the <2-leftmouse>
will be mapped for easy
return to the netrw browser window.
example: click once to select and open a file,
double-click to return.<silent>
YourChoice <Plug>
NetrwReturn
and have another mapping instead of
<2-leftmouse>
to invoke the return.g:netrw_rm_cmd
command for removing remote files
default: "ssh USEPORT HOSTNAME rm"g:netrw_rmdir_cmd
command for removing remote directories
default: "ssh USEPORT HOSTNAME rmdir"g:netrw_rmf_cmd
command for removing remote softlinks
default: "ssh USEPORT HOSTNAME rm -f"g:netrw_servername
use this variable to provide a name for
netrw-ctrl-r to use for its server.
default: "NETRWSERVER"g:netrw_sort_by
sort by "name", "time", "size", or
"exten".
default: "name"g:netrw_sort_direction
sorting direction: "normal" or "reverse"
default: "normal"g:netrw_sort_options
sorting is done using :sort; this
variable's value is appended to the
sort command. Thus one may ignore case,
for example, with the following in your
.vimrc:let g:netrw_sort_options="i"
g:netrw_sort_sequence
when sorting by name, first sort by the
comma-separated pattern sequence. Note that
any filigree added to indicate filetypes
should be accounted for in your pattern.
default: '[\/]$,,\.bak$,\.o$,\.h$,
\.info$,\.swp$,\.obj$'g:netrw_special_syntax
If true, then certain files will be shown
using special syntax in the browser:.doc,
.txt,*.pdf,
.pdf,
.docx
netrwHdr : *.h
netrwLex : *.l *.lex
netrwLib : *.a *.so *.lib *.dll
netrwMakefile: [mM]akefile *.mak
netrwObj : *.o *.obj
netrwPix : .bmp,
.fit,.fits,
.gif,
.jpg,
.jpeg,.pcx,
.ppc
.pgm,
.png,.psd,
.rgb
.tif,
.xbm,*.xcf
netrwTags : tags ANmenu ANtags
netrwTilde : *
netrwTmp : tmp* *tmp
netrwYacc : *.yhi link netrwCompress Visual
.vim/after/syntax/netrw.vim.
* netrwGray has not been previously defined * the gui is running
hi netrwCompress term=NONE cterm=NONE gui=NONE ctermfg=10 guifg=green ctermbg=0 guibg=black hi netrwData term=NONE cterm=NONE gui=NONE ctermfg=9 guifg=blue ctermbg=0 guibg=black hi netrwHdr term=NONE cterm=NONE,italic gui=NONE guifg=SeaGreen1 hi netrwLex term=NONE cterm=NONE,italic gui=NONE guifg=SeaGreen1 hi netrwYacc term=NONE cterm=NONE,italic gui=NONE guifg=SeaGreen1 hi netrwLib term=NONE cterm=NONE gui=NONE ctermfg=14 guifg=yellow hi netrwObj term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red hi netrwTilde term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red hi netrwTmp term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red hi netrwTags term=NONE cterm=NONE gui=NONE ctermfg=12 guifg=red hi netrwDoc term=NONE cterm=NONE gui=NONE ctermfg=220 ctermbg=27 guifg=yellow2 guibg=Blue3 hi netrwSymLink term=NONE cterm=NONE gui=NONE ctermfg=220 ctermbg=27 guifg=grey60
g:netrw_ssh_browse_reject
ssh can sometimes produce unwanted lines,
messages, banners, and whatnot that one doesn't
want masquerading as "directories" and "files".
Use this pattern to remove such embedded
messages. By default its value is:
'^total\s\+\d\+$'g:netrw_ssh_cmd
One may specify an executable command
to use instead of ssh for remote actions
such as listing, file removal, etc.
default: sshg:netrw_suppress_gx_mesg
=1 : browsers sometimes produce messages
which are normally unwanted intermixed
with the page.
However, when using links, for example,
those messages are what the browser produces.
By setting this option to 0, netrw will not
suppress browser messages.g:netrw_tmpfile_escape
=' &;'
escape() is applied to all temporary files
to escape these characters.g:netrw_timefmt
specify format string to vim's strftime().
The default, "%c", is "the preferred date
and time representation for the current
locale" according to my manpage entry for
strftime(); however, not all are satisfied
with it. Some alternatives:
"%a %d %b %Y %T",
" %a %Y-%m-%d %I-%M-%S %p"
default: "%c"g:netrw_use_noswf
netrw normally avoids writing swapfiles
for browser buffers. However, under some
systems this apparently is causing nasty
ml_get errors to appear; if you're getting
ml_get errors, try putting
let g:netrw_use_noswf= 0
in your .vimrc.
default: 1g:netrw_winsize
specify initial size of new windows made with
"o" (see netrw-o), "v" (see netrw-v),
:Hexplore or :Vexplore. The g:netrw_winsize
is an integer describing the percentage of the
current netrw buffer's window to be used for
the new window.
If g:netrw_winsize is less than zero, then
the absolute value of g:netrw_winsize will be
used to specify the quantity of lines or
columns 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%)g:netrw_wiw
=1 specifies the minimum window width to use
when shrinking a netrw/Lexplore window
(see netrw-c-tab).g:netrw_xstrlen
Controls how netrw computes string lengths,
including multi-byte characters' string
length. (thanks to N Weibull, T Mechelynck)
=0: uses Vim's built-in strlen()
=1: number of codepoints (Latin a + combining
circumflex is two codepoints) (DEFAULT)
=2: number of spacing codepoints (Latin a +
combining circumflex is one spacing
codepoint; a hard tab is one; wide and
narrow CJK are one each; etc.)
=3: virtual length (counting tabs as anything
between 1 and 'tabstop', wide CJK as 2
rather than 1, Arabic alif as zero when
immediately preceded by lam, one
otherwise, etc)g:NetrwTopLvlMenu
This variable specifies the top level
menu name; by default, it's "Netrw.". If
you wish to change this, do so in your
.vimrc.:set acdis problematic. Autochdir sets the current directory to that containing the file you edit; this apparently also applies to directories. In other words, autochdir sets the current directory to that containing the "file" (even if that "file" is itself a directory).
:NetrwSettingswill bring up a window with the many variables that netrw uses for its 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 help on what each of the variables do.
let g:netrw_preview = 1 let g:netrw_liststyle = 3 let g:netrw_winsize = 30These will:
<c-l>
) or
hit the <cr>
when atop the ./ directory entry in the listing. One may also
refresh a local directory by using ":e .".mr [query: reply with *.c] R [query: reply with s/^\(.*\)\.c$/\1.cpp/]
<c-x> : a single ctrl-x tells netrw to ignore the portion of the response lying between the last '/' and the ctrl-x. <c-x><c-x> : a pair of contiguous ctrl-x's tells netrw to ignore any portion of the string preceding the double ctrl-x's.
g:netrw_rename_cmd
variable is used to implement remote renaming. By
default its value is:ssh HOSTNAME mv
<ctrl-f>
(initiates cmdline window editing) and <ctrl-c>
(uses the
command line under the cursor) useful in conjunction with the R command.let g:netrw_chgwin= -1will restore the default editing behavior (ie. subsequent editing will use the current window).
netrw-c-tab
{{{2<c-tab>
key will toggle a netrw or :Lexplore window's width,
but only if g:netrw_usetab exists and is non-zero (and, of course,
only if your terminal supports differentiating <c-tab>
from a plain
<tab>
).<c-tab>
, then the <c-tab>
will not be mapped. One may map something other
than a <c-tab>
, too: (but you'll still need to have had g:netrw_usetab set).nmap <unique> (whatever) <Plug>NetrwShrink
[["keymap-sequence","ExampleUserMapFunc"],...]
nno <buffer> <silent> KEYMAP-SEQUENCE :call s:UserMaps(islocal,"ExampleUserMapFunc")
fun! ExampleUserMapFunc(islocal)
netrw-call
netrw-expose
netrw-modify
Use netrw#Expose("varname") to access netrw-internal (script-local)
variables.
Use netrw#Modify("varname",newvalue) to change netrw-internal variables.
Use netrw#Call("funcname"[,args]) to call a netrw-internal function with
specified arguments.let netrwmarkfilelist= netrw#Expose("netrwmarkfilelist")
call netrw#Modify("netrwmarkfilelist",[])
" ExampleUserMap: {{{2 fun! ExampleUserMap(islocal) call netrw#Modify("netrwmarkfilelist",[]) call netrw#Modify('netrwmarkfilemtch_{bufnr("%")}',"") let retval= ["refresh"] return retval endfun let g:Netrw_UserMaps= [["gu","ExampleUserMap"]]
netrw-problems
{{{1netrw-p1
P1. I use windows 95, and my ftp dumps four blank lines at the {{{2
end of every read.netrw-p2
P2. I use Windows, and my network browsing with ftp doesn't sort by {{{2
time or size! -or- The remote system is a Windows server; why
don't I get sorts by time or size?let g:netrw_ftp_list_cmd = "ls -lF" let g:netrw_ftp_timelist_cmd= "ls -tlF" let g:netrw_ftp_sizelist_cmd= "ls -slF"
let g:netrw_cygwin= 1
netrw-p3
P3. I tried rcp://user@host/ (or protocol other than ftp) and netrw {{{2
used ssh! That wasn't what I asked for...netrw-p4
P4. I would like long listings to be the default. {{{2let g:netrw_liststyle= 1
netrw-p5
P5. My times come up oddly in local browsing {{{2let g:netrw_timefmt= "%X" (where X is the option)
netrw-p6
P6. I want my current directory to track my browsing. {{{2
How do I do that?let g:netrw_keepdir= 0
netrw-p7
P7. I use Chinese (or other non-ascii) characters in my filenames, {{{2
and netrw (Explore, Sexplore, Hexplore, etc) doesn't display them!netrw-p8
P8. I'm getting "ssh is not executable on your system" -- what do I {{{2
do?{asterisk}
.{asterisk} (all files), or whatever types
you want (cec: change {asterisk}
to * ; I had to
write it that way because otherwise the helptags
system thinks it's a tag)
<F4>
to edit a file in a local copy of gvim.
http://www.chiark.greenend.org.uk/~sgtatham/putty/0.60/htmldoc/Chapter8.html#pubkey-gettingready (8.3 Getting ready for public key authentication)
http://www.chiark.greenend.org.uk/~sgtatham/putty/0.60/htmldoc/Chapter5.html (5.2.4 Using public key authentication with PSCP)
netrw-p9
netrw-ml_get
P9. I'm browsing, changing directory, and bang! ml_get errors {{{2
appear and I have to kill vim. Any way around this?let g:netrw_use_noswf= 0
netrw-p10
P10. I'm being pestered with "[something] is a directory" and {{{2
"Press ENTER or type command to continue" prompts...netrw-p11
P11. I want to have two windows; a thin one on the left and my {{{2
editing window on the right. How may I accomplish this?<leftmouse>
in the browser window and then press the
<middlemouse>
to select the file.netrw-p12
P12. My directory isn't sorting correctly, or unwanted letters are {{{2
appearing in the listed filenames, or things aren't lining
up properly in the wide listing, ...netrw-p13
P13. I'm a Windows + putty + ssh user, and when I attempt to {{{2
browse, the directories are missing trailing "/"s so netrw treats
them as file transfers instead of as attempts to browse
subdirectories. How may I fix this?" list files, it's the key setting, if you haven't set, " you will get a blank buffer let g:netrw_list_cmd = "plink HOSTNAME ls -Fa" " if you haven't add putty directory in system path, you should " specify scp/sftp command. For examples: "let g:netrw_sftp_cmd = "d:\\dev\\putty\\PSFTP.exe" "let g:netrw_scp_cmd = "d:\\dev\\putty\\PSCP.exe"
netrw-p14
P14. I would like to speed up writes using Nwrite and scp/ssh {{{2
style connections. How? (Thomer M. Gil)# you change "*" to the hostname you care about Host * ControlMaster auto ControlPath /tmp/%r@%h:%p
ssh -N host.domain.com
vim scp://host.domain.com//home/user/.bashrc
netrw-p15
P15. How may I use a double-click instead of netrw's usual single {{{2
click to open a file or directory? (Ben Fritz)let g:netrw_mousemaps= 0
nmap <buffer> <2-leftmouse> <CR>
<leftmouse>
one.
(see g:netrw_mousemaps)netrw-p16
P16. When editing remote files (ex. :e ftp://hostname/path/file), {{{2
under Windows I get an E303 message complaining that its unable
to open a swap file.netrw-p17
P17. Netrw is closing buffers on its own. {{{2
What steps will reproduce the problem?
1. :Explore, navigate directories, open a file
2. :Explore, open another file
3. Buffer opened in step 1 will be closed. o
What is the expected output? What do you see instead?
I expect both buffers to exist, but only the last one does.netrw-P18
P18. How to locally edit a file that's only available via {{{2
another server accessible via ssh?
See http://stackoverflow.com/questions/12469645/
"Using Vim to Remotely Edit A File on ServerB Only
Accessible From ServerA"netrw-P19
P19. How do I get numbering on in directory listings? {{{2
With g:netrw_bufsettings, you can control netrw's buffer
settings; try puttinglet g:netrw_bufsettings="noma nomod nu nobl nowrap ro nornu"
let g:netrw_bufsettings="noma nomod nonu nobl nowrap ro rnu"
netrw-P20
P20. How may I have gvim start up showing a directory listing? {{{2
Try putting the following code snippet into your .vimrc:augroup VimStartup au! au VimEnter * if expand("%") == "" && argc() == 0 && \ (v:servername =~ 'GVIM\d*' || v:servername == "") \ | e . | endif augroup END
netrw-P21
P21. I've made a directory (or file) with an accented character, {{{2
but netrw isn't letting me enter that directory/read that file:au FileType netrw set enc=latin1
netrw-P22
P22. I get an error message when I try to copy or move a file: {{{2
**error** (netrw) tried using g:netrw_localcopycmd<cp>; it doesn't work!
/usr/local/share/vim/vim8x/plugin/netrwPlugin.vim /usr/local/share/vim/vim8x/autoload/netrw.vim (see output of :echo &rtp)
$HOME/.vim/plugin/netrwPlugin.vim $HOME/.vim/autoload/netrw.vim
set nocp so $HOME/.vim/plugin/netrwPlugin.vim
vim -u netrw.vimrc --noplugins -i NONE [some path here]
vim Decho.vba.gz :so % :q
vim netrw.vim :DechoOn :wq
vim netrw.vim :DechoOff :wq
set nocp so $HOME/.vim/plugin/Decho.vim so $HOME/.vim/plugin/netrwPlugin.vim
vim -u netrw.vimrc --noplugins -i NONE [some path here]
:w! DBG
:tabnext :set bt= :w! DBG
:Dsep <command>
<command>
is the command you're about to type next,
thereby making it easier to associate which part of the
debugging trace is due to which command.[email protected]
CTRL-^
)
after editing a file:// URL. Patch to
have a "keepalt" included.
Oct 17, 2017 * (Adam Faryna) reported that gn (netrw-gn)
did not work on directories in the current
tree
v157: Apr 20, 2016 * (Nicola) had set up a "nmap <expr>
..." with
a function that returned a 0 while silently
invoking a shell command. The shell command
activated a ShellCmdPost event which in turn
called s:LocalBrowseRefresh(). That looks
over all netrw buffers for changes needing
refreshes. However, inside a :map-<expr>,
tab and window changes are disallowed. Fixed.
(affects netrw's s:LocalBrowseRefresh())
* g:netrw_localrmdir not used any more, but
the relevant patch that causes delete() to
take over was #1107 (not #1109).
* expand() is now used on g:netrw_home;
consequently, g:netrw_home may now use
environment variables
* s:NetrwLeftmouse and s:NetrwCLeftmouse will
return without doing anything if invoked
when inside a non-netrw window
Jun 15, 2016 * gx now calls netrw#GX() which returns
the word under the cursor. The new
wrinkle: if one is in a netrw buffer,
then netrw's s:NetrwGetWord().
Jun 22, 2016 * Netrw was executing all its associated
Filetype commands silently; I'm going
to try doing that "noisily" and see if
folks have a problem with that.
Aug 12, 2016 * Changed order of tool selection for
handling http://... viewing.
(Nikolay Aleksandrovich Pavlov)
Aug 21, 2016 * Included hiding/showing/all for tree
listings
* Fixed refresh (^L) for tree listings
v156: Feb 18, 2016 * Changed =~ to =~# where appropriate
Feb 23, 2016 * s:ComposePath(base,subdir) now uses
fnameescape() on the base portion
Mar 01, 2016 * (gt_macki) reported where :Explore would
make file unlisted. Fixed (tst943)
Apr 04, 2016 * (reported by John Little) netrw normally
suppresses browser messages, but sometimes
those "messages" are what is wanted.
See g:netrw_suppress_gx_mesg
Apr 06, 2016 * (reported by Carlos Pita) deleting a remote
file was giving an error message. Fixed.
Apr 08, 2016 * (Charles Cooper) had a problem with an
undefined b:netrw_curdir. He also provided
a fix.
Apr 20, 2016 * Changed s:NetrwGetBuffer(); now uses
dictionaries. Also fixed the "No Name"
buffer problem.
v155: Oct 29, 2015 * (Timur Fayzrakhmanov) reported that netrw's
mapping of ctrl-l was not allowing refresh of
other windows when it was done in a netrw
window.
Nov 05, 2015 * Improved s:TreeSqueezeDir() to use search()
instead of a loop
* NetrwBrowse() will return line to
w:netrw_bannercnt if cursor ended up in
banner
Nov 16, 2015 * Added a <Plug>
NetrwTreeSqueeze (netrw-s-cr)
Nov 17, 2015 * Commented out imaps -- perhaps someone can
tell me how they're useful and should be
retained?
Nov 20, 2015 * Added netrw-ma and netrw-mA support
Nov 20, 2015 * gx (netrw-gx) on a URL downloaded the
file in addition to simply bringing up the
URL in a browser. Fixed.
Nov 23, 2015 * Added g:netrw_sizestyle support
Nov 27, 2015 * Inserted a lot of <c-u>
s into various netrw
maps.
Jan 05, 2016 * netrw-qL implemented to mark files based
upon location-lists; similar to netrw-qF.
Jan 19, 2016 * using - call delete(directoryname,"d") -
instead of using g:netrw_localrmdir if
v7.4 + patch#1107 is available
Jan 28, 2016 * changed to using winsaveview() and
winrestview()
Jan 28, 2016 * s:NetrwTreePath() now does a save and
restore of view
Feb 08, 2016 * Fixed a tree-listing problem with remote
directories
v154: Feb 26, 2015 * (Yuri Kanivetsky) reported a situation where
a file was not treated properly as a file
due to g:netrw_keepdir == 1
Mar 25, 2015 * (requested by Ben Friz) one may now sort by
extension
Mar 28, 2015 * (requested by Matt Brooks) netrw has a lot
of buffer-local mappings; however, some
plugins (such as vim-surround) set up
conflicting mappings that cause vim to wait.
The "<nowait>" modifier has been included
with most of netrw's mappings to avoid that
delay.
Jun 26, 2015 * netrw-gn mapping implemented
* :Ntree NotADir resulted in having
the tree listing expand in the error messages
window. Fixed.
Jun 29, 2015 * Attempting to delete a file remotely caused
an error with "keepsol" mentioned; fixed.
Jul 08, 2015 * Several changes to keep the :jumps table
correct when working with
g:netrw_fastbrowse set to 2
* wide listing with accented characters fixed
(using %-S instead of %-s with a printf()
Jul 13, 2015 * (Daniel Hahler) CheckIfKde() could be true
but kfmclient not installed. Changed order
in netrw#BrowseX(): checks if kde and
kfmclient, then will use xdg-open on a unix
system (if xdg-open is executable)
Aug 11, 2015 * (McDonnell) tree listing mode wouldn't
select a file in a open subdirectory.
* (McDonnell) when multiple subdirectories
were concurrently open in tree listing
mode, a ctrl-L wouldn't refresh properly.
* The netrw:target menu showed duplicate
entries
Oct 13, 2015 * (mattn) provided an exception to handle
windows with shellslash set but no shell
Oct 23, 2015 * if g:netrw_usetab and <c-tab>
now used
to control whether NetrwShrink is used
(see netrw-c-tab)
v153: May 13, 2014 * added another g:netrw_ffkeep usage {{{2
May 14, 2014 * changed s:PerformListing() so that it
always sets ft=netrw for netrw buffers
(ie. even when syntax highlighting is
off, not available, etc)
May 16, 2014 * introduced the netrw-ctrl-r functionality
May 17, 2014 * introduced the netrw-:NetrwMB functionality
* mb and mB (netrw-mb, netrw-mB) will
add/remove marked files from bookmark list
May 20, 2014 * (Enno Nagel) reported that :Lex <dirname>
wasn't working. Fixed.
May 26, 2014 * restored test to prevent leftmouse window
resizing from causing refresh.
(see s:NetrwLeftmouse())
* fixed problem where a refresh caused cursor
to go just under the banner instead of
staying put
May 28, 2014 * (László Bimba) provided a patch for opening
the :Lexplore window 100% high, optionally
on the right, and will work with remote
files.
May 29, 2014 * implemented :NetrwC (see netrw-:NetrwC)
Jun 01, 2014 * Removed some "silent"s from commands used
to implemented scp://... and pscp://...
directory listing. Permits request for
password to appear.
Jun 05, 2014 * (Enno Nagel) reported that user maps "/"
caused problems with "b" and "w", which
are mapped (for wide listings only) to
skip over files rather than just words.
Jun 10, 2014 * g:netrw_gx introduced to allow users to
override default "<cfile>" with the gx
(netrw-gx) map
Jun 11, 2014 * gx (netrw-gx), with 'autowrite' set,
will write modified files. s:NetrwBrowseX()
will now save, turn off, and restore the
'autowrite' setting.
Jun 13, 2014 * added visual map for gx use
Jun 15, 2014 * (Enno Nagel) reported that with having hls
set and wide listing style in use, that the
b and w maps caused unwanted highlighting.
Jul 05, 2014 * netrw-mv and netrw-mX commands included
Jul 09, 2014 * g:netrw_keepj included, allowing optional
keepj
Jul 09, 2014 * fixing bugs due to previous update
Jul 21, 2014 * (Bruno Sutic) provided an updated
netrw_gitignore.vim
Jul 30, 2014 * (Yavuz Yetim) reported that editing two
remote files of the same name caused the
second instance to have a "temporary"
name. Fixed: now they use the same buffer.
Sep 18, 2014 * (Yasuhiro Matsumoto) provided a patch which
allows scp and windows local paths to work.
Oct 07, 2014 * gx (see netrw-gx) when atop a directory,
will now do gf instead
Nov 06, 2014 * For cygwin: cygstart will be available for
netrw#BrowseX() to use if its executable.
Nov 07, 2014 * Began support for file://... urls. Will use
g:netrw_file_cmd (typically elinks or links)
Dec 02, 2014 * began work on having mc (netrw-mc) copy
directories. Works for linux machines,
cygwin+vim, but not for windows+gvim.
Dec 02, 2014 * in tree mode, netrw was not opening
directories via symbolic links.
Dec 02, 2014 * added resolved link information to
thin and tree modes
Dec 30, 2014 * (issue#231) :ls was not showing
remote-file buffers reliably. Fixed.
v152: Apr 08, 2014 * uses the 'noswapfile' option (requires {{{2
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 {{{2
prior to Explore or editing a directory
* (Ken Takata) netrw gave error when
clipboard was disabled. Sol'n: Placed
several if has("clipboard") tests in.
* Fixed ftp://X@Y@Z// problem; X@Y now
part of user id, and only Z is part of
hostname.
* (A Loumiotis) reported that completion
using a directory name containing spaces
did not work. Fixed with a retry in
netrw#Explore() which removes the
backslashes vim inserted.
Feb 26, 2014 * :Rexplore now records the current file
using w:netrw_rexfile when returning via
:Rexplore
Mar 08, 2014 * (David Kotchan) provided some patches
allowing netrw to work properly with
windows shares.
* Multiple one-liner help messages available
by pressing <cr>
while atop the "Quick
Help" line
* worked on ShellCmdPost, FocusGained event
handling.
* :Lexplore path: will be used to update
a left-side netrw browsing directory.
Mar 12, 2014 * netrw-s-cr: use <s-cr>
to close
tree directory implemented
Mar 13, 2014 * (Tony Mechylynck) reported that using
the browser with ftp on a directory,
and selecting a gzipped txt file, that
an E19 occurred (which was issued by
gzip.vim). Fixed.
Mar 14, 2014 * Implemented :MF and :MT (see netrw-:MF
and netrw-:MT, respectively)
Mar 17, 2014 * :Ntree [dir] wasn't working properly; fixed
Mar 18, 2014 * Changed all uses of set to setl
Mar 18, 2014 * Commented the netrw_btkeep line in
s:NetrwOptionSave(); the effect is that
netrw buffers will remain as 'bt'=nofile.
This should prevent swapfiles being created
for netrw buffers.
Mar 20, 2014 * Changed all uses of lcd to use s:NetrwLcd()
instead. Consistent error handling results
and it also handles Window's shares
* Fixed netrw-d command when applied with ftp
* https: support included for netrw#NetRead()
v150: Jul 12, 2013 * removed a "keepalt" to allow ":e #" to {{{2
return to the netrw directory listing
Jul 13, 2013 * (Jonas Diemer) suggested changing
a <cWORD>
to <cfile>
.
Jul 21, 2013 * (Yuri Kanivetsky) reported that netrw's
use of mkdir did not produce directories
following the user's umask.
Aug 27, 2013 * introduced g:netrw_altfile option
Sep 05, 2013 * s:Strlen() now uses strdisplaywidth()
when available, by default
Sep 12, 2013 * (Selyano Baldo) reported that netrw wasn't
opening some directories properly from the
command line.
Nov 09, 2013 * :Lexplore introduced
* (Ondrej Platek) reported an issue with
netrw's trees (P15). Fixed.
* (Jorge Solis) reported that "t" in
tree mode caused netrw to forget its
line position.
Dec 05, 2013 * Added <s-leftmouse>
file marking
(see netrw-mf)
Dec 05, 2013 * (Yasuhiro Matsumoto) Explore should use
strlen() instead s:Strlen() when handling
multibyte chars with strpart()
(ie. strpart() is byte oriented, not
display-width oriented).
Dec 09, 2013 * (Ken Takata) Provided a patch; File sizes
and a portion of timestamps were wrongly
highlighted with the directory color when
setting :let g:netrw_liststyle=1
on Windows.
* (Paul Domaskis) noted that sometimes
cursorline was activating in non-netrw
windows. All but one setting of cursorline
was done via setl; there was one that was
overlooked. Fixed.
Dec 24, 2013 * (esquifit) asked that netrw allow the
/cygdrive prefix be a user-alterable
parameter.
Jan 02, 2014 * Fixed a problem with netrw-based balloon
evaluation (ie. netrw#NetrwBalloonHelp()
not having been loaded error messages)
Jan 03, 2014 * Fixed a problem with tree listings
* New command installed: :Ntree
Jan 06, 2014 * (Ivan Brennan) reported a problem with
netrw-P. Fixed.
Jan 06, 2014 * Fixed a problem with netrw-P when the
modified file was to be abandoned.
Jan 15, 2014 * (Matteo Cavalleri) reported that when the
banner is suppressed and tree listing is
used, a blank line was left at the top of
the display. Fixed.
Jan 20, 2014 * (Gideon Go) reported that, in tree listing
style, with a previous window open, that
the wrong directory was being used to open
a file. Fixed. (P21)
v149: Apr 18, 2013 * in wide listing format, now have maps for {{{2
w and b to move to next/previous file
Apr 26, 2013 * one may now copy files in the same
directory; netrw will issue requests for
what names the files should be copied under
Apr 29, 2013 * Trying Benzinger's problem again. Seems
that commenting out the BufEnter and
installing VimEnter (only) works. Weird
problem! (tree listing, vim -O Dir1 Dir2)
May 01, 2013 * :Explore ftp://... wasn't working. Fixed.
May 02, 2013 * introduced g:netrw_bannerbackslash as
requested by Paul Domaskis.
Jul 03, 2013 * Explore now avoids splitting when a buffer
will be hidden.
v148: Apr 16, 2013 * changed Netrw's Style menu to allow direct {{{2
choice of listing style, hiding style, and
sorting style