VSCodeVim / Vim

:star: Vim for Visual Studio Code
http://aka.ms/vscodevim
MIT License
13.75k stars 1.31k forks source link

Support `:g[lobal]/[pattern]/[command]` #3010

Open Leekao opened 6 years ago

Leekao commented 6 years ago

One of the main reasons I love VIM so much is the option to do "g/console.log/d" to clear out all the lines with console.log on my scripts, is there any chance of supporting it?

jpoon commented 6 years ago

This should work with neovim if you want to give it a try.

remler commented 5 years ago

The ability to do global search and replace is CRITICAL to a VI emulation. This is the single reason I would use the program. If it doesn't support global search and replace, for example by doing:

:g/old pattern/s//new pattern/g

then that effectively breaks the program for me I'm afraid.

Leekao commented 5 years ago

@remler Until this is added please note that you can just mark the lines visually and then use "s/old/new/g"

SHanded commented 3 years ago

Hmm, 2 years ago... not having much hope for global to be implemented at this point. It's one of VIMs absolutely most powerful features... such a pity.

brianjmurrell commented 2 years ago

:1,$<command> (i.e. :1,$s/foo/bar/) is a workaround, but I would imagine much less efficient as it's applying the command to every line instead of only lines that match a pattern as would happen with :g/foo/s//bar/.

But probably more important/annoying is just the lack of something that a lot of people have muscle-memory for.

remler commented 2 years ago

Thank you. For some reason I never thought of doing this because, like you said, "muscle memory." But this can be useful. Thanks again!

On Sun, Apr 10, 2022, 07:37 Brian J. Murrell @.***> wrote:

:1,$ (i.e. :1,$s/foo/bar/) is a workaround, but I would imagine much less efficient as it's applying the command to every line instead of only lines that match a pattern as would happen with :g/foo/s//bar/.

But probably more important/annoying is just the lack of something that a lot of people have muscle-memory for.

— Reply to this email directly, view it on GitHub https://github.com/VSCodeVim/Vim/issues/3010#issuecomment-1094252002, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHKBCPYNU264RKCOWZHA3ETVEK4Q3ANCNFSM4FSM3WUQ . You are receiving this because you were mentioned.Message ID: @.***>

martchellop commented 1 year ago

I'm interested in implementing this feature. How would I go about doing that?

airstrike commented 9 months ago

just wanted to +1 as this is the single feature I miss on vscode vim. I don't think I've noticed anything else missing to date...

remler commented 2 months ago

Hi,

I'm sorry -- I'm only seeing this email 15 months later!

Was this question directed towards me specifically? If so, I can only really provide guidance to how it is "supposed" to work -- although I would think you can find that from numerous sources.

But if you're asking for technical guidance -- which I suspect you are -- then I'm afraid that I'm of no use here.

However I remain curious if anything has happened in the past year or so -- I'm not sure if I've ever tried to use this since.

-- Thanks, -- Daniel

On Tue, Mar 28, 2023 at 7:04 PM martchellop @.***> wrote:

I'm interested in implementing this feature. How would I go about doing that?

— Reply to this email directly, view it on GitHub https://github.com/VSCodeVim/Vim/issues/3010#issuecomment-1487716957, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHKBCP4IDAELYBUML5ZWXELW6NU6JANCNFSM4FSM3WUQ . You are receiving this because you were mentioned.Message ID: @.***>