From 989081abfceae8385000cb39bcb2a6bad03cb726 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Thu, 6 Jun 2024 15:40:01 +0200 Subject: [PATCH] nvim: Only register markdown which-keys if available Check for availability of which-key plugin before setting up layer key descriptions. --- nvim/.config/nvim/after/ftplugin/markdown.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nvim/.config/nvim/after/ftplugin/markdown.lua b/nvim/.config/nvim/after/ftplugin/markdown.lua index 739dcf6..19696ba 100644 --- a/nvim/.config/nvim/after/ftplugin/markdown.lua +++ b/nvim/.config/nvim/after/ftplugin/markdown.lua @@ -1,6 +1,9 @@ local map = vim.keymap.set -require("which-key").register({ ["c"] = { name = "+md-code" } }) -require("which-key").register({ ["e"] = { name = "+criticmarkup" } }) + +if require("core.util").is_available("which-key") then + require("which-key").register({ ["c"] = { name = "+codecells" } }) + require("which-key").register({ ["e"] = { name = "+criticmarkup" } }) +end if require("zk.util").notebook_root(vim.fn.expand("%:p")) ~= nil then map("n", "", "lua vim.lsp.buf.definition()", { silent = true })