From eb9fa8a156bfce493453f80af3eb6f0fe5bd01d4 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 20 Jun 2023 13:30:24 +0200 Subject: [PATCH] nvim: Fix zk plugin and lsp loading correctly The plugin was not loading since lazyloading was not given an event to start it with. Now, anytime any zk command is given, or we enter a prose-like filetype the plugin is sourced. The zk lsp on the other hand was started twice whenever the plugin was loaded, since we also loaded it through the lspconfig manually. This commit fixes both issues by sourcing and plugin and letting the plugin load the lsp as well. --- nvim/.config/nvim/lua/plugins/config/lsp.lua | 1 - nvim/.config/nvim/lua/plugins/prose.lua | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/nvim/.config/nvim/lua/plugins/config/lsp.lua b/nvim/.config/nvim/lua/plugins/config/lsp.lua index 645c640..14dc916 100644 --- a/nvim/.config/nvim/lua/plugins/config/lsp.lua +++ b/nvim/.config/nvim/lua/plugins/config/lsp.lua @@ -37,7 +37,6 @@ local servers = { texlab = {}, tsserver = {}, yamlls = {}, - zk = {}, } local function on_attach(client, bufnr) diff --git a/nvim/.config/nvim/lua/plugins/prose.lua b/nvim/.config/nvim/lua/plugins/prose.lua index cc7dc2d..758c8e2 100644 --- a/nvim/.config/nvim/lua/plugins/prose.lua +++ b/nvim/.config/nvim/lua/plugins/prose.lua @@ -37,6 +37,21 @@ return { config = function() require("zk").setup({ picker = "telescope" }) end, + ft = writing_ft, + cmd = { + "ZkBacklinks", + "ZkCd", + "ZkIndex", + "ZkInsertLink", + "ZkInsertLinkAtSelection", + "ZkLinks", + "ZkMatch", + "ZkNew", + "ZkNewFromContentSelection", + "ZkNewFromTitleSelection", + "ZkNotes", + "ZkTags", + }, }, -- simple static markdown linking and link following using zettel IDs { "marty-oehme/zettelkasten.nvim", ft = writing_ft, event = "VeryLazy" },