-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Description
Description of the problem or steps to reproduce
This is a feature request which naturally grows out of some reported issues/bugs related to the "replace" functionality. See:
#2951 #2937 #2887 #2832 #2174 #2155 #1920
(I'm not sure if some of the older issues have been partially or fully resolved by now but the issues are still technically open)
Basically the request is to implement:
- A way to have literal replace that is actually literal, a.k.a not interpreting absolutely anything, including spaces, backslashes, quotation marks, "$" and other special symbols. You just enter whatever arbitrary string you want to replace, enter another arbitrary string to replace with, and get it done.
- Probably implement a better UI for that which should feature separate fields for "string-to-replace" and "replacement-string" (see the rationale in my comment in the discussion inside Literal Replace command works incorrectly when the replacement string contains '$' #2951).
- [if not too much work ] As a part of that UI, implement a simple switch for regex or literal mode (maybe toggle by pressing a specific key)
- As a part of that UI, implement a button for "replace all" (maybe activate by pressing a specific key)
- [ if not too much work ] implement a switch to toggle case-sensitive (or not) search/replace
- Consider setting literal replace as the default since (my personal opinion) literal replace is used much more frequently by most users.
- Possibly combine the replace UI with the "Find" UI so it's easy to do a task like find all instances of a string in a file, [possibly tweak the string to match exactly what you need to], switch to "replace" mode and replace all instances in one go, without having to re-enter the string again (would be a nice perk but not life-changing). See for example Notepad++ implementation (although that's GUI of course but I don't see why something equivalent, while limited to the above-mentioned features, can't be implemented in a text-based UI, at least the way it's done in Nano for example).
(1) which, as I think, requires (2), is the essential part, at least for me, although each of the other parts will definitely help if possible to implement.
Commit hash: c2cebaa
OS: Debian
Terminal: xterm
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels