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 16018
- From: Richard Hartmann <richih.mailinglist@xxxxxxxxx>
- To: Jérémie Roquet <arkanosis@xxxxxxxxx>
- Subject: Re: Substituting grep (and other) output to open files in Vim
- Date: Tue, 10 May 2011 20:16:26 +0200
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=01NIqW2899MPHcFqO7GMgKnrTxRprZj306r6BMpXNlY=; b=dWVAjppQGkCxinOTS4oFLGtHxuFXtQx5XBRbFJpYHALbw/LYREpHukitlRtApvsqxd Y3CyxRRHwszYgrpkMEYf7zX9k8nQTQ/5UEl67rsqdW6cVtdm4kc+gSDvdkuRsVbrse9e frftBjJ+YaSg5yuzO+JgAv+SFneYExXtQ9CXo=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=WD5NOfBxCWq5FAXCX/4dX/mdhEUh2OlO4f2BmCtUnolcVuew5PqYRmSjNx1TIZrZF8 Sm0IXC0o0Q/d1FR7Y9wI82oiPH6PE3aRRy/+fhRzVNxSnU4dUgp9YLkcgfV//tzGC5yC 0J2VQ2kdgJLUJWxjuBL52iPZe0A10JwuvOeRc=
- In-reply-to: <BANLkTik0-EfNso_Qu_rHZBS=6z_Zo9cs_g@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> <BANLkTik0-EfNso_Qu_rHZBS=6z_Zo9cs_g@mail.gmail.com>
2011/5/10 Jérémie Roquet <arkanosis@xxxxxxxxx>:
> vim() {
> if test -r $1; then
> command vim $1
> else
> args=(${(s.:.)1})
> [[ $args[2] = <-> ]] && command vim $args[1] +$args[2] || command
> vim $args[1]
> fi
> }
Perfect, thanks.
Richard
Messages sorted by:
Reverse Date,
Date,
Thread,
Author