{"id":13567490,"url":"https://github.com/laktak/extrakto","last_synced_at":"2025-05-14T22:09:41.633Z","repository":{"id":37665053,"uuid":"104260766","full_name":"laktak/extrakto","owner":"laktak","description":"extrakto for tmux - quickly select, copy/insert/complete text without a mouse","archived":false,"fork":false,"pushed_at":"2024-12-18T08:17:08.000Z","size":199,"stargazers_count":956,"open_issues_count":0,"forks_count":49,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-05-08T18:53:13.822Z","etag":null,"topics":["autocomplete","clipboard","complete","completion","copy-paste","extract","tmux"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/laktak.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"laktak"}},"created_at":"2017-09-20T19:47:38.000Z","updated_at":"2025-05-08T14:10:45.000Z","dependencies_parsed_at":"2024-12-27T04:12:52.580Z","dependency_job_id":null,"html_url":"https://github.com/laktak/extrakto","commit_stats":{"total_commits":179,"total_committers":29,"mean_commits":6.172413793103448,"dds":0.2960893854748603,"last_synced_commit":"3eb7eb498a493e06edbe898bc70c7b87bf1a630e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laktak%2Fextrakto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laktak%2Fextrakto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laktak%2Fextrakto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laktak%2Fextrakto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/laktak","download_url":"https://codeload.github.com/laktak/extrakto/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254235701,"owners_count":22036964,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autocomplete","clipboard","complete","completion","copy-paste","extract","tmux"],"created_at":"2024-08-01T13:02:32.836Z","updated_at":"2025-05-14T22:09:36.616Z","avatar_url":"https://github.com/laktak.png","language":"Python","funding_links":["https://github.com/sponsors/laktak"],"categories":["Shell","Python","\u003ca name=\"copy-paste\"\u003e\u003c/a\u003eCopy/paste and clipboard","Plugins"],"sub_categories":[],"readme":"# extrakto for tmux\n\n![intro](https://github.com/laktak/extrakto/wiki/assets/intro2.gif)\n\n**Output completions** - you can complete commands that require you to retype text that is already on the screen. This works everywhere, even in remote ssh sessions.\n\nYou can **fuzzy find your text** instead of selecting it by hand:\n\n- press tmux `prefix + tab` to start extrakto\n- fuzzy find the text/path/url/line\n- use custom filters (`ctrl + f`)\n- press\n  - `tab` to insert it to the current pane,\n  - `enter` to copy it to the clipboard,\n- see other features in [HELP](HELP.md) (press `ctrl-h` in extrakto)\n\nUse it for paths, URLs, options from a man page, git hashes, docker container names, ...\n\n\n- [Requirements](#requirements)\n- [Installation](#installation)\n  - [Using Tmux Plugin Manager](#using-tmux-plugin-manager)\n  - [Manual Method](#manual-method)\n- [Wiki](#wiki)\n- [Options](#options)\n  - [Common Options](#common-options)\n  - [Keys](#keys)\n  - [Advanced Options](#advanced-options)\n  - [Using skim instead of fzf](#using-skim-instead-of-fzf)\n  - [Examples](#examples)\n  - [Custom Tmux Keybindings](#custom-tmux-keybindings)\n- [Custom Filters](#custom-filters)\n- [CLI tool](#cli-tool)\n  - [Installation](#installation)\n  - [Usage](#usage)\n- [Contributions](#contributions)\n\n\n## Requirements\n\n\u003ca href=\"https://github.com/laktak/tome\"\u003e\u003cimg src=\"https://github.com/laktak/tome/wiki/assets/clippy_tome.gif\" align=\"right\" alt=\"clippy\" width=\"265\" height=\"349\"\u003e\u003c/a\u003e\n\n- [tmux](https://github.com/tmux/tmux) - popups require 3.2, otherwise extrakto will open in a split window.\n- [fzf](https://github.com/junegunn/fzf) or [skim](https://github.com/skim-rs/skim) (see below)\n- Python 3.6+\n- a posix shell like Bash\n- optionally [Tmux Plugin Manager](https://github.com/tmux-plugins/tpm)\n\nSupported clipboards:\n\n- Linux Xorg (xclip) and Wayland (wl-copy)\n- macOS (pbcopy)\n- WSL\n- *bring your own*, see the [Wiki](https://github.com/laktak/extrakto/wiki/) for examples (like termux)\n\n\n## Installation\n\n### Using Tmux Plugin Manager\n\nAdd the plugin to the list of TPM plugins in `.tmux.conf`:\n\n    set -g @plugin 'laktak/extrakto'\n\nHit `prefix + I` to fetch the plugin and source it. You can use `prefix + U` to update all plugins.\n\nYou should now have all `extrakto` key bindings defined.\n\n\n### Manual Method\n\nClone the repo:\n\n    $ git clone https://github.com/laktak/extrakto ~/clone/path\n\nAdd this line to the bottom of `.tmux.conf`:\n\n    run-shell ~/clone/path/extrakto.tmux\n\nReload the tmux environment:\n\n    # type this in terminal\n    $ tmux source-file ~/.tmux.conf\n\nYou should now have all `extrakto` key bindings defined.\n\n\n## Wiki\n\nAdd or look for special requirements and tips in our [wiki](https://github.com/laktak/extrakto/wiki).\n\n\n## Options\n\nYou can set any of these options by adding them to your `~/.tmux.conf` file:\n\n```\nset -g \u003coption\u003e \"\u003cvalue\u003e\"\n```\n\nWhere `\u003coption\u003e` and `\u003cvalue\u003e` correspond to one of the options specified below\n\n### Common Options\n\n| Option                                | Default         | Description |\n| :---                                  | :---:           | :--- |\n| `@extrakto_grab_area`                 | `window full`   | Whether you want extrakto to grab data from the `recent` area, the `full` pane, all current window's (`window recent`) areas or all current window's (`window 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. |\n| `@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. |\n\n### Keys\n\n| Option                                | Default         | Description |\n| :---                                  | :---:           | :--- |\n| `@extrakto_key`                       | `tab`           | The key binding to start. If you have any special requirements (like a custom key table) set this to 'none'. See \"Custom Tmux Keybindings\". |\n| `@extrakto_copy_key`                  | `enter`         | Key to copy selection to clipboard. |\n| `@extrakto_insert_key`                | `tab`           | Key to insert selection. |\n| `@extrakto_filter_key`                | `ctrl-f`        | Key to toggle filter mode. |\n| `@extrakto_grab_key`                  | `ctrl-g`        | Key to toggle grab mode. |\n| `@extrakto_edit_key`                  | `ctrl-e`        | Key to run the editor. |\n| `@extrakto_open_key`                  | `ctrl-o`        | Key to run the open command. |\n\nAll but `@extrakto_key` are controlled by fzf and must follow its conventions.\n\n### Advanced Options\n\n| Option                                | Default         | Description |\n| :---                                  | :---:           | :--- |\n| `@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. |\n| `@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. |\n| `@extrakto_editor`                    |                 | This defaults to `$EDITOR` if not set. |\n| `@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` |\n| `@extrakto_fzf_tool`                  | `fzf`           | Set this to path of fzf if it can't be found in your `PATH`. If you prefer skim you need to set this option to `sk` or its full path. |\n| `@extrakto_fzf_header`                | `i c o e f g h` | Define the fzf header to show keys for insert, copy, open, edit, filter, grab and help. You can reorder or omit information you don't need.|\n| `@extrakto_fzf_unset_default_opts`    | `true`          | Unsets custom FZF_DEFAULT_OPTS as it can potentially cause problems in extrakto operations |\n| `@extrakto_open_tool`                 | `auto`          | Set this to path of your own tool or `auto` to use your platforms *open* implementation. |\n| `@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. |\n| `@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`. |\n| `@extrakto_split_direction`           | `a`             | Whether the tmux split will be `a`uto, `p`opup, `v`ertical or `h`orizontal |\n| `@extrakto_split_size`                | `7`             | The size of the tmux split (for vertical/horizontal) |\n\n### Using skim instead of fzf\n\nIf you prefer skim you need to set the `@extrakto_fzf_tool` option to `sk` or its full path. Skim should be compatible with fzf but let us know if you run into any issues.\n\n### Examples\n\n```\nset -g @extrakto_split_size \"15\"\nset -g @extrakto_clip_tool \"xsel --input --clipboard\" # works better for nvim\nset -g @extrakto_copy_key \"tab\"      # use tab to copy to clipboard\nset -g @extrakto_insert_key \"enter\"  # use enter to insert selection\nset -g @extrakto_fzf_unset_default_opts \"false\"  # keep our custom FZF_DEFAULT_OPTS\nset -g @extrakto_fzf_header \"i c f g\" # for small screens shorten the fzf header\n```\n\n### Custom Tmux Keybindings\n\nInstead of using `@extrakto_key` you can define your own key binding to start extrakto in your `.tmux.conf`:\n\n```\ntmux bind-key YOUR-KEY run-shell \"~/.tmux/plugins/extrakto/scripts/open.sh \\\"#{pane_id}\\\"\"\n```\n\nIf you wish you can also define different keys to start with a specific filter:\n\n```\ntmux bind-key YOUR-KEY run-shell \"~/.tmux/plugins/extrakto/scripts/open.sh \\\"#{pane_id}\\\" FILTER-NAME\"\n```\n\n\n## Custom Filters\n\nYou can define your own filters by creating a file in `~/.config/extrakto/extrakto.conf`:\n\n```\n[quote]\nregex: (\"[^\"\\n\\r]+\")\n```\n\nTo override an existing filter copy it to your file first.\n\nIf you want to remove one of the alternate filters you can set it to `None`:\n\n```toml\n[quote]\nalt2: None\n```\n\nSee [extrakto.conf](extrakto.conf) for syntax and predefined filters.\n\n\n---\n\n## CLI tool\n\nYou can also use extrakto as a standalone tool to extract tokens from text.\n\n### Installation\n\nFor now simply clone the repository and link to the tool somewhere in your path:\n\n```\ngit clone https://github.com/laktak/extrakto\ncd extrakto\n# assuming you `export PATH=$PATH:~/.local/bin` in your `.bashrc`:\nln -s $PWD/extrakto.py ~/.local/bin/extrakto\n```\n\nRequires Python 3.6+.\n\n### Usage\n\n```\nusage: extrakto.py [-h] [--name] [-w] [-l] [--all] [-a ADD] [-p] [-u] [--alt] [-r] [-m MIN_LENGTH] [--warn-empty]\n\nExtracts tokens from plaintext.\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --name                prefix filter name in the output\n  -w, --words           extract \"word\" tokens\n  -l, --lines           extract lines\n  --all                 extract using all filters defined in extrakto.conf\n  -a ADD, --add ADD     add custom filter\n  -p, --paths           short for -a=path\n  -u, --urls            short for -a=url\n  --alt                 return alternate variants for each match (e.g. https://example.com and example.com)\n  -r, --reverse         reverse output\n  -m MIN_LENGTH, --min-length MIN_LENGTH\n                        minimum token length\n  --warn-empty          warn if result is empty\n```\n\n## Contributions\n\nThanks go to all contributors for their ideas and PRs!\n\n**If you make a PR, please keep it small so that it's easier to test and review. Try to create one PR per feature/bug.**\n\nPlease run `black` if you change any python code and run `shfmt -p` if you change any shell files.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaktak%2Fextrakto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flaktak%2Fextrakto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaktak%2Fextrakto/lists"}