Adding keymaps for specific surround commands #876
-
I'm trying to add keymaps in visual mode of the form
but it results in simply inserting I guess I should call the surround function directly, and not via the keymap |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
By default
Just in case: this approach for adding surrounding will work only in Visual mode. In Normal mode there needs to be a target (textobject/motion) after |
Beta Was this translation helpful? Give feedback.
By default
vim.keymap.set()
treats keys in right hand side as if they have default meaning, i.e. no remap, i.e. "noremap".You can achieve what you want by adding
remap = true
option. Like this:Just in case: this approach for adding surrounding will work only in Visual mode. In Normal mode there needs to be a target (textobject/motion) after
sa
.