diff --git a/lua/dressing/map_util.lua b/lua/dressing/map_util.lua index af1e41a..55d12b9 100644 --- a/lua/dressing/map_util.lua +++ b/lua/dressing/map_util.lua @@ -35,19 +35,17 @@ M.create_maps_to_plug = function(bufnr, mode, bindings, prefix) end end -- Prefix with unless this is a or :Cmd mapping - if type(rhs) == "string" and not rhs:match("[<:]") then - rhs = "" .. prefix .. rhs - end - if mode == "i" then - -- HACK for some reason I can't get plug mappings to work in insert mode - for _, map in ipairs(maps) do - if map.lhs == rhs then - ---@diagnostic disable-next-line: cast-local-type - rhs = map.callback or map.rhs - break - end + if type(rhs) == "string" then + if not rhs:match("[<:]") then + rhs = "" .. prefix .. rhs .. "" + else + rhs = rhs .. "" + end + if mode == "i" then + rhs = "" .. rhs end end + ---@cast rhs string vim.keymap.set(mode, lhs, rhs, opts) end