Thursday, January 19, 2023
Show HN: Codex – Find and Replace for Code https://ift.tt/0Dk5TWK
Show HN: Codex – Find and Replace for Code Most code editors' find & 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. Codex ( https://ift.tt/ExL3eFI ) is an attempt to rethink what find & 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*. It can be used just like regular plain text find & replace, but allows freely mixing in regexes and Tree-sitter queries as more flexibility is needed. It introduces "line quantifiers" 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). I designed Codex with a specific use case in mind (the one I show in my demo video: https://www.youtube.com/watch?v=MQ_N0-AJ2Qg ), so any suggestions for other things it should support would be much appreciated, as well as general feedback. *Indentation is relative and space/tab agnostic. https://ift.tt/ExL3eFI January 18, 2023 at 10:56AM
Subscribe to:
Post Comments (Atom)
Cybersecurity Career Week October 16-21, 2023
Join us in Observing Cybersecurity Career Week October 16-21, 2023 nist.gov/nice/ccw What is it? Cybersecurity Career Awareness Week is a ca...
-
Show HN: Dumbproxy – modern and simple HTTP(S) proxy https://ift.tt/3cVqvkq May 25, 2020 at 03:00AM
-
Show HN: A simple MSN Weather API wrapper https://ift.tt/3jeS0vi June 26, 2021 at 07:48AM
-
Show HN: TopSpace – Scroll above the top line in Emacs This is an Emacs minor mode I made in my spare time this past year. It lets you scrol...
No comments:
Post a Comment