Skip to content

Standalone GUI and Delphi IDE plugin to parametrize ripgrep for superfast search.

License

Notifications You must be signed in to change notification settings

mattia72/DRipGrepper

Repository files navigation

Table of Contents

💧 DRipGrepper

Yet another ripgrep GUI, written in Delphi Pascal. The goal is to create a useful standalone helper tool for searching and parametrizing ripgrep, then integrating as Delphi IDE extension. The release includes the standalone exe and a dll file, which can be used as Delphi IDE extension.

Screenshot

Features and Todos

Marked with checkmark if ready, else planned. Most actual working items, you will find in the last release notes

  • Searches text, parses output of rg --vimgrep
    • Error parser: if a line couldn't be parsed, it is placed in the first column (it may be an encoding problem)
  • Toolbar buttons to:
    • Expand/collapse tree
    • Show/hide icons
    • Full/relative path
    • Alternate row colors
  • Copy rg command line into clipboard
  • Sorting result groups by row/col/text
  • Filtering results
    • Filter by file path/matching lines
  • File handling (e.g., open in explorer or in another tool)
  • Replace text in files with --replace=TEXT
  • Unicode support

🔍 Search Dialog

Screenshot

  • Helps parametrizing rg.exe
    • Expert mode set in DripGrepper.ini makes rg options visible
      • Option helper form generated from rg help Screenshot
    • Quick buttons for:
      • --ignore-case
      • --case-sensitive
      • --word-regexp
      • --fixed-strings
    • --glob filter settings can be set in a separate edit box
    • --hidden, --no-ignore can be set
    • --pretty can be set (not supported by rg.exe in VSCode)
    • --context NUM (or -A=NUM -B=NUM) parser
    • --invert-match parser
    • --stats parser, e.g., message box on end with search statistics

🚀 Open with...

Screenshot

  • Show configured editors to open matching files at the matching position
    • On double-click
    • Via menu/toolbar
  • Separate editors for distinct file extensions

Configure Open with...

Screenshot

Examples:

  • C:\Program Files\Notepad++\notepad++.exe "<FILE>" -n<LINE> -c<COL>
  • C:\Program Files\Microsoft VS Code\Code.exe --reuse-window "<DIR>" --goto "<FILE>:<LINE>:<COL>"
  • C:\Program Files\Git\usr\bin\vim.exe -u "C:\Program Files\Git\etc\vimrc" -c "+normal <LINE>G<COL>l" "<FILE>"
  • nvim-qt.exe "<FILE>" -- -c "+normal <LINE>G<COL>l"

Configuration

Configuration is stored in ini file (DripGrepper.ini for standalone and DripExtension.ini for the extension)

  • Open with... settings saved
  • DebugTrace switch
  • config form
    • Open with...
    • View settings: colors
    • App settings: rg path, debug trace, expert mode
      • configurable length of history
    • Extension settings

Delphi Extension

Screenshot

  • Dockable window
  • High DPI scaling
  • Menu item in Tools (shortcut configurable in DripExtension*.ini)
  • Default shortcut Shift+Alt+R (:warning: conflict with GExpert/MMX Reverse Statement)
  • Click on matching file opens file in the editor at the position
    • Expand collapsed code in {$REGION}-s
  • Popup menu
    • Delete history entries
    • Copy path, etc.
    • Insert file as uses to interface/implementation section
  • Save window position
    • Save in layout
    • Load saved layout
  • Search selected text
    • Multi-line selection handling (in ini?)
  • Search only in opened files/project files/project group
    • Search type, variable declaration, function definition

Installation

Scoop

If you want to be up to date with the latest versions. Install Scoop, and then you can install and update dripgrepper from the official bucket 🆒

scoop bucket add dripgrepper-bucket https://github.com/mattia72/scoop
scoop install dripgrepper

Manual

Delphi Integration

As BPL package
  • Open Delphi
  • Open Tools | GetIt-Package-Manager
  • Install VirtualTree for VCL
  • Open Component | Install Packages...
  • Add DripExtension.bpl to Design packages list
  • Ready
As Expert DLL
  • Run DripGrepper.exe
  • Open Config...
  • Select Extension tab
  • Push Install...
    • (If not found in current folder, select DripExtensions.dll)
  • Restart Delphi

Thanks