From: C.D. MacEachern Date: Wed, 30 Nov 2022 14:11:15 +0000 (-0500) Subject: Add g:loaded_lsp variable for easy detection X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=171680d38adf98c7772a2731f10ebe3ea99be699;p=vim-lsp.git 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 ``` --- 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)