Any way to setup Lazy keymaps instead of plugin mappings, (or somehow get whichkey to display the plugin mappings)? #320
Unanswered
jamesonBradfield
asked this question in
Q&A
Replies: 2 comments 4 replies
-
I would imagine which-key should automatically register nvim-surround keymaps; try hitting |
Beta Was this translation helpful? Give feedback.
0 replies
-
@jamesonBradfield @kylechui did you guys figure out a way to display the keymaps with which key? it is really hard to remember them all and I haven't been able to enable the mappings with the following config. return {
"kylechui/nvim-surround",
version = "*",
event = "BufRead",
vscode = "true",
config = function()
require("nvim-surround").setup({})
if not vim.g.vscode then
-- Setup which-key descriptions for nvim-surround keymaps
local wk = require("which-key")
local mappings = {
{ mode = { "n", "v" } },
{ "ys", group = "surround" },
{ "ysa", group = "around" },
{ 'ysa"', desc = "Surround around double quotes" },
{ "ysa'", desc = "Surround around single quotes" },
{ "ysa(", desc = "Surround around parentheses" },
{ "ysa<", desc = "Surround around angle brackets" },
{ "ysaW", desc = "Surround around WORD" },
{ "ysa[", desc = "Surround around brackets" },
{ "ysa`", desc = "Surround around backticks" },
{ "ysap", desc = "Surround around paragraph" },
{ "ysas", desc = "Surround around sentence" },
{ "ysat", desc = "Surround around tag block" },
{ "ysaw", desc = "Surround around word" },
{ "ysa{", desc = "Surround around braces" },
{ "ysi", group = "inside" },
{ 'ysi"', desc = "Surround inside double quotes" },
{ "ysi'", desc = "Surround inside single quotes" },
{ "ysi(", desc = "Surround inside parentheses" },
{ "ysi<", desc = "Surround inside angle brackets" },
{ "ysiW", desc = "Surround inside WORD" },
{ "ysi[", desc = "Surround inside brackets" },
{ "ysi`", desc = "Surround inside backticks" },
{ "ysip", desc = "Surround inside paragraph" },
{ "ysis", desc = "Surround inside sentence" },
{ "ysit", desc = "Surround inside tag block" },
{ "ysiw", desc = "Surround inside word" },
{ "ysi{", desc = "Surround inside braces" },
}
wk.add(mappings)
end
end,
}
|
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Just as the title says, I have a hard time remembering keybinds and whichkey is a lifesaver.
Beta Was this translation helpful? Give feedback.
All reactions