From b28a9ffd7f5ad83fba4d58502a62c7fe32c2f092 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Fri, 3 Apr 2009 22:55:29 +0200 Subject: [PATCH] add commit-to-history widget Using the 'commit-to-history' widget a user can add command lines to the shell's history without executing it. Bound to: --- debian/changelog | 4 +++- etc/zsh/zshrc | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index f109307..b2c6d3e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,8 +2,10 @@ grml-etc-core (0.3.66) unstable; urgency=low * vimrc: only set screen title if the caller explicitly asks for it. * zshrc: ask for setting screen title in vim via a wrapper function. + * zshrc: add commit-to-history widget, that allows users to add + command lines to zsh's history without executing [Closes: issue407] - -- Frank Terbeck Thu, 02 Apr 2009 13:11:12 +0200 + -- Frank Terbeck Fri, 03 Apr 2009 22:49:53 +0200 grml-etc-core (0.3.65) unstable; urgency=low diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 80d9255..e76be64 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -628,6 +628,14 @@ grml_toggle_abbrev() { zle -N grml_toggle_abbrev bindkey '^xA' grml_toggle_abbrev +# 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 "^x^h" commit-to-history + # }}} # a generic accept-line wrapper {{{ -- 2.1.4