Skip to content

Commit 8fba1b5

Browse files
willnorrischentoast
authored andcommitted
keymap: use nvim api for setting keymaps
This allows setting a description for each mapping that will render nicely in plugins like which-key.
1 parent bb25ae3 commit 8fba1b5

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lua/marks/init.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ end
167167

168168
local function apply_mappings()
169169
for cmd, key in pairs(M.mappings) do
170-
vim.cmd("nnoremap <silent> "..key.." <cmd>lua require'marks'."..cmd.."()<cr>")
170+
vim.api.nvim_set_keymap("n", key, "", { callback = M[cmd], desc = "marks: "..cmd:gsub("_", " "),
171+
noremap = true })
171172
end
172173
end
173174

0 commit comments

Comments
 (0)