]> Sergey Matveev's repositories - path-extractor.git/blob - README.md
Modularize project
[path-extractor.git] / README.md
1 PathExtractor (pe)
2 ==================
3
4 ![demo](https://raw.github.com/edi9999/i/master/demo.gif?v=2)
5
6 PathExtractor is a command line tool that extracts a list of files/paths from stdin.
7
8 Advantages over [fpp](https://github.com/facebook/PathPicker):
9
10 -       It does only one thing : more unixy
11 -       You can use it with any fuzzy finder, such as [fzf](https://github.com/junegunn/fzf),[peco](https://github.com/peco/peco),[percol](https://github.com/mooz/percol),[pick](https://github.com/thoughtbot/pick),[selecta](https://github.com/garybernhardt/selecta/)
12 -       It doesn't wait for stdin to be finished to output the paths
13 -       It is faster
14 -       It is much smaller (easily understandable)
15 -       You can also use it without a fuzzy finder for programmatic usage
16
17 For example, you could write:
18
19 ```
20 git status | pe
21 ```
22
23 to get a list of the files that were added/changed, without all the formating
24
25 One of the most common usage is to create an alias that will automatically run :
26
27 `pe` + a command line fuzzy finder such as fzf + an action such as opening that file in your favorite editor.
28
29 For example, using `zsh` , I have as an alias:
30
31 ```
32 alias -g P='| pe | fzf | read filename; [ ! -z $filename ] && vim $filename'
33 ```
34
35 With `bash`:
36
37 ```
38 bind '"PP": "| pe | uniq | fzf | while read filename; do [ ! -z $filename ] && </dev/tty vim $filename; done\n'
39 ```
40
41 So that If I run
42
43 ```
44 `git status P`
45 ```
46
47 or
48
49 ```
50 `git status PP`
51 ```
52
53 to quickly open one of the changed files in vim
54
55 Other usage ideas:
56
57 With zsh:
58
59 ```
60 # Copy selected path to clipboard
61 alias -g C='| pe | fzf | read filename; [ ! -z $filename ] && echo -n $filename | xclip -selection c'
62 ```
63
64 With bash:
65
66 ```
67 bind '"CC": "| pe | fzf | read filename; [ ! -z $filename ] && echo -n $filename | xclip -selection c\n"'
68 ```
69
70 Installation
71 ============
72
73 ```
74 go get github.com/edi9999/path-extractor/path-extractor
75 ```
76
77 You will have the `path-extractor` in your `$GOPATH/bin` directory which you can rename or alias to `pe`
78
79 Binaries
80 ========
81
82 They are no binaries for now (you have to build it yourself), but one idea would be to use [goxc](https://github.com/laher/goxc) to compile it on multiple platforms