Skip to content

Commit

Permalink
improve filter options/readme
Browse files Browse the repository at this point in the history
  • Loading branch information
laktak committed Oct 31, 2023
1 parent c55b76a commit 696c127
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 20 deletions.
41 changes: 28 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,31 +70,46 @@ To set any of these options write on your `~/.tmux.conf` file:
set -g <option> "<value>"
```

Where `<option>` and `<value>` are one of the specified here:
Where `<option>` and `<value>` are one of the specified here below

### Common Options

| Option | Default | Description |
| :--- | :---: | :--- |
| `@extrakto_key` | `tab` | The key binding to start. If you have any special requirements (like a custom key table) set this to 'none' and define a binding in your `.tmux.conf`. See `extrakto.tmux` for a sample. |
| `@extrakto_split_direction` | `a` | Whether the tmux split will be `a`uto, `p`opup, `v`ertical or `h`orizontal |
| `@extrakto_split_size` | `7` | The size of the tmux split (for vertical/horizontal) |
| `@extrakto_popup_size` | `90%` | Set width and height of the tmux popup window. Set this to `w,h` to set the width to `w` and height to `h`. |
| `@extrakto_popup_position` | `C` | Set position of the tmux popup window. Possible values are in the `display-popup` entry in `man tmux`. Set this to `x,y` to set the x and y positions to `x` and `y` respectively. |
| `@extrakto_grab_area` | `full` | Whether you want extrakto to grab data from the `recent` area, the `full` pane, all current window's `recent` areas or all current window's `full` panes. You can also set this option to any number you want (or number preceded by "window ", e.g. "window 500"), this allows you to grab a smaller amount of data from the pane(s) than the pane's limit. For instance, you may have a really big limit for tmux history but using the same limit may end up on having slow performance on Extrakto. |
| `@extrakto_clip_tool` | `auto` | Set this to whatever clipboard tool you would like extrakto to use to copy data into your clipboard. `auto` will try to choose the correct clipboard for your platform. |
| `@extrakto_clip_tool_run` | `bg` | Set this to `tmux_osc52` to enable [remote clipboard support](https://github.com/laktak/extrakto/wiki/Remote-Copy-via-OSC52) or `fg`/`bg` to have your clipboard tool run in a foreground/background shell. |
| `@extrakto_fzf_tool` | `fzf` | Set this to path of fzf if it can't be found in your `PATH`. |
| `@extrakto_fzf_layout` |`default` | Control the fzf layout which is "bottom-up" by default. If you prefer "top-down" layout instead set this to `reverse`. In fact, this value is passed to the fzf `--layout` parameter. Possible values are: `default`, `reverse` and `reverse-list` |
| `@extrakto_open_tool` | `auto` | Set this to path of your own tool or `auto` to use your platforms *open* implementation. |
| `@extrakto_filter_order` | `word all line` | Filter modes order. The first listed mode will be the default when opening extrakto. You may use
`word`, `line`, `path`, `url`, `quote`, `s-quote` or any of your own filters separated by a space. `all` applies all filters at the same time. |

### Keys

| Option | Default | Description |
| :--- | :---: | :--- |
| `@extrakto_key` | `tab` | The key binding to start. If you have any special requirements (like a custom key table) set this to 'none' and define a binding in your `.tmux.conf`. See `extrakto.tmux` for a sample. |
| `@extrakto_copy_key` | `enter` | Key to copy selection to clipboard. |
| `@extrakto_insert_key` | `tab` | Key to insert selection. |
| `@extrakto_filter_key` | `ctrl-f` | Key to toggle filter mode. |
| `@extrakto_grab_key` | `ctrl-g` | Key to toggle grab mode. |
| `@extrakto_edit_key` | `ctrl-e` | Key to run the editor. |
| `@extrakto_open_key` | `ctrl-o` | Key to run the open command. |
| `@extrakto_filter_order` | `word all line` | Filter modes order. The first listed mode will be the default when opening extrakto. |

All but `@extrakto_key` are controlled by fzf and must follow its conventions.

### Advanced Options

| Option | Default | Description |
| :--- | :---: | :--- |
| `@extrakto_clip_tool_run` | `bg` | Set this to `tmux_osc52` to enable [remote clipboard support](https://github.com/laktak/extrakto/wiki/Remote-Copy-via-OSC52) or `fg`/`bg` to have your clipboard tool run in a foreground/background shell. |
| `@extrakto_clip_tool` | `auto` | Set this to whatever clipboard tool you would like extrakto to use to copy data into your clipboard. `auto` will try to choose the correct clipboard for your platform. |
| `@extrakto_fzf_layout` |`default` | Control the fzf layout which is "bottom-up" by default. If you prefer "top-down" layout instead set this to `reverse`. In fact, this value is passed to the fzf `--layout` parameter. Possible values are: `default`, `reverse` and `reverse-list` |
| `@extrakto_fzf_tool` | `fzf` | Set this to path of fzf if it can't be found in your `PATH`. |
| `@extrakto_fzf_unset_default_opts` | `true` | Unsets custom FZF_DEFAULT_OPTS as it can potentially cause problems in extrakto operations |
| `@extrakto_open_tool` | `auto` | Set this to path of your own tool or `auto` to use your platforms *open* implementation. |
| `@extrakto_popup_position` | `C` | Set position of the tmux popup window. Possible values are in the `display-popup` entry in `man tmux`. Set this to `x,y` to set the x and y positions to `x` and `y` respectively. |
| `@extrakto_popup_size` | `90%` | Set width and height of the tmux popup window. Set this to `w,h` to set the width to `w` and height to `h`. |
| `@extrakto_split_direction` | `a` | Whether the tmux split will be `a`uto, `p`opup, `v`ertical or `h`orizontal |
| `@extrakto_split_size` | `7` | The size of the tmux split (for vertical/horizontal) |

Example:
### Examples

```
set -g @extrakto_split_size "15"
Expand Down
12 changes: 5 additions & 7 deletions scripts/extrakto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,13 @@ capture() {
"url")
capture_panes | $extrakto --warn-empty -r --urls
;;
"quote")
capture_panes | $extrakto --warn-empty -ra quote
;;
"s-quote")
capture_panes | $extrakto --warn-empty -ra s-quote
;;
"word" | *)
"word")
capture_panes | $extrakto --warn-empty -r --words
;;
*)
# custom filters
capture_panes | $extrakto --warn-empty -ra $mode
;;

esac
}
Expand Down

0 comments on commit 696c127

Please sign in to comment.