1
0
Fork 0
mirror of https://github.com/jiriks74/presence.nvim synced 2024-12-29 03:12:04 +01:00
presence.nvim/autoload/presence.vim
Andrew Kwon a325d154fc Support peer-to-peer workspace state management
- Add sync logic to manage multi-client runtime state
- Debounce and set activity on TextChanged events
- Update timestamp to be workspace-specific
- Set activity on an open nvim instance upon a VimLeave event
2021-03-18 19:10:04 -07:00

11 lines
467 B
VimL

" Define autocommands to handle auto-update events
function presence#SetAutoCmds()
augroup presence_events
autocmd!
if exists("g:presence_auto_update") && g:presence_auto_update
autocmd BufRead * lua package.loaded.presence:update()
autocmd TextChanged * lua package.loaded.presence:update(nil, true)
autocmd VimLeavePre * lua package.loaded.presence:unregister_self()
endif
augroup END
endfunction