Support for :[range]g/{pattern}/[cmd]

Open
#8,483 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
typescript, vscode

Research direction

The requested entry point is the Vim command :[range]g/{pattern}/[cmd], with output remaining at the original buffer position. Start by locating existing command and search handling in the extension; done means the command supports the requested range, pattern, and command behavior without moving the current position.

Written by the indexing model from the issue text.

Description

Hi team,

Love your product - makes my time easier using VSC with a Vi based editor, particularly having access to regex.

Is your feature request related to a problem? Please describe.
I am missing the :g command. This is very useful in scanning a file for all uses of a tag (variable/function/text) without losing the context of what you are working on, ie

:g/{some tag}/p
** You are still at the same spot in the buffer **

For example if you wanted to check an expression you use in your code before adding/changing a similar line you could use :g/{part of the expression}/p to list all uses. This is very helpful when debugging code but is also useful when extending code.

Can you please prioritise this feature.

Describe the solution you'd like
Implementation of :[range]g/{pattern}/[cmd]

Describe alternatives you've considered
The only alternative to this is to search for the tag and cycle through all uses with the N/n commands before going back to the same spot in the buffer. This is clunky and time consuming.

Dominant language
TypeScript
Stars
15.2k
Forks
1.5k
Avg merge
3d 18h
Merged PRs (30d)
6

Contributor guide

Open the contributing guide

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.

More from VSCodeVim/Vim

All issues in VSCodeVim/Vim

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.