Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support gdefault option #3594

Closed
zombiezen opened this issue Mar 17, 2019 · 5 comments
Closed

Support gdefault option #3594

zombiezen opened this issue Mar 17, 2019 · 5 comments

Comments

@zombiezen
Copy link

Is your feature request related to a problem? Please describe.
When using the :s command, I frequently want to replace all instances of a pattern on a line.

Describe the solution you'd like
In Vim, I would set gdefault in my .vimrc. However, doing the same thing in this extension does not appear to work.

@Vintharas
Copy link

There's a setting within the VSCodeVim preferences that enables that behavior: vim.substituteGlobalFlag. You can find it through the default VSCode preferences: user settings window.

verbatim from the README:

Setting Description Type Default Value
vim.substituteGlobalFlag Similar to Vim's gdefaultsetting. /g flag in a substitute command replaces all occurrences in the line. Without this flag, replacement occurs only for the first occurrence in each line. With this setting enabled, the g is on by default. Boolean false

@zombiezen
Copy link
Author

Thanks, that works for now. I am curious why this extension doesn't recognize gdefault directly.

@Vintharas
Copy link

@jpoon
Copy link
Member

jpoon commented Mar 18, 2019

Hm, that's confusing. We should probably consolidate these two configurations or rename substituteGlobalFlag to gdefault.

@J-Fields
Copy link
Member

J-Fields commented Sep 5, 2019

As of the next release, substituteGlobalFlag will be deprecated in favor of gdefault

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants