From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 338c12dc for ; Thu, 14 Nov 2019 04:42:08 +0000 (UTC) Received: (qmail 17734 invoked by alias); 14 Nov 2019 04:41:58 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 24428 Received: (qmail 11643 invoked by uid 1010); 14 Nov 2019 04:41:58 -0000 X-Qmail-Scanner-Diagnostics: from mail-pl1-f175.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.0/25628. spamassassin: 3.4.2. Clear:RC:0(209.85.214.175):SA:0(-2.0/5.0):. Processed in 2.315922 secs); 14 Nov 2019 04:41:58 -0000 X-Envelope-From: congdanhqx@gmail.com X-Qmail-Scanner-Mime-Attachments: |signature.asc| X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.214.175 as permitted sender) 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== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=6yXFjq70qlzoG0+eWXh3DtyJcW8nR4q+9RRPTBQphu8=; b=CtBkukIwpSzSxgknmdbFKHfYFFWv6KKabMzF0rUCYewS9IQlOnagqugWZAd0P4/BiC /nNRu5ZGUWUn7VIBXLBBePXtHL0XHHPfQnYat6j8LydsyN0Jh7tLMh1V9Cv+u1vb5QaF zd1DqAiOFCKDW9KLx5/L3d6nkX7JV7++5+n8t4xr4IO8sPTiFIZ12ABTS955mYqaIgkg a/NWmxjEl9ivmjFhjxYhQXUMJfB3AZ6TjztLfLoDP3o/SczBrPay/z8DNrUtayPftSV+ DBcBUdq4EmhWwWla5kR4FqQ28hUwF/LYClS1PyHViZ3TFdEI5xWfWPqB+1olvC8i1OjG lsjw== X-Gm-Message-State: APjAAAW7/YVAcsG5qYcDPSLg2552RQesBgXNDtSBPwi2RAkJer7thN4G qaPmSVrrktkLs642zzYZ8Xq9oDiX X-Google-Smtp-Source: APXvYqzs0piIUjc3e31Zz6n0k1hbP7SDUqpotRb6aeYTeGh2fQ8YUugtcuL2RDsmsPmxn1j5cEc2xg== X-Received: by 2002:a17:902:7898:: with SMTP id q24mr7613701pll.3.1573706483867; Wed, 13 Nov 2019 20:41:23 -0800 (PST) Date: Thu, 14 Nov 2019 11:41:20 +0700 From: Danh Doan To: Perry Smith Cc: zsh-users Subject: Re: Change interactive command into a comment Message-ID: <20191114044120.GA7796@danh.dev> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Nq2Wo0NMKNjxTN9z" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) --Nq2Wo0NMKNjxTN9z Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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=E2=80=99t 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. >=20 > 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=C2=A0C-h to commit your current command to history without executing it. --=20 Danh --Nq2Wo0NMKNjxTN9z Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQTY0nhpo2VPuqOAxvIvwMbAAtddTgUCXcza8AAKCRAvwMbAAtdd TnGLAP9lfd1/TRAlj2Vhiyn3z1VGU7iQ3HA3sthTgRx+Fj//XAEAu7wfJ2wTAHtD CkCHQu1eQ7DwTB7lf4+r7pvxzVRFlQ4= =P0JQ -----END PGP SIGNATURE----- --Nq2Wo0NMKNjxTN9z--