1
1
# tp - Transparent Pipeline
2
- ![ GitHub] ( https://img.shields.io/github/license/minefuto/tp?style=for-the-badge )
2
+ ![ build] ( https://img.shields.io/github/workflow/status/minefuto/tp/build?style=for-the-badge )
3
+ ![ license] ( https://img.shields.io/github/license/minefuto/tp?style=for-the-badge )
3
4
4
5
This is a tool that interactively previews the command's stdin/stdout.
5
6
@@ -11,33 +12,53 @@ $ go install
11
12
```
12
13
13
14
## Usage
14
- ### 1. stdin/stdout mode
15
+ ### 1. commandline mode
15
16
<img src =" https://github.com/minefuto/tp/blob/main/gif/mode1.gif " >
16
17
17
- ### 2. commandline mode
18
- <img src =" https://github.com/minefuto/tp/blob/main/gif/mode2.gif " >
19
-
20
18
Add the following to shell's config file.
19
+ ` <key> ` : Specify any key.
20
+ ** Bash(` .bashrc ` )**
21
+ ```
22
+ function transparent-pipeline() {
23
+ READLINE_LINE=$(tp -c "${READLINE_LINE}|")
24
+ READLINE_POINT=${#READLINE_LINE}
25
+ }
26
+ bind -x '"<key>": transparent-pipeline'
27
+ ```
21
28
** Zsh(` .zshrc ` )**
22
29
```
23
30
function transparent-pipeline() {
24
- BUFFER="$(tp -c $ BUFFER)"
31
+ BUFFER="$(tp -c "${ BUFFER}|" )"
25
32
CURSOR=$#BUFFER
26
33
}
27
34
zle -N transparent-pipeline
28
- bindkey '^t' transparent-pipeline
35
+ bindkey "<key>" transparent-pipeline
29
36
```
30
-
31
37
** Fish(` config.fish ` )**
32
38
```
33
39
function transparent-pipeline
34
40
commandline | read -l buffer
35
- commandline (tp -c "$buffer")
41
+ commandline -r (tp -c "$buffer|")
42
+ commandline -f repaint
36
43
end
37
44
function fish_user_key_bindings
38
- bind \ct transparent-pipeline
45
+ bind "<key>" transparent-pipeline
39
46
end
40
47
```
41
48
49
+ ### 2. stdin/stdout mode
50
+ <img src =" https://github.com/minefuto/tp/blob/main/gif/mode2.gif " >
51
+
52
+ ## Options
53
+ ```
54
+ > tp -h
55
+ Usage of tp:
56
+ -c, --command Return commandline text (Please see the "1. commandline mode")
57
+ -h, --help Show help
58
+ --horizontal Split the view horizontally
59
+ -s, --shell string Specify the shell to use (default "$SHELL")
60
+ -v, --version Show version
61
+ ```
62
+
42
63
## Supported OS
43
64
macOS, Linux
0 commit comments