Closed kohane27 closed 4 months ago
In my opinion, this isn't something that I would want to implement as part of the default mappings; hopefully this suffices for your use case:
vim.keymap.set("n", "yS", "<Plug>(nvim-surround-normal)$")
require("nvim-surround").setup({
keymaps = {
normal_line = false,
}
})
Thank you @kylechui for your prompt reply and the solution. It works perfectly! Thank you again!
Apologies for bothering you again.
Is there any changes to the API?
Today I realized vim.keymap.set("n", "yS", "<Plug>(nvim-surround-normal)$")
doesn't work anymore.
But I checked https://github.com/kylechui/nvim-surround/issues/77 and there doesn't seem to be any recent changes.
:verbose map yS
n yS * <Plug>(nvim-surround-normal)$
Last set from Lua
Any input is much appreciated. Thank you!
I don't believe so, can you try it with just nvim-surround installed? Please provide some minimal config
Hello @kylechui , thank you for getting back to me. I really appreciate it.
I've further tested and it turned out that the problem is triggering the command. Please see the video below:
https://github.com/kylechui/nvim-surround/assets/57322459/b813c653-9ba1-416e-af18-5f6d977582e6
I thought it's the problem with the trigger command, so I changed it to ys
:
vim.keymap.set("n", "ys", "<Plug>(nvim-surround-normal)$")
https://github.com/kylechui/nvim-surround/assets/57322459/b166ff81-f31b-485c-aba7-e9a40420ae0e
My timeoutlen
value is 450 and I tried changing it to 1000, but the same thing occur: I need to press ys
quite quickly in order to trigger the command. I think this is not nvim-surround
problem. Thank you for confirming with no API changes and I'll investigate further.
Let me know if you discover the root cause!
@kohane27 I just realized that this is probably due to after the timeout for ys
expiring, Neovim is now awaiting some motion to be passed into the y
ank action. By default, s
is not a well-defined motion, so ys
slowly effectively just cancels the action.
Hello there. Hope you're doing well. Thank you for creating
nvim-surround
.I migrated from vim-sandwich. There's a built-in feature as shown below:
https://user-images.githubusercontent.com/57322459/223746223-f183bc75-a5dc-4302-92a4-673af1dd34f7.mp4
Basically, pressing
yS
allows a user to surround from the current cursor till the end of line.I've looked into the doc and
nvim-surround
doesn't seem to have this functionality. I wonder if you'll consider to implement it? Thank you!