Skip to content

Conversation

@cjohnson19
Copy link

@cjohnson19 cjohnson19 commented Mar 17, 2025

What this PR does / why we need it:

This PR adds non alphabetic characters to surround based operations (e.g. yi$, ysi$}). These actions are supported by vim surround, so users expect this to line up when interacting with VSCodeVim.

Which issue(s) this PR fixes

Fixes #8895

Special notes for your reviewer:

I added the ability to recognize which actions match user's input with a RegExp. I wasn't sure of a better way to specify motions which really encompass character classes, but am more than open to improving this based on any feedback.

@J-Fields
Copy link
Member

Is $ a special character treated like a quote, or does this work for any character in Vim surround?

@cjohnson19
Copy link
Author

That's a great question, and one I didn't consider previously. Looks like vim-surround will treat any non-alphabetic character as a valid surrounding target. From the documentation:

Undefined replacement characters (with the exception of alphabetic characters) default to placing themselves at the beginning and end of the destination, which can be useful for characters like / and |.

@cjohnson19
Copy link
Author

Sorry to revive this PR.

Would we be interested in merging a version which extends the surround behavior to work for all undefined and non-alphabetic characters as opposed to just $? If so, I would be happy to work on that.

@cjohnson19 cjohnson19 changed the title Add $ as a surround character (#8895) Add non-alphabetic characters to surround operations (#8895) Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants