nvf time!
This commit is contained in:
parent
6abc7fe210
commit
39924faca1
57 changed files with 4076 additions and 217 deletions
13
modules/editors/nvf/lua/misc/autoread.lua
Normal file
13
modules/editors/nvf/lua/misc/autoread.lua
Normal file
|
@ -0,0 +1,13 @@
|
|||
-- If the cursor has been idle for some time, check if the current buffer
|
||||
-- has been modified externally. prompt the user to reload it if has.
|
||||
local bufnr = vim.api.nvim_get_current_buf()
|
||||
|
||||
-- luacheck: ignore
|
||||
vim.opt_local.autoread = true
|
||||
vim.api.nvim_create_autocmd('CursorHold', {
|
||||
group = vim.api.nvim_create_augroup('Autoread', { clear = true }),
|
||||
buffer = bufnr,
|
||||
callback = function()
|
||||
vim.cmd('silent! checktime')
|
||||
end,
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue