From 514e3ebe0164963ab39895559c8f259d5e4037d3 Mon Sep 17 00:00:00 2001 From: Chris Weyl Date: Mon, 19 Dec 2022 12:54:58 -0600 Subject: [PATCH] Add a number of public utility functions Some trivial functions to access `s:loaded`, to allow sane introspection of plugin status, etc. --- plug.vim | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/plug.vim b/plug.vim index 652caa82..68a95fc9 100644 --- a/plug.vim +++ b/plug.vim @@ -2808,5 +2808,17 @@ if exists('g:plugs') call s:define_commands() endif +function! plug#plugin_info(name) abort + return get(s:loaded, a:name, {}) +endfunction + +function! plug#loaded() abort + return keys(filter(copy(s:loaded), { k, v -> v })) +endfunction + +function! plug#not_loaded() abort + return keys(filter(copy(s:loaded), { k, v -> !v })) +endfunction + let &cpo = s:cpo_save unlet s:cpo_save