VSCodeVim / VSCodeVim/Vim

Surround Input mode (`ys` in Normal or `S` in Visual) doesn't recognize dollar sign

Open
#8,895 0 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description

When trying to surround a piece of text in dollar signs (such as starting a math environment for a markdown file) the dollar sign isn't recognized and instead snaps me back into Normal mode. The Surround plugin is enabled, and this works for other characters (", ', (), etc. This is supposed to work in Vim (as suggested by StackOverflow posts)

To Reproduce

Option A (normal mode)

    1. Enter an editor in normal mode
    1. Type ys[motion]$ with any motion (for example, ysiw$)
    1. Watch as nothing happens (except maybe the cursor moving)

Option B (visual mode)

    1. Enter an editor in visual mode (using v, V or <C-v> from normal mode)
    1. Make a selection (for example iw)
    1. Type S to enter Surround Input mode
    1. Type $
    1. Watch as you are put in normal mode with no dollar signs anywhere you expected

Expected behavior

The dollar signs should appear around the selected text thanks to the Surround plugin, as it happens with other characters.

Environment

  • VsCodeVim version: 1.27.2
  • VSCode version: 1.86.1
  • OS: Windows 11 Home x64 23H2, build 22631.3155

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.

Research direction

Start by tracing the Surround Input handling reached from ys in Normal mode and S in Visual mode, then reproduce the issue by entering $ after a selection or motion. Done means dollar signs surround the selected text in both modes without returning to Normal mode, while existing surround characters continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.