I apologise if this seems very basic but I wasn't able to find a satisfactory answer. In my vimrc I want to check if the lightline status bar is loaded and set options accordingly.
call plug#begin('~/.vim/plugged')
Plug 'itchyny/lightline.vim'
call plug#end()
...
...
if exists('g:loaded_lightline') && g:loaded_lightline
echom "loaded"
set noshowmode
else
echom "not loaded"
set showmode
call MinimalStatusLine()
endif
I get not loaded when I open up vim. What am I doing wrong ?
On a related note, I have a function called MinimalStatusLine() containing a bunch of set statusline+=... commands that I want to invoke as a backup when I don't have lightline installed. I currently have it in a separate .vim file inside ~/.vim/plugin directory (that vim automatically sources). But vim gives me an E117: Unknown function error.
~/.vim/after/plugin/files which are late enough that checks can work. – D. Ben Knoble Nov 30 '20 at 14:55