Created
April 9, 2010 14:30
-
-
Save hchbaw/361216 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!zsh | |
# 直前のコマンドラインの要素を補完候補にするようなスクリプトです。 | |
_complete_previous_commandline () { | |
local cl xs | |
cl="$(fc -l -n -1)" | |
xs=${(@z)cl} | |
compadd \ | |
-V "previous commandline" \ | |
-M 'm:{a-z}={A-Z} r:|?=**' \ | |
-x "(${(Q)cl})" \ | |
-- $xs | |
} | |
zle -C complete-previous-commandline complete-word _complete_previous_commandline | |
# bindkey "^X^p" complete-previous-commandline |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment