Open
Conversation
Update glob import in test/index.ts for glob v9+ API (named export, promise-based) and add skipLibCheck to tsconfig.json to resolve @types/glob incompatibility.
…v[global] Ex commands
Add the :g/{pattern}/{cmd} command, which executes {cmd} on every line
matching {pattern}, and :v/{pattern}/{cmd} (and :g!), which operates on
non-matching lines.
Supported features:
- Line range (default: %, entire file)
- Any non-alphanumeric delimiter (:g#pat#cmd)
- Sub-commands: :d, :s, :normal, and others
- Two-pass execution with line-offset tracking
Test coverage includes 26 comprehensive test cases based on real-world
use cases from vim.fandom.com/wiki/Power_of_g, covering delete,
substitute, move, copy, normal mode commands, and various delimiters.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
Implements the :g[lobal] command
Which issue(s) this PR fixes
fixes #3010, fixes #9556
Special notes for your reviewer:
Hi. I will admit that I created this with Opus 4.6, so I don't really feel like I can take much credit for it. I assure you, this message is AI-free. Missing :g has bugged me for a long time, Sonnet couldn't quite do it, Opus succeeded today. I have :g now, I'm happy.
I reviewed the changes, added tests, and I think it looks good. I compiled it and tested it on my machine.
I'm a bit suspicious about the
"skipLibCheck": trueintsconfig.json, so I asked Opus about that. It says it's not optimal, because it "Hides the underlying incompatibility instead of fixing it" and "Better fix (but outside your scope): Update @types/glob or pin glob/minimatch versions to compatible ones".I hope this will add some value to the project. We're living in strange times. No need to credit me. Cheers and thanks for all the hard work!