diff options
author | Thomas Voss <mail@thomasvoss.com> | 2023-11-13 10:28:55 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2023-11-13 10:28:55 +0100 |
commit | dc622188a3559597ea62588ca789d4fdd9775c16 (patch) | |
tree | 5592d00d3514476e727e4585c9f6a1018bfea19f /.config/nvim | |
parent | fc917b61a828ab1020ede00b4d1d62920fa5e3aa (diff) |
nvim: Finally make auto-reverts actually work
Diffstat (limited to '.config/nvim')
-rw-r--r-- | .config/nvim/lua/mango/set.lua | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/.config/nvim/lua/mango/set.lua b/.config/nvim/lua/mango/set.lua index e7a7d21..906dc26 100644 --- a/.config/nvim/lua/mango/set.lua +++ b/.config/nvim/lua/mango/set.lua @@ -51,11 +51,16 @@ api.nvim_create_autocmd('BufEnter', { }) -- Make buffer auto-reverting work… somehow -g.autoread = true -api.nvim_create_autocmd('CursorHold', { - command = 'checktime | call feedkeys("lh")', - group = augroup, -}) +vim.cmd([[ + if !exists('g:CheckUpdateStarted') + let g:CheckUpdateStarted = 1 + call timer_start(1000, 'CheckUpdate', {'repeat': -1}) + endif + + function! CheckUpdate(_) + silent! checktime + endfunction +]]) -- This has to be done to enable linenumbers in netrw g.netrw_bufsettings = 'noma nomod nu nobl nowrap ro' |