diff options
| author | LMBishop <13875753+LMBishop@users.noreply.github.com> | 2023-07-15 17:03:48 +0100 |
|---|---|---|
| committer | LMBishop <13875753+LMBishop@users.noreply.github.com> | 2023-07-15 17:03:48 +0100 |
| commit | 7cc46f0771352a1ac486df9bdeb5826712d11d33 (patch) | |
| tree | 4e9404d963cfce22c92cf59008451a9470342324 /vim/nvim/lua/config/diagnostic.lua | |
| parent | ae41ec1cb0a20fb8d344b7f385f5e5f5634545cf (diff) | |
Add new colour scheme
Diffstat (limited to 'vim/nvim/lua/config/diagnostic.lua')
| -rw-r--r-- | vim/nvim/lua/config/diagnostic.lua | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/vim/nvim/lua/config/diagnostic.lua b/vim/nvim/lua/config/diagnostic.lua new file mode 100644 index 0000000..afa9c87 --- /dev/null +++ b/vim/nvim/lua/config/diagnostic.lua @@ -0,0 +1,29 @@ +vim.diagnostic.config({ + underline = true, + signs = true, + virtual_text = false, + float = { + show_header = true, + source = 'if_many', + focusable = false, + transparent = true, + }, + update_in_insert = true, -- default to false + severity_sort = false, -- default to false +}) + +vim.api.nvim_exec([[ autocmd InsertEnter * :lua vim.diagnostic.config({virtual_text = true}) ]], false) +vim.api.nvim_exec([[ autocmd InsertLeave * :lua vim.diagnostic.config({virtual_text = false}) ]], false) +vim.api.nvim_exec([[ autocmd CursorMoved * :lua vim.diagnostic.open_float({ silent=true }) ]], false) + +vim.lsp.handlers['textDocument/publishDiagnostics'] = vim.lsp.with( + vim.lsp.diagnostic.on_publish_diagnostics, { + update_in_insert = true, + } +) + +local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " } +for type, icon in pairs(signs) do + local hl = "DiagnosticSign" .. type + vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" }) +end |
