There are 2 very well known and established plugins to surround text in vim:
However it might be good to have one in the vim itself.
This package can do most if not all of what surround.vim can and by default uses the same ys, ds and cs operators, S for visual mode. It is less fancy than vim-sandwich which provides quite a few additional nice things.
Key difference is implementation, I use 3 simple operators (add, remove and change surround) that are naturally dot repeatable without using . remapping or repeat.vim.
Additionally, adding surround is different: ys(iw vs ysiw( (surround.vim) vs saiw( (vim-sandwich), basically the move comes the last.
I will add tests in either case (whether this would or wouldn't be accepted).
https://github.com/vim/vim/pull/20596
(5 files)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
And why did you change the order in the mapping? Considering most users are already used to vim-surround (or vim-sandwich) style mappings, I don't think it's wise to change it.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
And why did you change the order in the mapping? Considering most users are already used to vim-surround (or vim-sandwich) style mappings, I don't think it's wise to change it.
Initially I wanted to have the same order as surround.vim, however, the implementation is then:
.). mapping.Which I wanted to avoid. So it is ys{char}{motion} not ys{motion}{char}.
PS, it should be easy with . mapping though. If general consensus would be to have the same ys{motion}{char} I can change it.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
Let me try one additional idea, maybe it would work.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
And why did you change the order in the mapping? Considering most users are already used to vim-surround (or vim-sandwich) style mappings, I don't think it's wise to change it.
I knew, I was missing something really simple to actually make it ys{motion}{char}. Thanks @bfrg for spelling "I don't think it's wise to change it." It refreshed my thought process :).
A simple boolean var solved the issue I was trying to tackle for many other hours.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
can we have ys<motion>f? i use it a lot.
https://github.com/tpope/vim-surround/blob/master/doc/surround.txt#L138
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
Hm, thanks but this is quite a bit of code you are adding here. What do others think?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
can we have
ys<motion>f? i use it a lot.https://github.com/tpope/vim-surround/blob/master/doc/surround.txt#L138
we can, although it would be a bit more code :)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
@chrisbra, it is indeed more code than some of the other optional packages, but it is less than helptoc, matchit or editorconfig. Not to mention netrw :)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
This is done.
@bennyyip I will add function surround add/remove/change later.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()