Closed NotNullBool closed 1 month ago
I imagine you could do something like this, which wouldn't require any modification to the plugin itself:
require("nvim-surround").setup({
keymaps = {
ys = "false",
},
})
vim.keymap.set("n", "ys", function()
-- Disable highlights here
require("nvim-surround").normal_surround()
-- Re-enable highlights here
end)
Edit: This won't work as is because of issues with g@
, but I'll think about it some more later
@NotNullBool Have you taken a look at NvimSurroundHighlight
? I personally use:
vim.cmd.highlight("default link NvimSurroundHighlight Todo")
to make the highlights more visible.
Yeah I thought about that but I wanted similar functionality to visual mode since that disables cursor line and cursor column temporarily
Ah I see; that isn't exactly "intentional" behavior since the highlights just get auto-disabled whenever you enter visual mode. Maybe I'll add some callback function that takes in a selection
and is called everytime some highlight event occurs, but I'm not sure yet.
Thanks for hearing me out I really appreciate it! :)
I think managing the highlights is not a key concern for this plugin, so I'll probably pass on implementing it "upstream". Your fork seems relatively simple and works, so I would suggest you keep that.
Checklist
:h nvim-surround
to see if there might be any relevant information there?Is your feature request related to a problem? Please describe. If possible, provide a sample buffer/keymap sequence, along with the expected result.
On highlight function feature.
Describe the solution you'd like A clear and concise description of what you want to happen.
I want to either have a way to be able to disable the column line and cursor line highlight or to have a function called when highlight is active.
So this can be more consistant to visual mode since I cant see the highlight because of my cursor line being too bright.