Zsh Mailing List Archive
Messages sorted by:
Re: "Literal" command execution
- X-seq: zsh-users 16741
- From: Damien Thébault <damien.thebault@xxxxxxxxx>
- To: "Yuri D'Elia" <wavexx@xxxxxxxxxxxx>
- Subject: Re: "Literal" command execution
- Date: Mon, 23 Jan 2012 23:13:52 +0100
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=Eed7zO5/3NMSOyqcOCzb9UYj4p2pMNBUh6sX4OA9fNQ=; b=CKEFxCBFx9bcZ7NwjyjalZabU0L5iXHV1pjnfXoFVsukptNyN6mnt8aAqPfo8yI7Sq U+4KAaHFZKVf8znTgapJA3Amh4z6nEmrw7HmF7SCToM77EbaIaKSelXKpOiLSb6KetSO L43HNXLrI4fbd/5fHKAKyl+dHxFvPHR9i6BUY=
- In-reply-to: <firstname.lastname@example.org>
- List-help: <mailto:email@example.com>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:firstname.lastname@example.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <email@example.com>
On Mon, Jan 23, 2012 at 20:51, Yuri D'Elia <wavexx@xxxxxxxxxxxx> wrote:
> I'm trying to reduce some typing here, as usual ;).
> I have a command line logger that allows free text as its main arguments (random example: taskwarrior). A typical example might be:
> command log [free text follows]
> I want to reduce escaping to the bare minimum. Dollars are not really a problem, but I discovered myself to escape '<' '>' and '!' too often.
> Of course I am already aware of both noglob and nocorrect, but I would need something more extreme, as in "feed whatever text, including #, etc, that follows the command as arguments".
> Is there any way to achieve that?
> Maybe by some rewriting trick?
For URLs I'm using something called url-quote-magic: when I start
writing an URL, it's detected and then all special characters are
escaped (&, <, >, !).
autoload -U url-quote-magic ; zle -N self-insert url-quote-magic
This is really great for copying+pasting URLs, for example to use it in wget.
What you want to do looks pretty similar, so maybe this could be a
starting point for you? (except it's during a specific command
arguments instead of autodetected)
Messages sorted by: