On Oct 18, 7:21 am, Tim Chase <[email protected]> wrote: > On 10/18/11 06:50, Elias Diem wrote: > > > Without giving the '-' argument to 'less'. Why doesn't this work > > with vim? > > Because Vim can take piped commands: > > [2]tim@bigbox:~/tmp$ seq 10 > test.txt > [3]tim@bigbox:~/tmp$ (echo ':5s/$/five'; echo ":wq") | vi test.txt > Vim: Warning: Input is not from a terminal > [4]tim@bigbox:~/tmp$ cat test.txt > 1 > 2 > 3 > 4 > 5five > 6 > 7 > 8 > 9 > 10 >
WHAT?! That is one of the coolest thing I've learned on the list in a while. Of course, I have no idea when I'd ever use such a thing. Does it also work for normal-mode commands? Sadly, even your simple example doesn't seem work on the Solaris server which I use at work (I get a "Vim: Error reading input, exiting..." message), so I cannot test it myself. -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php
