3 releases

new 0.1.2 Nov 17, 2024
0.1.1 Nov 14, 2024
0.1.0 Nov 13, 2024

#2621 in Command line utilities

Download history 376/week @ 2024-11-11

376 downloads per month

MIT license

1.5MB
1.5K SLoC

scooter

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 preview

Features

Scooter respects both .gitignore and .ignore files.

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".

Installation

Cargo

Ensure you have cargo installed (see here), then run:

cargo install scooter

Building from source

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 .

Usage

Run scooter in a terminal to launch Scooter. You can then enter some text to search with and text to replace matches with, toggle on or off fixed strings, and enter a regex pattern that filenames must match. A more extensive set of keymappings will be shown at the bottom of the window: these vary slightly depending on the screen you're on.

Contributing

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.

Dependencies

~15–29MB
~366K SLoC