Skip to content

Add global#9939

Open
tvapait wants to merge 2 commits intoVSCodeVim:masterfrom
tvapait:add-global
Open

Add global#9939
tvapait wants to merge 2 commits intoVSCodeVim:masterfrom
tvapait:add-global

Conversation

@tvapait
Copy link
Copy Markdown

@tvapait tvapait commented Feb 17, 2026

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": true in tsconfig.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!

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

:g[lobal] feature not present Support :g[lobal]/[pattern]/[command]

1 participant