From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28319 invoked by alias); 10 May 2011 18:58:34 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 16019 Received: (qmail 13358 invoked from network); 10 May 2011 18:58:32 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at benizi.com designates 64.130.10.15 as permitted sender) Date: Tue, 10 May 2011 14:58:02 -0400 (EDT) From: "Benjamin R. Haskell" To: Richard Hartmann cc: Mikael Magnusson , zsh-users@zsh.org Subject: Re: Substituting grep (and other) output to open files in Vim In-Reply-To: Message-ID: References: User-Agent: Alpine 2.01 (LNX 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed 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