micro-editor / micro-editor/micro

More sophisticated replace

Open
#1,920 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
29.6k
Forks
1.4k
Avg merge
2d 18h
Merged PRs (30d)
10

Description

Micro's replace feature is less powerful than Nano's in a few ways:

  • Since it's just a command for the command bar and not a menu (like Find is), arguments sometimes require shell-like escaping.

  • The decision between replace and replaceall must be made at the start of the operation. Contrast Nano's approach which allows you to say "yes, and do all the ones after this" at any replace prompt. In Micro I would have to cancel and do a replaceall. And even that doesn't allow "replace all of the matches after this one" without catching the ones before.

  • There is no "find/replace backward". In Nano you could set it to go in reverse order. There are also not switches for case sensitivity or for disabling regex - they seem to be always interpeted as regexes.

  • Finally, in Nano I can switch between Find and Replace, or between literal and regex, or between case sensitive and not, or between forward and backward, with context-specific hotkeys at the find/replace menu. In Micro, these switches are all implemented as separate commands where they exist.

    I understand the rationale for having them be separate commands, it makes them more accessible to programmatic use from plugins and such (I guess). But I am missing the power of Nano's replace.

Considering diving into Micro's codebase for the first time to do something other than syntax highlighting, but first I want to know that a PR implementing these enhancements would be accepted.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing Micro's existing replace, replaceall, and find commands, then compare their behavior with the Nano workflows described in the issue. Before coding, get agreement on which enhancements are in scope; done would require an accepted design and corresponding behavior for the selected replacement options.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.