On Fri, Jun 30, 2017 at 11:30:23AM -0400, [email protected] wrote: > Let's say I input 10 lines of text, and then I need to filter that text > through a specific command. So I go to the top line and do this > > :,+9!command
In vile.hlp, that's Anywhere a filename is valid, a command name is also valid, entered in the form "!shell-command". The whole line is handed to the shell, and the read or write operation is done on the commands standard input or output, as appropriate. Thus you can type ":e !date" to edit a copy of today's date. The ": !cmd" shell escape works pretty much as it does in vi. The command ":!!" will rerun the previous such shell command. The '!' operator works as a filter, as expected. (I noticed a missing "'" just in answering...) > Is there a way that I can save a step -- some kind of special "i" or "o" > command that will run a filter on each line of text as I enter it? I don't believe you can do this (without some change to vile). The I/O connections in that area are "hard", not "soft" (scriptable). Pipes are one-direction; vile's using pipes... > I'm vaguely familiar with ^X-! , but as far as I can tell, it doesn't > pass stdin to the command. right - that opens a pipe to the command, duplicating the output onto the error file-descriptor (so but stdout/stderr are captured). That's done in npopen.c: https://github.com/ThomasDickey/vile-snapshots/blob/master/npopen.c -- Thomas E. Dickey <[email protected]> http://invisible-island.net ftp://invisible-island.net
signature.asc
Description: Digital signature
_______________________________________________ vile mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/vile
