Created
April 8, 2010 17:09
-
-
Save hchbaw/360291 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_output () { | |
local command xs | |
command=${(Q)$(fc -l -n -1)} | |
xs=(${(f)"$(${=command})"}) | |
_message "($command)" | |
_describe -t previous-output "" xs -M 'm:{a-z}={A-Z} r:|?=**' | |
} | |
zle -C complete-previous-output complete-word _complete_previous_output | |
# bindkey "^X^k" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment