From f4c15121593c9e952bcbdc720bd775c22c38a5d7 Mon Sep 17 00:00:00 2001 From: Guennadi Maximov C Date: Sat, 31 Aug 2024 20:43:01 -0600 Subject: [PATCH] fix(api): Use `nvim_buf_del_keymap()` instead of `nop()` for cpp. Signed-off-by: Guennadi Maximov C --- lua/user_api/util/init.lua | 35 +++++++++++------------------------ 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/lua/user_api/util/init.lua b/lua/user_api/util/init.lua index 00c6a94..7803e9e 100644 --- a/lua/user_api/util/init.lua +++ b/lua/user_api/util/init.lua @@ -364,30 +364,17 @@ function M.assoc() map_dict(Keys, 'wk.register', false, 'n', 0) -- Kill plugin-defined mappings - vim.schedule(function() - local nop = require('user_api.maps').nop - - nop({ - 'ih', - 'is', - 'ihn', - }, { - noremap = true, - silent = true, - buffer = 0, - nowait = true, - }, 'i', '') - nop({ - 'ih', - 'is', - 'ihn', - }, { - noremap = true, - silent = true, - buffer = 0, - nowait = true, - }, 'n', '') - end) + local nop = vim.api.nvim_buf_del_keymap + + local i_del = { + 'ih', + 'is', + 'ihn', + } + + for _, lhs in next, i_del do + nop(0, 'i', lhs) + end end, }, {