Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

serpl

> 开发工具
Open source

A simple terminal UI for search and replace, ala VS Code.

855 stars0 likes1 views
WebsiteGitHub

About

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

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

Table of Contents

  1. Features
  2. Installation
    • Prerequisites
    • Steps
    • Binaries
    • OS Specific Installation
  3. Usage
    • Basic Commands
    • Key Bindings
    • Configuration
  4. Panes
    • Search Input
    • Replace Input
    • Search Results Pane
    • Preview Pane
  5. Quick Hints
  6. Neovim Integration using toggleterm
  7. Helix Integration
  8. License
  9. Contributing
  10. Acknowledgements
  11. Similar Projects

Features

  • Search for keywords across an entire project folder, with options for case sensitivity, AST Grep and more.
  • Replace keywords with options for preserving case, AST Grep and more.
  • Interactive preview of search results.
  • Keyboard navigation for efficient workflow.
  • Configurable key bindings and search modes.

Installation and Update

Prerequisites

  • ripgrep installed on your system.
  • (Optional) ast-grep installed on your system, if you want to use the AST Grep functionality.

Steps

  1. Install the application using Cargo:
bash
cargo install serpl
  • If you want to install the application with the AST Grep functionality, you can use the following command:
    bash
    cargo install serpl --features ast_grep
  1. Run the application:
bash
serpl

Binaries

Check the releases page for the latest binaries.

OS Specific Installation

Brew

serpl can be installed using Homebrew:

bash
brew install serpl

Arch Linux

serpl can be installed from the official repositories using pacman:

bash
pacman -S serpl

Nix/NixOS

serpl is included in nixpkgs since 24.11, and can be installed via Nix in different ways:

On standalone Nix setups:

bash
nix profile install nixpkgs#serpl

On NixOS (via configuration.nix or similar):

nix
{pkgs, ...}: {
  environment.systemPackages = [pkgs.serpl];
}

On Home-Manager:

nix
{pkgs, ...}: {
  home.packages = [pkgs.serpl];
}

Usage

Basic Commands

  • Start the application in the current directory:
    bash
    serpl
  • Start the application and provide the project root path:
    bash
    serpl --project-root /path/to/project

Key Bindings

Default key bindings can be customized through the config.json file.

Default Key Bindings

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

Configuration

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.

Example Configurations

JSON

json
{
  "keybindings": {
    "": "Quit",
    "": "Quit",
    "": "LoopOverTabs",
    "": "BackLoopOverTabs",
    "": "ProcessReplace",
    "": "ShowHelp"
  }
}

JSON5

json5
{
  keybindings: {
    "": "Quit",
    "": "Quit",
    "": "LoopOverTabs",
    "": "BackLoopOverTabs",
    "": "ProcessReplace",
    "": "ShowHelp",
  },
}

YAML

yaml
keybindings:
  "": "Quit"
  "": "Quit"
  "": "LoopOverTabs"
  "": "BackLoopOverTabs"
  "": "ProcessReplace"
  "": "ShowHelp"

TOML

toml
[keybindings]
"" = "Quit"
"" = "Quit"
"" = "LoopOverTabs"
"" = "BackLoopOverTabs"
"" = "ProcessReplace"
"" = "ShowHelp"

INI

ini
[keybindings]
 = Quit
 = Quit
 = LoopOverTabs
 = BackLoopOverTabs
 = ProcessReplace
 = ShowHelp

You can customize the key bindings by modifying the configuration file in the format of your choice.

Panes

Search Input

  • Input field for entering search keywords.
  • Toggle search modes (Simple, Match Case, Match Whole Word, Match Case Whole Word, Regex, AST Grep).
    • Simple: Search all occurrences of the keyword.
    • Match Case: Search occurrences with the same case as the keyword.
    • Match Whole Word: Search occurrences that match the keyword exactly.
    • Match Case Whole Word: Search occurrences that match the keyword exactly with the same case.
    • Regex: Search occurrences using a regular expression.
    • AST Grep: Search occurrences using AST Grep.

[!TIP] If current directory is considerebly large, you have to click Enter to start the search.

Replace Input

  • Input field for entering replacement text.
  • Toggle replace modes (Simple, Preserve Case, AST Grep).
    • Simple: Replace all occurrences of the keyword.
    • Preserve Case: Replace occurrences while preserving the case of the keyword.
    • AST Grep: Replace occurrences using AST Grep.

Search Results Pane

  • List of files with search results.
  • Navigation to select and view files.
  • Option to delete files from the search results.
  • Search results count and current file count.
  • Ability to search the list using the / key.

Preview Pane

  • Display of the selected file with highlighted search results, and context.
  • Navigation to view different matches within the file.
  • Option to delete individual lines containing matches.

Quick Hints

  • Use the Ctrl + b key combination to display the help dialog.
  • Use the Ctrl + o key combination to process the replace for all files.
  • Use the r key to process the replace for the selected file or line.
  • Use the Ctrl + n key combination to toggle between search and replace modes.
  • Use the g, G, j, and k keys to navigate through the search results.
  • Use the d key to delete the selected file or line.

Neovim Integration using toggleterm

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:

…

Helix integration

You can add a keybinding like the following to open Serpl inside Helix:

toml
[keys.normal.ret]
t = [":write-all", ":insert-output serpl >/dev/tty", ":redraw", ":reload-all"]

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

(WIP)

Acknowledgements

  • This project was inspired by the VS Code search and replace functionality.
  • This project is built using the awesome ratatui.rs library, and build on top of their Component Template.
  • Thanks to the ripgrep project for providing the search functionality.
  • Thanks to the ast-grep project for providing the AST Grep functionality.

Similar Projects

  • repgrep: An interactive replacer for ripgrep that makes it easy to find and replace across files on the command line.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rustast-grepreplacerustsearch

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category开发工具
PricingOpen source

> Related tools

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具