Home Explore Blog CI



neovim

31th chunk of `runtime/pack/dist/opt/netrw/doc/netrw.txt`
7581e1509a462798c7bb709427c5a8c864e5d337b4c065330000000100000fa1
 ".  You may then enter a shell-style regular expression such
as *.c$ (see |glob()|).  For remote systems, glob() doesn't work -- so netrw
converts "*" into ".*" (see |regexp|) and marks files based on that.  In the
future I may make it possible to use |regexp|s instead of glob()-style
expressions (yet-another-option).

See |cmdline-window| for directions on more on how to edit the regular
expression.


MARKED FILES, ARBITRARY VIM COMMAND				*netrw-mv*  {{{2
	    (See |netrw-mf| and |netrw-mr| for how to mark files)
		      (uses the local marked-file list)

The "mv" map causes netrw to execute an arbitrary vim command on each file on
the local marked file list, individually:

	* 1split
	* sil! keepalt e file
	* run vim command
	* sil! keepalt wq!

A prompt, "Enter vim command: ", will be issued to elicit the vim command you
wish used.  See |cmdline-window| for directions for more on how to edit the
command.


MARKED FILES, ARBITRARY SHELL COMMAND				*netrw-mx* {{{2
	    (See |netrw-mf| and |netrw-mr| for how to mark files)
		      (uses the local marked-file list)

Upon activation of the "mx" map, netrw will query the user for some (external)
command to be applied to all marked files.  All "%"s in the command will be
substituted with the name of each marked file in turn.  If no "%"s are in the
command, then the command will be followed by a space and a marked filename.

Example:
	(mark files)
	mx
	Enter command: cat

	The result is a series of shell commands:
	cat 'file1'
	cat 'file2'
	...


MARKED FILES, ARBITRARY SHELL COMMAND, EN BLOC			*netrw-mX* {{{2
	    (See |netrw-mf| and |netrw-mr| for how to mark files)
		      (uses the global marked-file list)

Upon activation of the 'mX' map, netrw will query the user for some (external)
command to be applied to all marked files on the global marked file list.  The
"en bloc" means that one command will be executed on all the files at once: >

	command files

This approach is useful, for example, to select files and make a tarball: >

	(mark files)
	mX
	Enter command: tar cf mynewtarball.tar
<
The command that will be run with this example:

	tar cf mynewtarball.tar 'file1' 'file2' ...


MARKED FILES: ARGUMENT LIST				*netrw-ma* *netrw-mA*
	    (See |netrw-mf| and |netrw-mr| for how to mark files)
		      (uses the global marked-file list)

Using ma, one moves filenames from the marked file list to the argument list.
Using mA, one moves filenames from the argument list to the marked file list.

See Also: |netrw-cb| |netrw-cB| |netrw-qF| |argument-list| |:args|


MARKED FILES: BUFFER LIST				*netrw-cb* *netrw-cB*
	    (See |netrw-mf| and |netrw-mr| for how to mark files)
		      (uses the global marked-file list)

Using cb, one moves  filenames from the marked file list to the buffer list.
Using cB, one copies filenames from the buffer list to the marked file list.

See Also: |netrw-ma| |netrw-mA| |netrw-qF| |buffer-list| |:buffers|


MARKED FILES: COMPRESSION AND DECOMPRESSION		*netrw-mz* {{{2
	    (See |netrw-mf| and |netrw-mr| for how to mark files)
		      (uses the local marked file list)

If any marked files are compressed,   then "mz" will decompress them.
If any marked files are decompressed, then "mz" will compress them
using the command specified by |g:netrw_compress|; by default,
that's "gzip".

For decompression, netrw uses a |Dictionary| of suffices and their
associated decompressing utilities; see |g:netrw_decompress|.

Remember that one can mark multiple files by regular expression
(see |netrw-mr|); this is particularly useful to facilitate compressing and
decompressing a large number of files.

Associated setting variables: |g:netrw_compress| |g:netrw_decompress|

MARKED FILES: COPYING						*netrw-mc* {{{2
	    (See |netrw-mf| and |netrw-mr| for how to mark files)
		      (Uses the global marked file list)

Select a target directory with mt (|netrw-mt|).  Then change directory,
select file(s) (see |netrw-mf|), and press "mc".  The copy is done
from the current window

Title: Netrw: Advanced Marked File Operations - Shell Commands, Argument/Buffer Lists, Compression/Decompression, and Copying
Summary
This section outlines advanced operations on marked files within Netrw. It describes executing arbitrary shell commands on marked files individually ('mx') or en bloc ('mX'), as well as moving filenames between the marked file list and the argument list ('ma', 'mA') or buffer list ('cb', 'cB'). Additionally, it covers compression/decompression ('mz') of marked files and copying marked files to a specified target directory ('mc'), utilizing regular expressions for marking multiple files efficiently. Relevant configuration variables such as g:netrw_compress and g:netrw_decompress are also mentioned.