screen-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: piping files to vim command line, results in dead screen


From: Adam Monsen
Subject: Re: piping files to vim command line, results in dead screen
Date: Wed, 11 Aug 2004 11:07:56 -0700

Joe's right, this isn't a screen issue.

When you pipe anything to vi, the default is to try to execute
commands since the user can't possibly interact with a disconnected
terminal (ie: if Vi was run from within a script), so it probably
emulates 'ex'. See:
http://lists.debian.org/debian-user/2002/01/msg01602.html

The best way to get out of this situation it to avoid it. (yeah, I
know that logic doesn't work)

Try:
vi `find blah|grep blahh|cut dodah`
Or:
for i in `find blah|grep blahh|cut dodah`; do echo "EDITING $i ..." ;
vi $i; done

If you have Vim, try my personal favorite:
find blah|grep blahh|cut dodah | vim -

...but this just gives you a file list. Perfect! Put the cursor over
the file you want to edit and hit 'gf'. For more info on this, try
':help gf' from within Vim. Even better, map 'gf' to split the window
with the new file in the other window, then just close the new window
to get back to the filelist.

Put this in your ~/.vimrc:
map gf :split <cfile><CR>

On Wed, 11 Aug 2004 17:05:37 +1000, Zenaan Harkness <address@hidden> wrote:
> When I pipe multiple files to vi, via xargs (with a find, may be a cut,
> etc), eg:
> 
> find blah|grep blahh|cut dodah|xargs vi -o
> 
> that works, although vi says "input not from terminal", or may be
> "output" I don't remember, and when I exit the last file from within vi,
> my screen is kind of dead. I can change to other screens, go into copy
> mode, and issue : commands.
> 
> I end up in this sort of copy mode, but it's not, and it's not my bash
> prompt either.
> 
> :break and :reset don't do anything.
> 
> :kill obviously kills the screen, but that's not exactly what I want -
> so, is there a better way?
> 
> tia
> zen
> 
> _______________________________________________
> screen-users mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/screen-users
> 


-- 
Adam Monsen <address@hidden>
http://adammonsen.com/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]