Nvim: More QoL improvements

This commit is contained in:
2023-01-26 02:07:56 +01:00
parent d933f8866a
commit 773a17a91a
3 changed files with 143 additions and 10 deletions

20
nvim/lua/helpers.lua Normal file
View 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