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

Add support for vim Operator::AddSurrounds.target in keymap config #23088

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mgsloan
Copy link
Contributor

@mgsloan mgsloan commented Jan 13, 2025

cc @ConradIrwin. Found this while doing the keymap json schemas change. Does it make sense?

Release Notes:

  • N/A

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jan 13, 2025
@mgsloan mgsloan requested a review from ConradIrwin January 13, 2025 20:46
@ConradIrwin
Copy link
Member

I don't think this is needed, but it's also doesn't seem like it would cause any problems.

In typical vim fashion you first hit a binding (ys by default) to push AddSurrounds to the operator stack, and then you hit a binding ("a" or "i") to push the Around/Inside operator to the stack; and finally you hit another key binding . This causes (convolutedly) the AddSurrounds operator to be popped and a new one to be pushed with the target object.

If someone wanted to bind a specific key to "add-surrounds to a specific object" the vim approach would be to use workspace::SendKeystrokes: ["y s a w"] instead of constructing the object manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants