Home Explore Blog CI



neovim

3rd chunk of `runtime/pack/dist/opt/netrw/doc/netrw.txt`
2ad9fbd7b6bfa307a727f68a56ab9b60cd7fb553ecb736270000000100000fa5
      Marked Files: Target Directory Using History........|netrw-Th|
      Marked Files: Unmarking.............................|netrw-mu|
      Netrw Browser Variables.............................|netrw-browser-var|
      Netrw Browsing And Option Incompatibilities.........|netrw-incompatible|
      Netrw Settings Window...............................|netrw-settings-window|
      Obtaining A File....................................|netrw-O|
      Preview Window......................................|netrw-p|
      Previous Window.....................................|netrw-P|
      Refreshing The Listing..............................|netrw-ctrl-l|
      Reversing Sorting Order.............................|netrw-r|
      Renaming Files Or Directories.......................|netrw-R|
      Selecting Sorting Style.............................|netrw-s|
      Setting Editing Window..............................|netrw-C|
10. Problems and Fixes....................................|netrw-problems|
11. Credits...............................................|netrw-credits|

==============================================================================
2. Starting With Netrw					*netrw-start* {{{1

Netrw makes reading files, writing files, browsing over a network, and
local browsing easy!  First, make sure that you have plugins enabled, so
you'll need to have at least the following in your <.vimrc>:
(or see |netrw-activate|) >

	set nocp                    " 'compatible' is not set
	filetype plugin on          " plugins are enabled
<
(see |'cp'| and |:filetype-plugin-on|)

Netrw supports "transparent" editing of files on other machines using urls
(see |netrw-transparent|). As an example of this, let's assume you have an
account on some other machine; if you can use scp, try: >

	vim scp://hostname/path/to/file
<
Want to make ssh/scp easier to use? Check out |netrw-ssh-hack|!

So, what if you have ftp, not ssh/scp?  That's easy, too; try >

	vim ftp://hostname/path/to/file
<
Want to make ftp simpler to use?  See if your ftp supports a file called
<.netrc> -- typically it goes in your home directory, has read/write
permissions for only the user to read (ie. not group, world, other, etc),
and has lines resembling >

	machine HOSTNAME login USERID password "PASSWORD"
	machine HOSTNAME login USERID password "PASSWORD"
	...
	default          login USERID password "PASSWORD"
<
Windows' ftp doesn't support .netrc; however, one may have in one's .vimrc:  >

   let g:netrw_ftp_cmd= 'c:\Windows\System32\ftp -s:C:\Users\MyUserName\MACHINE'
<
Netrw will substitute the host's machine name for "MACHINE" from the URL it is
attempting to open, and so one may specify >
	userid
	password
for each site in a separate file: c:\Users\MyUserName\MachineName.

Now about browsing -- when you just want to look around before editing a
file.  For browsing on your current host, just "edit" a directory: >

	vim .
	vim /home/userid/path
<
For browsing on a remote host, "edit" a directory (but make sure that
the directory name is followed by a "/"): >

	vim scp://hostname/
	vim ftp://hostname/path/to/dir/
<
See |netrw-browse| for more!

There are more protocols supported by netrw than just scp and ftp, too: see the
next section, |netrw-externapp|, on how to use these external applications with
netrw and vim.

PREVENTING LOADING					*netrw-noload*

If you want to use plugins, but for some reason don't wish to use netrw, then
you need to avoid loading both the plugin and the autoload portions of netrw.
You may do so by placing the following two lines in your <.vimrc>: >

	:let g:loaded_netrw       = 1
	:let g:loaded_netrwPlugin = 1
<

==============================================================================
3. Netrw Reference					*netrw-ref* {{{1

   Netrw supports several protocols in addition to scp and ftp as mentioned
   in |netrw-start|.  These include dav, fetch, http,... well, just look
   at the list in |netrw-externapp|.  Each protocol is associated with a
   variable

Title: Netrw Commands, Configuration, and Setup
Summary
This section covers the remaining Netrw commands (target directory using history, unmarking), variables, incompatibilities, settings window, obtaining files, preview/previous windows, refreshing, reversing sort, renaming, selecting sort, setting editing window, problems/fixes, and credits. It then details how to start using Netrw, ensuring plugins are enabled and demonstrating transparent remote file editing using scp and ftp URLs. It explains using .netrc for simplified FTP access and provides guidance for browsing local and remote directories. It mentions additional supported protocols and how to prevent Netrw from loading. Finally, it introduces Netrw's reference section, highlighting its support for various protocols.