Created
March 12, 2015 02:52
-
-
Save kiris/78ace91143a493c45169 to your computer and use it in GitHub Desktop.
makeのtargetをpecoで選択する
This file contains 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
function peco-make-targets () { | |
BUFFER=$(grep -o '^[^#[:space:]].*:' Makefile | sed 's/\([^:]*\):/make \1/' | peco --query "$LBUFFER") | |
CURSOR=$#BUFFER | |
zle clear-screen | |
} | |
zle -N peco-make-targets | |
## usage | |
# bindkey '^x^m' peco-make-targets |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment