From 0accf738ed5c1209f1bb9f18e61ea8d4403d6b42 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Fri, 8 Mar 2024 10:57:53 -0800 Subject: [PATCH] [vim] Add a DiagnosticFloat autocommand that shows the diagnostic window on CursorHold Set the hold time to 300 ms. --- config/nvim/lua/autocommands.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 config/nvim/lua/autocommands.lua diff --git a/config/nvim/lua/autocommands.lua b/config/nvim/lua/autocommands.lua new file mode 100644 index 0000000..d92e1c1 --- /dev/null +++ b/config/nvim/lua/autocommands.lua @@ -0,0 +1,15 @@ +-- Eryn Wells + +vim.opt.updatetime = 300 + +-- Show diagnostic popup on cursor hover +local diagnostic_float_group = vim.api.nvim_create_augroup("DiagnosticFloat", { clear = true }) +vim.api.nvim_create_autocmd("CursorHold", { + callback = function() + vim.diagnostic.open_float { + border = "double", + focusable = false, + } + end, + group = diagnostic_float_group, +})