From 2e6a1582bf5b31c47aba0fb3a544652545c9530e Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Mon, 22 Jan 2024 00:43:45 +0200 Subject: [PATCH] fix(nvim): comment box keymappings --- config/nvim/lua/config/keymaps.lua | 33 ++++++++++++++++-------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/config/nvim/lua/config/keymaps.lua b/config/nvim/lua/config/keymaps.lua index 38d2d7b..a12c306 100644 --- a/config/nvim/lua/config/keymaps.lua +++ b/config/nvim/lua/config/keymaps.lua @@ -1,19 +1,22 @@ -- Keymaps are automatically loaded on the VeryLazy event -- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua -- Add any additional keymaps here +local wk = require("which-key") -local keymap = vim.keymap.set - --- ╭──────────────────────────────────────────────────────────╮ --- │ Comment box │ --- ╰──────────────────────────────────────────────────────────╯ -local cb = require("comment-box") - --- left aligned fixed size box with left aligned text -keymap({ "n", "v" }, "bcb", cb.lbox, { desc = "Comment: Left aligned" }) --- centered adapted box with centered text -keymap({ "n", "v" }, "bcc", cb.ccbox, { desc = "Comment: Centered" }) - --- centered line -keymap("n", "bcl", cb.cline, { desc = "Comment: Centered line" }) -keymap("i", "", cb.cline, { desc = "Comment: Centered line" }) +-- ╭──────────────────────────────────────────────────────────╮ +-- │ Comment box │ +-- ╰──────────────────────────────────────────────────────────╯ +wk.register({ + [""] = { + b = { + c = { + name = "□ Comment boxes", + b = { "CBccbox", "Box Title" }, + t = { "CBllline", "Titled Line" }, + l = { "CBline", "Simple Line" }, + m = { "CBllbox14", "Marked" }, + d = { "CBd", "Remove a box" }, + }, + }, + }, +})