From 171680d38adf98c7772a2731f10ebe3ea99be699 Mon Sep 17 00:00:00 2001 From: "C.D. MacEachern" Date: Wed, 30 Nov 2022 09:11:15 -0500 Subject: [PATCH] Add g:loaded_lsp variable for easy detection Useful to detect if the plugin was loaded before doing things in, for example, `.vim/after/plugin/lsp.vim` by doing: ``` if !get(g:, 'loaded_lsp') | finish | endif ``` --- plugin/lsp.vim | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugin/lsp.vim b/plugin/lsp.vim index ddf43b2..28cdccb 100644 --- a/plugin/lsp.vim +++ b/plugin/lsp.vim @@ -7,9 +7,15 @@ vim9script # Language Server Protocol (LSP) plugin for vim +if exists('g:loaded_lsp') + finish +endif +g:loaded_lsp = 1 + import autoload '../autoload/lsp/options.vim' import autoload '../autoload/lsp/lsp.vim' + # Set LSP plugin options from 'opts'. def g:LspOptionsSet(opts: dict) options.OptionsSet(opts) -- 2.48.1