-
Notifications
You must be signed in to change notification settings - Fork 61
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
Fixed inconsistency with vim-surround. fixes #47 and #26. #48
Conversation
Yes, it does make sense to keep them in sync, but I'm surprised to see this. |
@timcharper This is indeed a very surprising move and it comforts people to use More info here: https://github.com/syl20bnr/spacemacs/blob/master/doc/DOCUMENTATION.md#the-vim-surround-case This is not an issue for spacemacs since I will remap By the way, nobody has ever complain about this in evil-surround so there must be an explanation. |
Conforming to upstream behavior by default is likely to reduce surprise the most. If people want to revert the functionality with key-bindings, so be it. I don't particularly care for the change either and wish Tim Pope stood his ground. The capital-S vs lower-case-s had consistent meaning, and now this is broken. But it happened and I'm sure Tim Pope had a good reason. |
I agree with @syl20bnr, people should learn to use c instead of s. However, this should remain in sync to upstream vim-surround. |
I'm not sure Tim Pope had another reason than just fixing it because it broke the workflow of a non negligible number of users. Summoning @tpope :-) What is your official reason behind it ? You are right that the consistency with |
Yes, it was a very common complaint, and even I, after several years of using my own plugin, would occasionally flub and surround when I was trying to substitute. I think the lack of a motion for And the |
@tpope I see now the So my point is that your first intent with |
After change made in emacs-evil/evil-surround#48
The commit removes evil-Surround-region, but it should be bound to |
I noticed that; thanks. Commit 5e6bcb3 should resolve that; can you try it? |
Works fine, thank you! |
After change made in emacs-evil/evil-surround#48
So now the I use Is it possible to include some kind of "configuration" for this behavior, so one could switch to using "s" for substitution, "S" for surround in visual mode? |
I believe that's what the current default mappings are. If you don't like any, you could easily change them. This is what I use (I'm not sure if it matches exactly the default): (evil-define-key 'operator global-map "s" 'evil-surround-edit)
(evil-define-key 'operator global-map "S" 'evil-Surround-edit)
(evil-define-key 'visual global-map "S" 'evil-surround-region)
(evil-define-key 'visual global-map "gS" 'evil-Surround-region) |
Hmm, for me doing Thank you for suggestions, I will try. |
@edkolev Great! Thank you! I have one clarification though. I feel like the following statement is not completely correct for visual mode
If it was so, I wouldn't be so attached to using OTOH, in normal mode |
@tpope has changed this in vim-surround, so now he doesn't clobber v_s (see tpope/vim-surround@6f0984a). It makes sense to maintain parity with the vim-surround keybindings, right?