A simple terminal UI for search and replace, ala VS Code.
A simple terminal UI for search and replace, ala VS Code.
[!WARNING] This project needs maintainers, if you are interested please contact me at
[email protected]
serpl is a terminal user interface (TUI) application that allows users to search and replace keywords in an entire folder, similar to the functionality available in VS Code.
https://github.com/yassinebridi/serpl/assets/18403595/348506704-73336074-bfaf-4a9a-849c-bd4aa4e24afc
cargo install serplcargo install serpl --features ast_grepserplCheck the releases page for the latest binaries.
serpl can be installed using Homebrew:
brew install serplserpl can be installed from the official repositories using pacman:
pacman -S serplserpl is included in nixpkgs since 24.11, and can be installed via Nix in different ways:
On standalone Nix setups:
nix profile install nixpkgs#serplOn NixOS (via configuration.nix or similar):
{pkgs, ...}: {
environment.systemPackages = [pkgs.serpl];
}On Home-Manager:
{pkgs, ...}: {
home.packages = [pkgs.serpl];
}serplserpl --project-root /path/to/projectDefault key bindings can be customized through the config.json file.
| Key Combination | Action |
|---|---|
Ctrl + c |
Quit |
Ctrl + d |
Quit |
Ctrl + b |
Help |
Tab |
Switch between tabs |
Backtab |
Switch to previous tabs |
Ctrl + o |
Process replace for all files |
r |
Process replace for selected file or line |
Ctrl + n |
Toggle search and replace modes |
Enter |
Execute search (for large folders) |
g / Left / h |
Go to top of the list |
G / Right / l |
Go to bottom of the list |
j / Down |
Move to the next item |
k / Up |
Move to the previous item |
/ |
Search results list |
d |
Delete selected file or line |
Esc |
Exit the current pane or dialog |
Enter (in dialogs) / y |
Confirm action |
Esc (in dialogs) / n |
Cancel action |
h, l, Tab (in dialogs) |
Navigate dialog options |
serpl uses a configuration file to manage key bindings and other settings. By default, the path to the configuration file can be found by running serpl --version. You can use various file formats for the configuration, such as JSON, JSON5, YAML, TOML, or INI.
JSON
{
"keybindings": {
"": "Quit",
"": "Quit",
"": "LoopOverTabs",
"": "BackLoopOverTabs",
"": "ProcessReplace",
"": "ShowHelp"
}
}JSON5
{
keybindings: {
"": "Quit",
"": "Quit",
"": "LoopOverTabs",
"": "BackLoopOverTabs",
"": "ProcessReplace",
"": "ShowHelp",
},
}YAML
keybindings:
"": "Quit"
"": "Quit"
"": "LoopOverTabs"
"": "BackLoopOverTabs"
"": "ProcessReplace"
"": "ShowHelp"TOML
[keybindings]
"" = "Quit"
"" = "Quit"
"" = "LoopOverTabs"
"" = "BackLoopOverTabs"
"" = "ProcessReplace"
"" = "ShowHelp"INI
[keybindings]
= Quit
= Quit
= LoopOverTabs
= BackLoopOverTabs
= ProcessReplace
= ShowHelpYou can customize the key bindings by modifying the configuration file in the format of your choice.
[!TIP] If current directory is considerebly large, you have to click
Enterto start the search.
/ key.Ctrl + b key combination to display the help dialog.Ctrl + o key combination to process the replace for all files.r key to process the replace for the selected file or line.Ctrl + n key combination to toggle between search and replace modes.g, G, j, and k keys to navigate through the search results.d key to delete the selected file or line.Check out the toggleterm.nvim plugin for Neovim, which provides a terminal that can be toggled with a key binding. Or you can use the following configuration, if you are using AstroNvim:
…You can add a keybinding like the following to open Serpl inside Helix:
[keys.normal.ret]
t = [":write-all", ":insert-output serpl >/dev/tty", ":redraw", ":reload-all"]This project is licensed under the MIT License. See the LICENSE file for details.
(WIP)
No open issues yet, or sync has not completed.