nvim: Only register markdown which-keys if available
Check for availability of which-key plugin before setting up layer key descriptions.
This commit is contained in:
parent
405af0f020
commit
989081abfc
1 changed files with 5 additions and 2 deletions
|
@ -1,6 +1,9 @@
|
||||||
local map = vim.keymap.set
|
local map = vim.keymap.set
|
||||||
require("which-key").register({ ["<localleader>c"] = { name = "+md-code" } })
|
|
||||||
require("which-key").register({ ["<localleader>e"] = { name = "+criticmarkup" } })
|
if require("core.util").is_available("which-key") then
|
||||||
|
require("which-key").register({ ["<localleader>c"] = { name = "+codecells" } })
|
||||||
|
require("which-key").register({ ["<localleader>e"] = { name = "+criticmarkup" } })
|
||||||
|
end
|
||||||
|
|
||||||
if require("zk.util").notebook_root(vim.fn.expand("%:p")) ~= nil then
|
if require("zk.util").notebook_root(vim.fn.expand("%:p")) ~= nil then
|
||||||
map("n", "<CR>", "<cmd>lua vim.lsp.buf.definition()<cr>", { silent = true })
|
map("n", "<CR>", "<cmd>lua vim.lsp.buf.definition()<cr>", { silent = true })
|
||||||
|
|
Loading…
Reference in a new issue