From 02a1c77cad04e16005b8ab2ce18617b0ffa278b7 Mon Sep 17 00:00:00 2001 From: Nanderty Date: Fri, 24 Mar 2023 10:30:18 +0100 Subject: diagnostics and linting --- lazy-lock.json | 1 + lua/options.lua | 10 +--------- lua/plugins/general.lua | 16 ++++++++++++++++ lua/plugins/interface.lua | 1 - lua/plugins/lsp.lua | 19 +++++++++++++++++++ tags | 5 +++++ 6 files changed, 42 insertions(+), 10 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index 578a5a6..244b65d 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -18,6 +18,7 @@ "mini.nvim": { "branch": "main", "commit": "9f8b92998a9964e03535c2c7e0708958e23e261a" }, "neovim": { "branch": "main", "commit": "44ba4bd558c37189637b9ec39f2c42839fd3837d" }, "nvim-cmp": { "branch": "main", "commit": "777450fd0ae289463a14481673e26246b5e38bf2" }, + "nvim-lint": { "branch": "master", "commit": "b16e6e424ddfb12d4b3a699c1dc41ba0f3b503da" }, "nvim-lspconfig": { "branch": "master", "commit": "c6105c449683b944b5d2138fcf82f18c657249e9" }, "nvim-treesitter": { "branch": "master", "commit": "87cf2abeb6077ac19a1249d0b06f223aa398a0a0" }, "nvim-web-devicons": { "branch": "master", "commit": "95b1e300699be8eb6b5be1758a9d4d69fe93cc7f" }, diff --git a/lua/options.lua b/lua/options.lua index 720bf2f..8c009e2 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -1,7 +1,7 @@ vim.opt.spelllang = {'de_de', 'en_us'} vim.opt.timeoutlen = 500 -vim.opt.updatetime = 200 +vim.opt.updatetime = 250 vim.opt.mouse = a vim.opt.signcolumn = 'yes' vim.opt.cursorline = true @@ -22,13 +22,5 @@ vim.opt.softtabstop = 4 vim.opt.number = true vim.opt.scrolloff = 20 vim.opt.numberwidth = 5 -vim.diagnostic.config({ - virtual_text = { - severity = vim.diagnostic.severity.ERROR, - }, - underline = { - severity = vim.diagnostic.severity.ERROR, - }, -}) vim.opt.termguicolors = true vim.opt.guifont = {'Hack NFM:h12'} diff --git a/lua/plugins/general.lua b/lua/plugins/general.lua index f86270d..ddcacea 100644 --- a/lua/plugins/general.lua +++ b/lua/plugins/general.lua @@ -1,4 +1,20 @@ return { + { + 'mfussenegger/nvim-lint', + event = { + 'BufWritePre' + }, + config = function() + require('lint').linters_by_ft = { + tex = { 'lacheck', } + } + vim.api.nvim_create_autocmd({ "BufWritePost" }, { + callback = function() + require("lint").try_lint() + end, + }) + end, + }, { 'tpope/vim-fugitive', event = { diff --git a/lua/plugins/interface.lua b/lua/plugins/interface.lua index 7e06d03..ede5cf8 100644 --- a/lua/plugins/interface.lua +++ b/lua/plugins/interface.lua @@ -41,7 +41,6 @@ return { }, opts = { show_current_context = true, - show_current_context_start = true, }, }, { diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 68da19a..6ad37c3 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -33,6 +33,25 @@ return { local hl = "DiagnosticSign" .. type vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) end + vim.diagnostic.config({ + update_in_insert = true, + virtual_text = false, + }) + vim.api.nvim_create_autocmd("CursorHold", { + buffer = bufnr, + callback = function() + local opts = { + header = '', + source = 'always', + border = {{' '},{' '},{' '},{' '}}, + focusable = false, + close_events = { "BufLeave", "CursorMoved", "InsertEnter", }, + prefix = ' ', + scope = 'cursor', + } + vim.diagnostic.open_float(nil, opts) + end + }) end, }, } diff --git a/tags b/tags index ea2ae2e..fb222ec 100644 --- a/tags +++ b/tags @@ -62,6 +62,7 @@ branch ./lazy-lock.json /^ "mason.nvim": { "branch": "main", "commit": "9f4e060 branch ./lazy-lock.json /^ "mini.nvim": { "branch": "main", "commit": "9f8b92998a9964e03535c2c7e0708958e23e261a" },$/;" s object:mini.nvim branch ./lazy-lock.json /^ "neovim": { "branch": "main", "commit": "44ba4bd558c37189637b9ec39f2c42839fd3837d" },$/;" s object:neovim branch ./lazy-lock.json /^ "nvim-cmp": { "branch": "main", "commit": "777450fd0ae289463a14481673e26246b5e38bf2" },$/;" s object:nvim-cmp +branch ./lazy-lock.json /^ "nvim-lint": { "branch": "master", "commit": "b16e6e424ddfb12d4b3a699c1dc41ba0f3b503da" },$/;" s object:nvim-lint branch ./lazy-lock.json /^ "nvim-lspconfig": { "branch": "master", "commit": "c6105c449683b944b5d2138fcf82f18c657249e9" }/;" s object:nvim-lspconfig branch ./lazy-lock.json /^ "nvim-treesitter": { "branch": "master", "commit": "87cf2abeb6077ac19a1249d0b06f223aa398a0a0" /;" s object:nvim-treesitter branch ./lazy-lock.json /^ "nvim-web-devicons": { "branch": "master", "commit": "95b1e300699be8eb6b5be1758a9d4d69fe93cc7f/;" s object:nvim-web-devicons @@ -73,6 +74,8 @@ branch ./lazy-lock.json /^ "vim-fugitive": { "branch": "master", "commit": "309 branch ./lazy-lock.json /^ "vim-gutentags": { "branch": "master", "commit": "1337b1891b9d98d6f4881982f27aa22b02c80084" },$/;" s object:vim-gutentags branch ./lazy-lock.json /^ "vimtex": { "branch": "master", "commit": "5a6e46e2b8a96e79d5cab98e50a9b9109715d940" }$/;" s object:vimtex bufferline.nvim ./lazy-lock.json /^ "bufferline.nvim": { "branch": "main", "commit": "3677aceb9a72630b0613e56516c8f7151b86f95c" },$/;" o +callback ./lua/plugins/general.lua /^ callback = function()$/;" f +callback ./lua/plugins/lsp.lua /^ callback = function()$/;" f cmp-buffer ./lazy-lock.json /^ "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },$/;" o cmp-calc ./lazy-lock.json /^ "cmp-calc": { "branch": "main", "commit": "50792f34a628ea6eb31d2c90e8df174671e4e7a0" },$/;" o cmp-nvim-lsp ./lazy-lock.json /^ "cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" },$/;" o @@ -97,6 +100,7 @@ commit ./lazy-lock.json /^ "mason.nvim": { "branch": "main", "commit": "9f4e060 commit ./lazy-lock.json /^ "mini.nvim": { "branch": "main", "commit": "9f8b92998a9964e03535c2c7e0708958e23e261a" },$/;" s object:mini.nvim commit ./lazy-lock.json /^ "neovim": { "branch": "main", "commit": "44ba4bd558c37189637b9ec39f2c42839fd3837d" },$/;" s object:neovim commit ./lazy-lock.json /^ "nvim-cmp": { "branch": "main", "commit": "777450fd0ae289463a14481673e26246b5e38bf2" },$/;" s object:nvim-cmp +commit ./lazy-lock.json /^ "nvim-lint": { "branch": "master", "commit": "b16e6e424ddfb12d4b3a699c1dc41ba0f3b503da" },$/;" s object:nvim-lint commit ./lazy-lock.json /^ "nvim-lspconfig": { "branch": "master", "commit": "c6105c449683b944b5d2138fcf82f18c657249e9" }/;" s object:nvim-lspconfig commit ./lazy-lock.json /^ "nvim-treesitter": { "branch": "master", "commit": "87cf2abeb6077ac19a1249d0b06f223aa398a0a0" /;" s object:nvim-treesitter commit ./lazy-lock.json /^ "nvim-web-devicons": { "branch": "master", "commit": "95b1e300699be8eb6b5be1758a9d4d69fe93cc7f/;" s object:nvim-web-devicons @@ -129,6 +133,7 @@ mason.nvim ./lazy-lock.json /^ "mason.nvim": { "branch": "main", "commit": "9f4 mini.nvim ./lazy-lock.json /^ "mini.nvim": { "branch": "main", "commit": "9f8b92998a9964e03535c2c7e0708958e23e261a" },$/;" o neovim ./lazy-lock.json /^ "neovim": { "branch": "main", "commit": "44ba4bd558c37189637b9ec39f2c42839fd3837d" },$/;" o nvim-cmp ./lazy-lock.json /^ "nvim-cmp": { "branch": "main", "commit": "777450fd0ae289463a14481673e26246b5e38bf2" },$/;" o +nvim-lint ./lazy-lock.json /^ "nvim-lint": { "branch": "master", "commit": "b16e6e424ddfb12d4b3a699c1dc41ba0f3b503da" },$/;" o nvim-lspconfig ./lazy-lock.json /^ "nvim-lspconfig": { "branch": "master", "commit": "c6105c449683b944b5d2138fcf82f18c657249e9" }/;" o nvim-treesitter ./lazy-lock.json /^ "nvim-treesitter": { "branch": "master", "commit": "87cf2abeb6077ac19a1249d0b06f223aa398a0a0" /;" o nvim-web-devicons ./lazy-lock.json /^ "nvim-web-devicons": { "branch": "master", "commit": "95b1e300699be8eb6b5be1758a9d4d69fe93cc7f/;" o -- cgit v1.2.3