diff --git a/Cargo.lock b/Cargo.lock index 18aadf4..f9d72c6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -239,7 +239,7 @@ dependencies = [ ] [[package]] -name = "tmux-thumbs" +name = "thumbs" version = "0.3.0" dependencies = [ "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index a0c3a91..261e545 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,9 +1,9 @@ [package] -name = "tmux-thumbs" +name = "thumbs" version = "0.3.0" authors = ["Ferran Basora "] edition = "2018" -description = "A lightning fast version of tmux-fingers, copy/pasting tmux like vimium/vimperator" +description = "A lightning fast version copy/pasting like vimium/vimperator" repository = "https://github.com/fcsonline/tmux-thumbs" keywords = ["rust", "tmux", "tmux-plugin", "vimium", "vimperator"] license = "MIT" diff --git a/README.md b/README.md index 0119d5e..3f7d592 100644 --- a/README.md +++ b/README.md @@ -326,6 +326,50 @@ This is the known list of versions of `tmux` compatible with `tmux-thumbs`: If you can check hat `tmux-thumbs` is or is not compatible with some specific version of `tmux`, let me know. +## Standalone `thumbs` + +This project started as a `tmux` plugin but after reviewing it with some +friends we decided to explore all the possibilities of decopling thumbs from +`tmux`. Standalone `thumbs` has some similarities to [FZF](https://github.com/junegunn/fzf). + +``` +thumbs 0.3.0 +A lightning fast version copy/pasting like vimium/vimperator + +USAGE: + thumbs [FLAGS] [OPTIONS] + +FLAGS: + -c, --contrast Put square brackets around hint for visibility + -h, --help Prints help information + -m, --multi Enable multi-selection + -r, --reverse Reverse the order for assigned hints + -u, --unique Don't show duplicated hints for the same match + -V, --version Prints version information + +OPTIONS: + -a, --alphabet Sets the alphabet [default: qwerty] + --bg-color Sets the background color for matches [default: black] + --fg-color Sets the foregroud color for matches [default: green] + -f, --format + Specifies the out format for the picked hint. (%U: Upcase, %H: Hint) [default: %H] + + --hint-bg-color Sets the background color for hints [default: black] + --hint-fg-color Sets the foregroud color for hints [default: yellow] + -p, --position Hint position [default: left] + -x, --regexp ... Use this regexp as extra pattern to match + --select-bg-color Sets the background color for selection [default: black] + --select-fg-color Sets the foreground color for selection [default: blue] +``` + + +If you want to enjoy terminal hints, you can do things like this without `tmux`: + +``` +> alias pick='thumbs -u -r | xsel --clipboard -i' +> git log | pick +``` + ## Background As I said, this project is based in [tmux-fingers](https://github.com/Morantron/tmux-fingers). Morantron did an extraordinary job, building all necessary pieces in Bash to achieve the text picker behaviour. He only deserves my gratitude for all the time I have been using [tmux-fingers](https://github.com/Morantron/tmux-fingers). @@ -336,6 +380,12 @@ During those days another alternative appeared, called [tmux-picker](https://git I was curious to know if this was possible to be written in [Rust](https://www.rust-lang.org/), and soon I realized that was something doable. The ability to implement tests for all critic parts of the application give you a great confidence about it. On the other hand, Rust has an awesome community that lets you achieve this kind of project in a short period of time. +## Roadmap + +- [X] Support multi selection +- [X] Decouple `tmux-thumbs` from `tmux` +- [ ] Code [Kitty](https://github.com/kovidgoyal/kitty) plugin, now that `thumbs` can run standalone + ## Contribute This project started as a side project to learn Rust, so I'm sure that is full diff --git a/src/main.rs b/src/main.rs index 918e114..f1b56d2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,7 +13,7 @@ use std::io::{self, Read}; fn app_args<'a>() -> clap::ArgMatches<'a> { return App::new("thumbs") .version(crate_version!()) - .about("A lightning fast version of tmux-fingers, copy/pasting tmux like vimium/vimperator") + .about("A lightning fast version copy/pasting like vimium/vimperator") .arg( Arg::with_name("alphabet") .help("Sets the alphabet")