fix(nvim): comment box keymappings

This commit is contained in:
2024-01-22 00:43:45 +02:00
parent c316a8eb2f
commit 2e6a1582bf

View File

@@ -1,19 +1,22 @@
-- Keymaps are automatically loaded on the VeryLazy event -- 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 -- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
-- Add any additional keymaps here -- Add any additional keymaps here
local wk = require("which-key")
local keymap = vim.keymap.set -- ╭──────────────────────────────────────────────────────────╮
-- │ Comment box │
-- ────────────────────────────────────────────────────────── -- ──────────────────────────────────────────────────────────
-- │ Comment box │ wk.register({
-- ╰──────────────────────────────────────────────────────────╯ ["<Leader>"] = {
local cb = require("comment-box") b = {
c = {
-- left aligned fixed size box with left aligned text name = "□ Comment boxes",
keymap({ "n", "v" }, "<Leader>bcb", cb.lbox, { desc = "Comment: Left aligned" }) b = { "<Cmd>CBccbox<CR>", "Box Title" },
-- centered adapted box with centered text t = { "<Cmd>CBllline<CR>", "Titled Line" },
keymap({ "n", "v" }, "<Leader>bcc", cb.ccbox, { desc = "Comment: Centered" }) l = { "<Cmd>CBline<CR>", "Simple Line" },
m = { "<Cmd>CBllbox14<CR>", "Marked" },
-- centered line d = { "<Cmd>CBd<CR>", "Remove a box" },
keymap("n", "<Leader>bcl", cb.cline, { desc = "Comment: Centered line" }) },
keymap("i", "<M-l>", cb.cline, { desc = "Comment: Centered line" }) },
},
})