Skip to content

Instantly share code, notes, and snippets.

@kiris
Created March 12, 2015 02:52
Show Gist options
  • Save kiris/78ace91143a493c45169 to your computer and use it in GitHub Desktop.
Save kiris/78ace91143a493c45169 to your computer and use it in GitHub Desktop.
makeのtargetをpecoで選択する
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