Skip to content

Commit

Permalink
feat: use vim map description if rhs isn't available
Browse files Browse the repository at this point in the history
  • Loading branch information
willothy committed Dec 20, 2023
1 parent 9a68b37 commit 65109bd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lua/hawtkeys/ts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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, "<leader>"),
rhs = vim_keymap.rhs,
rhs = rhs,
from_file = "Vim Defaults",
})
end
Expand Down

0 comments on commit 65109bd

Please sign in to comment.