From 4e2d151575a9a3b3896ac722b9bb47a1cb985db1 Mon Sep 17 00:00:00 2001 From: Fabrice Mouhartem Date: Sun, 24 Dec 2023 11:27:34 +0100 Subject: [PATCH] Add after/plugin/mappings.lua to resolve remap conflicts --- after/plugin/mappings.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 after/plugin/mappings.lua diff --git a/after/plugin/mappings.lua b/after/plugin/mappings.lua new file mode 100644 index 0000000..f1b6198 --- /dev/null +++ b/after/plugin/mappings.lua @@ -0,0 +1,13 @@ +--[[ +-- Contains fixes for mappings created by plugins +--]] + +-- Comments.nvim adds `gbc` command, which conflicts with `gb/gé` to move +-- between tabs +if vim.fn.maparg("gbc") ~= "" then + vim.keymap.del("n", "gbc") + vim.keymap.set('n', 'gBc', function() + return vim.api.nvim_get_vvar('count') == 0 and '(comment_toggle_blockwise_current)' + or '(comment_toggle_blockwise_count)' + end, { expr = true, desc = 'Comment toggle current block' }) +end