Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Change interactive command into a comment
- X-seq: zsh-users 24435
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Perry Smith <pedz@xxxxxxxxxxxxxxxx>
- Subject: Re: Change interactive command into a comment
- Date: Thu, 14 Nov 2019 15:40:13 +0000
- Cc: Danh Doan <congdanhqx@xxxxxxxxx>, zsh-users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:to:cc:subject:message-id :references:mime-version:content-type:content-transfer-encoding :in-reply-to; s=fm1; bh=vnq0VwOwh6sNu+A1gAn3C64WWW0jMJE3VpahkQbI 0bo=; b=UpDBE8kkNYNJN/M9rEmp6TAOJATARuUft2wljrnDDRykHBsVmx7+6QPS Q6n1+QBOvyBeWQgI2D0F6YwrlTVg0fbiCk8bTxuAD1xQptvTBDZ8o1Y+fQs4aJ6W ZCS29MiXtTh0wUJ/Tv02/CFVosBSgUrK+F7+ZnAKwSe7AkfIO/vOU2kdCB63L5zL 3gWVzyP7ZARdA66IqVqUCvcrhTJ9Sl9ia4wXFexJArHJQfbyvvXl7JqfWm6Sjy8R 8lAJQ7Z588JVgyniasQzDkVrMuuQJBlnIpoivwsy+lFZfbKHIksrDW4Hdqf6ejUx Ugn8a+5Z5bbb5R0RPkRURQ3NE5ZK1Q==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=vnq0VwOwh6sNu+A1gAn3C64WWW0jMJE3VpahkQbI0 bo=; b=r/5C+GihpWluydcZCcBSE72e5v6/nWc6/OZViv8OJdmJKs/I2cxMKswRl 81y9zPb3/ndqD+a2DGYJw7YwSRseq0wVSCBk9F1i//I/v+58k6qh8n7ESOImHGaC 7amc/K7Dm6bI/JgtVgAVCASaAcncCol6Hy2sW/RjJLy7G7PH9HAevpmu56Evk9gK 4jnNYa7tZoNv934S7iREEdW6Xl76SfSG0CZWemfEmzHEedlWdT0KaWWlfaX8Mfm0 rCzR4K+f6tg7ubhD4Jxeo1X8D17SAUk9+muXG2ox3Qo3Eeksfsjo+5LcV9VR40sC 0Oqv8Fe2/4J11uLRm2EFrVON9YIyA==
- In-reply-to: <91E3129F-1C3C-46FD-BAD9-3FF5F073455D@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> <20191114044120.GA7796@danh.dev> <91E3129F-1C3C-46FD-BAD9-3FF5F073455D@easesoftware.com>
Perry Smith wrote on Thu, Nov 14, 2019 at 07:19:01 -0600:
>
>
> > 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.
Shouldn't it be «print -rs -- ${(z)BUFFER}»?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author