1
0
Fork 0
mirror of https://github.com/jiriks74/presence.nvim synced 2025-07-19 15:48:47 +02:00

Move autocmd to autoload and validate setup opts

This commit is contained in:
Andrew Kwon 2021-01-03 11:29:19 -08:00
parent a656ba5361
commit f3151560a7
3 changed files with 37 additions and 15 deletions

View file

@ -1,15 +1,7 @@
" Define autocommands to handle auto-update events
augroup presence_events
autocmd!
if g:presence_auto_update
autocmd BufRead * lua package.loaded.presence:update()
endif
augroup END
" Fallback to setting up the plugin automatically
if !exists("g:presence_has_setup")
lua << EOF
local Presence = require("presence"):setup()
Presence.log:debug("Custom setup not detected, plugin set up using defaults")
Presence.log:debug("Custom setup not detected, using defaults")
EOF
endif