From 65109bd5bbc44195fed80ec6d75641a5b246df99 Mon Sep 17 00:00:00 2001 From: Will Hopkins Date: Tue, 19 Dec 2023 20:55:58 -0800 Subject: [PATCH] feat: use vim map description if rhs isn't available --- lua/hawtkeys/ts.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/hawtkeys/ts.lua b/lua/hawtkeys/ts.lua index ee83510..4c89d87 100644 --- a/lua/hawtkeys/ts.lua +++ b/lua/hawtkeys/ts.lua @@ -91,11 +91,15 @@ local function get_keymaps_from_vim() local vim_keymaps_raw = vim.api.nvim_get_keymap("n") print("Collecting vim keymaps") for _, vim_keymap in ipairs(vim_keymaps_raw) do + local rhs = vim_keymap.rhs + if rhs == nil or rhs == "" then + rhs = vim_keymap.desc + end table.insert(vimKeymaps, { mode = vim_keymap.mode, -- TODO: leader subsitiution as vim keymaps contain raw leader lhs = vim_keymap.lhs:gsub(config.leader, ""), - rhs = vim_keymap.rhs, + rhs = rhs, from_file = "Vim Defaults", }) end