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 ys normal mode mapping for surround #52

Open
gotgenes opened this issue Mar 14, 2021 · 2 comments
Open

Add ys normal mode mapping for surround #52

gotgenes opened this issue Mar 14, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@gotgenes
Copy link
Contributor

This is a feature request to support ys<motion/text object><surround character> in normal mode to surround <text object> with <character>. It is similar to ys from visual selection mode. The description from surround.vim:

ys takes a valid Vim motion or text object as the first object, and wraps                                                                                                                       
it using the second argument as with cs.  (It's a stretch, but a good                                                                                                                           
mnemonic for "ys" is "you surround".)                                                                                                                                                           
                                                                                                                                                                                              
Old text                  Command     New text                                                                                                                                                
Hello w*orld!             ysiw)       Hello (world)!

[In the example above, the * denotes the position of the cursor.]

Right now the workaround from normal mode is to enter v<text object>ys<character>. This feature would cut down on a few keypresses. It would also help those users who have gotten used to this normal mode mapping from surround.vim.

Thanks for considering this request!

@jeffreytse jeffreytse self-assigned this Mar 15, 2021
@jeffreytse jeffreytse added the enhancement New feature or request label Mar 15, 2021
@pjg
Copy link

pjg commented Apr 17, 2021

Yes, this would be a great addition!

@musjj
Copy link

musjj commented May 17, 2024

Would love to see this implemented too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants