Crates.io | scooter |
lib.rs | scooter |
version | |
source | src |
created_at | 2024-11-13 19:26:40.628983 |
updated_at | 2024-11-30 19:18:32.25115 |
description | Interactive find and replace in the terminal |
homepage | https://github.com/thomasschafer/scooter |
repository | https://github.com/thomasschafer/scooter |
max_upload_size | |
id | 1446950 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Scooter is an interactive find-and-replace terminal UI app.
Search with either a fixed string or a regular expression, enter a replacement, and interactively toggle which instances you want to replace. You can also specify a regex pattern for the file paths you want to search.
If the instance you're attempting to replace has changed since the search was performed, e.g. if you've switched branches and that line no longer exists, that particular replacement won't occur: you'll see all such cases at the end.
Scooter respects both .gitignore
and .ignore
files. By default hidden files (such as those starting with a .
) are ignored, but can be included with the --hidden
flag.
You can add capture groups to the search regex and use them in the replacement string: for instance, if you use (\d) - (\w+)
for the search text and ($2) "$1"
as the replacement, then 9 - foo
would be replaced with (foo) "9"
.
Run
scooter
in a terminal to launch Scooter. By default the current directory is used to search and replace in, but you can pass in a directory as the first argument to override this behaviour:
scooter ../foo/bar
A set of keymappings will be shown at the bottom of the window: these vary slightly depending on the screen you're on.
When on the search screen the following fields are available:
/foo/
, if the path pattern is set to bar
then /foo/bar.txt
and /foo/bar/file.rs
will be included. In the same example, if the path pattern is set to foo
then /foo/bar.txt
will not be included, but /foo/foo.txt
will be.Ensure you have cargo installed (see here), then run:
cargo install scooter
On macOS and Linux, you can install Scooter using Homebrew:
brew install scooter
Scooter is available as scooter
in nixpkgs, currently on the unstable channel.
You can download binaries from the releases page. After downloading, unzip the binary and move it to a directory in your PATH
.
*-x86_64-unknown-linux-musl.tar.gz
*-aarch64-unknown-linux-musl.tar.gz
*-aarch64-apple-darwin.tar.gz
*-x86_64-apple-darwin.tar.gz
*-x86_64-pc-windows-msvc.zip
Ensure you have cargo installed (see here), then run the following commands:
git clone git@github.com:thomasschafer/scooter.git
cd scooter
cargo install --path . --locked
Contributions are very welcome! I'd be especially grateful for any contributions to add Scooter to popular package managers. If you'd like to add a new feature, please create an issue first so we can discuss the idea, then create a PR with your changes.