Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Change interactive command into a comment
- X-seq: zsh-users 24433
- From: Perry Smith <pedz@xxxxxxxxxxxxxxxx>
- To: Danh Doan <congdanhqx@xxxxxxxxx>
- Subject: Re: Change interactive command into a comment
- Date: Thu, 14 Nov 2019 07:19:01 -0600
- Cc: zsh-users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=easesoftware.com; s=default; h=References:To:Cc:In-Reply-To:Date:Subject: Mime-Version:Content-Type:Message-Id:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=XpmKJbkw8QTHYgYyETJhucQ3E66UpNo2hm7fKFa2fIM=; b=Zp8uS4wljfd5w2Gp/TsLtF1PJ bXSn2b9m+w2UxqamZh9+PL+01mzpWpJF/OhmDSybkj0v9pHw5qEP4N11TYyN4Y6Ikc35eNsYM0qxb +54H3Y8qtvHufTe3esQ8rlryOaG9MEDA+eE0ldsPyHiHDTGoNv9j/dpgxwUQOVoBKpdDqOnLarRf/ JJnEx6gfafVXrrJU4OhTV+uMqYJPqzEb5cmH1O9feM3YZAoGFrAMOM4dQgVX6K12PHizG2uoni3EL KVW0cKncI4lX7I3+WQfpOVAp02dJ64gqR1Fx4Q4j3NEAw1KtIAdOY7xMcnUZqo3tdQOZc9eT3+4NB ITlM23SEw==;
- In-reply-to: <20191114044120.GA7796@danh.dev>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <AE14DF7F-5C34-4D14-A20A-8356C547E114@easesoftware.com> <20191114044120.GA7796@danh.dev>
> On Nov 13, 2019, at 10:41 PM, Danh Doan <congdanhqx@xxxxxxxxx> wrote:
>
> On 2019-11-13 12:34:35 -0600, Perry Smith wrote:
>> With bash, I got into the following habit. If I started typing
>> a long command and then decided I didn’t want to execute it right
>> now for some reason, I would hit control-A to get back to the start
>> of the line and then add a # in front and hit return.
>>
>> This would put the command into history and so later I could recall
>> it, remove the #, and execute the command.
>
> Not an answer for your question, but this piece of code from grml zsh
> config may interest you:
>
> -------8<-----------------------
>
> # add a command line to the shells history without executing it
> commit-to-history () {
> print -s ${(z)BUFFER}
> zle send-break
> }
> zle -N commit-to-history
> bindkey -M viins "^x^h" commit-to-history
> bindkey -M emacs "^x^h" commit-to-history
>
> -------8<------------------------
>
> With this piece of code in your zshrc, you could press C-x C-h to
> commit your current command to history without executing it.
Cool! Thanks.
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
Messages sorted by:
Reverse Date,
Date,
Thread,
Author