srgn
https://github.com/alexpovel/srgn
A
grep
-like tool which understands source code syntax and allows for manipulation in addition to search.
Like
grep
, regular expressions are a core primitive. Unlikegrep
, additional capabilities allow for higher precision, with options for manipulation. This allowssrgn
to operate along dimensions regular expressions and IDE tooling (Rename all, Find all references, ...) alone cannot, complementing them.
srgn
is organized around actions to take (if any), acting only within precise, optionally language grammar-awarescopes. In terms of existing tools, think of it as a mix oftr
,sed
, ripgrep andtree-sitter
, with a design goal of_simplicity_: if you know regex and the basics of the language you are working with, you are good to go.
Like fastmod, but with tree-sitter instead of regular expressions.
Available on homebrew
see also: comby, tree-grepper, tbsp