Skip to content

Commit 9b04cc3

Browse files
author
Francis
committed
Python LSP! :)
1 parent 4233882 commit 9b04cc3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

init.lua

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,16 @@ require('lazy').setup({
634634
end
635635
end
636636

637+
-- Show diagnostics in floating window on cursor hold
638+
local diagnostic_augroup = vim.api.nvim_create_augroup('kickstart-lsp-diagnostics', { clear = false })
639+
vim.api.nvim_create_autocmd('CursorHold', {
640+
buffer = event.buf,
641+
group = diagnostic_augroup,
642+
callback = function()
643+
vim.diagnostic.open_float(nil, { focus = false, scope = 'cursor' })
644+
end,
645+
})
646+
637647
-- The following two autocommands are used to highlight references of the
638648
-- word under your cursor when your cursor rests there for a little while.
639649
-- See `:help CursorHold` for information about when this is executed
@@ -659,6 +669,7 @@ require('lazy').setup({
659669
callback = function(event2)
660670
vim.lsp.buf.clear_references()
661671
vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight', buffer = event2.buf }
672+
vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-diagnostics', buffer = event2.buf }
662673
end,
663674
})
664675
end

0 commit comments

Comments
 (0)