Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Substituting grep (and other) output to open files in Vim
- X-seq: zsh-users 16019
- From: "Benjamin R. Haskell" <zsh@xxxxxxxxxx>
- To: Richard Hartmann <richih.mailinglist@xxxxxxxxx>
- Subject: Re: Substituting grep (and other) output to open files in Vim
- Date: Tue, 10 May 2011 14:58:02 -0400 (EDT)
- Cc: Mikael Magnusson <mikachu@xxxxxxxxx>, zsh-users@xxxxxxx
- In-reply-to: <BANLkTi=ZWhzwPxwifvPrB24BvQa1S+rUew@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <BANLkTik+65NedRoVNJMgj9+Oma_XDmz8dA@mail.gmail.com> <alpine.LNX.2.01.1105101119570.28316@hp> <BANLkTinBSbTUF70SmVuPi22bKLOqqOK=JQ@mail.gmail.com> <BANLkTi=ZWhzwPxwifvPrB24BvQa1S+rUew@mail.gmail.com>
On Tue, 10 May 2011, Richard Hartmann wrote:
On Tue, May 10, 2011 at 19:37, Mikael Magnusson wrote:
At least in my case, this is compiler errors/warnings output, and
similar. It's nice to just cut and paste the thing without munging
the :123: to +123 manually.
Exactly. And half a dozen other use cases where it's faster to simply
copy & paste.
Okay. The reason I asked, and it's validated by the responses, is that
maybe you can handle this functionality at a different layer than Zsh.
E.g. through your terminal emulator. rxvt-unicode, for example, allows
you to write Perl extensions that can do things with the selection.
So, instead of:
1. highlight text w/ mouse
2. type 'vim ' in the shell
3. paste selection (presumably middle-click pasting)
4. hit Enter (Zsh munges pasted selection to what you want)
You could:
1. highlight text w/ mouse
2. Ctrl+right click
3. pick the "launch in vim" option (provided by a hypothetical Perl
extension)
Generally, the things I've written like this are to pop things up in a
browser, but popping things up in vim in a terminal wouldn't be too much
harder.
Or, you could run `make` from within Vim itself which already handles a
lot of these type of problems. (That one really depends on the workflow
and/or source.)
Not really trying to dissuade you from the pretty-straightforward Zsh
solution. Just wanted to point out some possibilities (and double-check
that it wasn't as simple as the array-vs.-string thing).
--
Best,
Ben
Messages sorted by:
Reverse Date,
Date,
Thread,
Author