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

mini.surround prevents standard vim s (Substitute) from working. #1328

Open
sbc100 opened this issue Jan 24, 2025 · 6 comments
Open

mini.surround prevents standard vim s (Substitute) from working. #1328

sbc100 opened this issue Jan 24, 2025 · 6 comments

Comments

@sbc100
Copy link

sbc100 commented Jan 24, 2025

First of all, thanks for all the great work here. This project made my conversion to neovim (after 25+ years or vim usage) very smooth and educational.

After using kickstart to get started with neovim it was pretty surprising to me that find this basic editing command no longer working. I'm not sure if this should be considered a bug in the default bindings of nvim-surround (that repo doesn't seem to have bug reports enabled anyway)? Maybe the users of that plugin all either don't care about this vim feature, or override the default mappings?

Regardless, it does seem a little odd to install a plugin the breaks some fairly core vim behaviour as part of kickstart. Perhaps that one line of init.lua could be removed or commented out: require('mini.surround').setup()?

Again, thank you. This was really the only wrinkle/surprise I had to deal with.

@Capta1nCool
Copy link

Capta1nCool commented Jan 26, 2025

Hey @sbc100!
The s binding seems to work fine for me, have you modified your init.lua?

@sbc100
Copy link
Author

sbc100 commented Jan 26, 2025

Wait, so if you you want to replace the character under the cursor with foo you can type sfoo<Esc>?

For me that doesn't work unless I comment out require('mini.surround').setup(). Which makes sense because mini.surround binds sf to Find Surrounding. Unless I'm missing something?

@Capta1nCool
Copy link

yeah, I can do that.

I think the issue you are facing is cuz of an older version of which-key - source

@sbc100
Copy link
Author

sbc100 commented Jan 27, 2025

Interesting, I don't have which-key install at all (AFAICT).

How is it supposed to work if I type sfoo? Oh I see... if I wait whole second after typing the first s it knowns I mean s ant it goes into insert mode for the foo. However, if I just type sfoo and normal typing speed mini.surround seems to take over.

Can you type sfoo at normal typing speed with mini.surround installed? (when I do this it ends up interpreting the o as open new line).

@Capta1nCool
Copy link

Capta1nCool commented Jan 28, 2025

ohh yeah, typing at normal speed doesn't seem to work.

Have you tried this solution?

@xzbdmw
Copy link

xzbdmw commented Feb 2, 2025

Yeah so many plugins want to overwrite "s", for surround/substitute/jumping around etc, because "s" is a very ergonomic position whose functionality can easily replaced by "cl" or "xi", you can configure it to vim-surround style keymap though.

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

No branches or pull requests

3 participants