Skip to content

Support regex substitution command  #2232

@BadBastion

Description

@BadBastion

Support regex substitution, comparable to vim :s or VSCode search & replace.

I propose supporting regex replacements for selection s, files/, and the workspace scopes <space> + /.

This could be accomplished a few ways, but I would specifically propose using / as a reserved character for regex select operations. This would allow supporting replacement through the common /select/replace/g syntax wherever regex is used.


As far as I can tell workspace scope find replace is considerably more complex to implement than the others. The current grep -> fuzzy filter files user interface would likely be unergonomic compared to a live_grep UI for the regex replacement usecase.

Q: Why not use idiomatic helix multi cursor functionality s: to replace matches
A: I believe the most productive feature of regex substitution are capture groups which are not replicated with multi-cursor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-helix-termArea: Helix term improvementsC-enhancementCategory: Improvements

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions