Title: Most code editors&#x27; find &amp; replace features are still very close to the original design intended for text documents, so they become unwieldy when you need to match across newlines and indentation for example, or when a parse of the code is necessary to capture a particular expression.<p>Codex (<a href="https:&#x2F;&#x2F;codex-kappa-dusky.vercel.app&#x2F;" rel="nofollow">https:&#x2F;&#x2F;codex-kappa-dusky.vercel.app&#x2F;</a>) is an attempt to rethink what find &amp; replace should look like in a modern code editor. It defines a simple but powerful syntax for describing code modifications, combining plain text, regular expressions and Tree-sitter queries, along with sensible handling of newlines and indentation*.<p>It can be used just like regular plain text find &amp; replace, but allows freely mixing in regexes and Tree-sitter queries as more flexibility is needed.<p>It introduces &quot;line quantifiers&quot; for matching a bunch of lines at the same nesting level, so basic structural changes can be achieved without even using a query (see the JavaScript function example in the link).<p>I designed Codex with a specific use case in mind (the one I show in my demo video: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=MQ_N0-AJ2Qg">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=MQ_N0-AJ2Qg</a>), so any suggestions for other things it should support would be much appreciated, as well as general feedback.<p>*Indentation is relative and space&#x2F;tab agnostic.
Upvote: