Created
April 15, 2010 16:36
-
-
Save hchbaw/367334 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 | |
# コマンドライン上の今のカーソルの左の要素の展開具合を補完候補にするようなス | |
# クリプトです。 | |
_expand_word_fu () { | |
compstate[insert]= | |
local origprefix=$PREFIX | |
case $origprefix[1] in | |
(/); ;& | |
(.); ;& | |
(\*) | |
_main_complete _expand ;; | |
(*) | |
PREFIX='./**/'$origprefix | |
_main_complete _expand | |
(( $compstate[nmatches] )) || { | |
PREFIX='./**/?'$origprefix | |
_main_complete _expand | |
} | |
esac | |
} | |
zle -C expand-word-fu complete-word _expand_word_fu | |
# zstyle ':completion:expand-word-fu::::' completer | |
# bindkey '^X8' expand-word-fu |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment