Created
April 3, 2016 10:00
-
-
Save kenoss/5fa30538070b1dbccc9ebb3738d2e1cd to your computer and use it in GitHub Desktop.
New version for huge directory: https://gist.github.com/kenoss/85ed24b3d168234a16d5f4f7a1e0b29a
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-find-file() { | |
local command | |
if git rev-parse 2> /dev/null; then | |
command='git ls-files' | |
else | |
command='find . -type f' | |
fi | |
local selected_files=$(eval $command | peco --prompt "[find file]") | |
LBUFFER="${LBUFFER% } $(echo ${selected_files} | tr '\n' ' ')" | |
zle redisplay | |
} | |
zle -N peco-find-file | |
bindkey '^u^f' peco-find-file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment