From b6bc36f3b11ab46e7dd23a507a488dd21c028ad8 Mon Sep 17 00:00:00 2001 From: tvercruyssen Date: Sat, 2 Sep 2023 12:08:32 +0200 Subject: [PATCH 1/2] Move from after/plugin to plugin and follow plugin best pratices --- after/plugin/cmp_nvim_lsp.lua | 1 - plugin/cmp_nvim_lsp.lua | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) delete mode 100644 after/plugin/cmp_nvim_lsp.lua create mode 100644 plugin/cmp_nvim_lsp.lua diff --git a/after/plugin/cmp_nvim_lsp.lua b/after/plugin/cmp_nvim_lsp.lua deleted file mode 100644 index 6d566fa..0000000 --- a/after/plugin/cmp_nvim_lsp.lua +++ /dev/null @@ -1 +0,0 @@ -require('cmp_nvim_lsp').setup() diff --git a/plugin/cmp_nvim_lsp.lua b/plugin/cmp_nvim_lsp.lua new file mode 100644 index 0000000..ca073fb --- /dev/null +++ b/plugin/cmp_nvim_lsp.lua @@ -0,0 +1,6 @@ +if vim.g.loaded_cmp_nvim_lsp then + return +end +vim.g.loaded_cmp_nvim_lsp = true + +require("cmp_nvim_lsp").setup() From 6928490c683a08282f6a45417a44d3451be1965d Mon Sep 17 00:00:00 2001 From: tvercruyssen Date: Fri, 28 Jun 2024 21:26:07 +0200 Subject: [PATCH 2/2] Use `package.loaded` global --- plugin/cmp_nvim_lsp.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugin/cmp_nvim_lsp.lua b/plugin/cmp_nvim_lsp.lua index ca073fb..20dbada 100644 --- a/plugin/cmp_nvim_lsp.lua +++ b/plugin/cmp_nvim_lsp.lua @@ -1,6 +1,5 @@ -if vim.g.loaded_cmp_nvim_lsp then +if package.loaded["cmp_nvim_lsp"] then return end -vim.g.loaded_cmp_nvim_lsp = true require("cmp_nvim_lsp").setup()