Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Change interactive command into a comment
- X-seq: zsh-users 24428
- From: Danh Doan <congdanhqx@xxxxxxxxx>
- To: Perry Smith <pedz@xxxxxxxxxxxxxxxx>
- Subject: Re: Change interactive command into a comment
- Date: Thu, 14 Nov 2019 11:41:20 +0700
- Cc: zsh-users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=6yXFjq70qlzoG0+eWXh3DtyJcW8nR4q+9RRPTBQphu8=; b=Ifw5XthIj4158MCPaRjR950JmbbXRaTnoseiqATIQKNpq/KZo1uJo7XaJQBoV6POTe im6dxYuCGXB065eLsb9N7MjwupI65ch4zt8mb2MaElqVYDDcVDmFnj+st7LHSldwSrMd Jd2QFs+zmIp42+wzeJ94bfiPe/Q62IotDdPvXgkAIIIsPE1dmCPbxc4ERBlR2D4r7Q0O T/i7mWJ20+de3NXtHCKvFRdIyk+CLScyCSIF8WWnOWlLnQspoR7mNLBaAd8qT+OdFZjd HnvCs77Il1CDqV3o5yVqt/WKp2u8Q49xmM3hCbDOfJdeXNu3n5I3GlY73++OvDVhQ4q8 Zalg==
- In-reply-to: <AE14DF7F-5C34-4D14-A20A-8356C547E114@easesoftware.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>
- 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>
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.
--
Danh
Attachment:
signature.asc
Description: PGP signature
Messages sorted by:
Reverse Date,
Date,
Thread,
Author