Nvim: More QoL improvements
This commit is contained in:
20
nvim/lua/helpers.lua
Normal file
20
nvim/lua/helpers.lua
Normal file
@ -0,0 +1,20 @@
|
||||
local helpers = {}
|
||||
|
||||
function helpers.diagnostic_on_cursor_hold(bufnr)
|
||||
vim.api.nvim_create_autocmd("CursorHold", {
|
||||
buffer = bufnr,
|
||||
callback = function()
|
||||
local opts = {
|
||||
focusable = false,
|
||||
close_events = { "BufLeave", "CursorMoved", "InsertEnter", "FocusLost" },
|
||||
border = 'rounded',
|
||||
source = 'always',
|
||||
prefix = ' ',
|
||||
scope = 'cursor',
|
||||
}
|
||||
vim.diagnostic.open_float(nil, opts)
|
||||
end
|
||||
})
|
||||
end
|
||||
|
||||
return helpers
|
Reference in New Issue
Block a user