Skip to content

Instantly share code, notes, and snippets.

@shinnya
Created January 4, 2013 22:43
Show Gist options
  • Save shinnya/4458126 to your computer and use it in GitHub Desktop.
Save shinnya/4458126 to your computer and use it in GitHub Desktop.
--- incr-0.2.zsh.original 2009-07-26 01:57:53.000000000 +0900
+++ incr-0.2.zsh 2012-10-20 13:21:13.054870542 +0900
@@ -7,6 +7,7 @@
zle -N vi-cmd-mode-incr
zle -N vi-backward-delete-char-incr
zle -N backward-delete-char-incr
+zle -N backward-kill-word-incr
zle -N expand-or-complete-prefix-incr
compinit
@@ -15,6 +16,7 @@
bindkey -M viins '^?' vi-backward-delete-char-incr
bindkey -M viins '^i' expand-or-complete-prefix-incr
bindkey -M emacs '^h' backward-delete-char-incr
+bindkey -M emacs '^w' backward-kill-word-incr
bindkey -M emacs '^?' backward-delete-char-incr
bindkey -M emacs '^i' expand-or-complete-prefix-incr
@@ -127,6 +129,15 @@
fi
}
+function backward-kill-word-incr
+{
+ correct-prediction
+ remove-prediction
+ if zle backward-kill-word; then
+ show-prediction
+ fi
+}
+
function expand-or-complete-prefix-incr
{
correct-prediction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment