A unix filter which outputs the filepaths found in stdin
A unix filter which outputs the filepaths found in stdin
PathExtractor is a command line tool that extracts a list of files/paths from stdin.
Advantages over fpp:
For example, you could write:
git status | peto get a list of the files that were added/changed, without all the formating
One of the most common usage is to create an alias that will automatically run :
pe + a command line fuzzy finder such as fzf + an action such as opening that file in your favorite editor.
For example, using zsh , I have as an alias:
alias -g P='| pe | fzf | read filename; [ ! -z $filename ] && vim $filename'With bash:
bind '"PP": "| pe | uniq | fzf | while read filename; do [ ! -z $filename ] && </dev/tty vim $filename; done\n'So that If I run
git status Por
git status PPto quickly open one of the changed files in vim
Other usage ideas:
With zsh:
# Copy selected path to clipboard
alias -g C='| pe | fzf | read filename; [ ! -z $filename ] && echo -n $filename | xclip -selection c'With bash:
bind '"CC": "| pe | fzf | read filename; [ ! -z $filename ] && echo -n $filename | xclip -selection c\n"'go install github.com/edi9999/path-extractor@latest
# sudo mv "$(which path-extractor)" /usr/bin/peYou will have the path-extractor in your $GOPATH/bin directory which you can rename or alias to pe
No open issues yet, or sync has not completed.