Support for `:sg` command
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.2k
- Forks
- 1.5k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 6
Description
Describe the bug
In vi/vim, if you want to repeat the last :s/text/replacedtext/g command you can just type :sg. This doesn't seem to work in VSCode. :s does, but it only replace the first occurrence in the line.
To Reproduce
Steps to reproduce the behavior:
- Create a text file with these two lines
REPLACEME REPLACEME
REPLACEME REPLACEME
- Execute
:s/REPLACEME/REPLACED/gon first line, verify that both occurrences are replaced - Execute
:sgon second line
Observed behavior
Error E492: Not an editor command: sg
Expected behavior
The second line show change to contain
REPLACED REPLACED
Screenshots
If applicable, add screenshots to help explain your problem.
If remapping-related, please attach log output: https://github.com/VSCodeVim/Vim#debugging-remappings.
Environment (please complete the following information):
Extension (VsCodeVim) version: 1.18.9
VSCode version: 1.53.1
OS: MacOS 11.2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue in VSCodeVim using the documented two-line text and the :s/REPLACEME/REPLACED/g followed by :sg command sequence. Trace the Ex-command handling for :s and confirm that :sg repeats the previous substitution with the global flag. Done means the second line changes to REPLACED REPLACED without E492.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 50/100