add commit-to-history widget
authorFrank Terbeck <ft@bewatermyfriend.org>
Fri, 3 Apr 2009 20:55:29 +0000 (22:55 +0200)
committerFrank Terbeck <ft@bewatermyfriend.org>
Fri, 3 Apr 2009 20:55:29 +0000 (22:55 +0200)
Using the 'commit-to-history' widget a user can add command lines
to the shell's history without executing it. Bound to: <ctrl-x><ctrl-h>

debian/changelog
etc/zsh/zshrc

index f109307..b2c6d3e 100644 (file)
@@ -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 <ft@grml.org>  Thu, 02 Apr 2009 13:11:12 +0200
+ -- Frank Terbeck <ft@grml.org>  Fri, 03 Apr 2009 22:49:53 +0200
 
 grml-etc-core (0.3.65) unstable; urgency=low
 
index 80d9255..e76be64 100644 (file)
@@ -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 {{{