Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Substituting grep (and other) output to open files in Vim

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).


Messages sorted by: Reverse Date, Date, Thread, Author