From b9f486ba609ae7313283f75cf7161c974d67ce30 Mon Sep 17 00:00:00 2001 From: jakobst1n Date: Wed, 3 Apr 2024 22:32:11 +0200 Subject: Tweak --- Common/nvim/lua/basic.lua | 9 --------- Common/nvim/lua/lsp-conf.lua | 21 ++++----------------- 2 files changed, 4 insertions(+), 26 deletions(-) (limited to 'Common/nvim/lua') diff --git a/Common/nvim/lua/basic.lua b/Common/nvim/lua/basic.lua index 18128e1..0d8b3f9 100755 --- a/Common/nvim/lua/basic.lua +++ b/Common/nvim/lua/basic.lua @@ -14,9 +14,6 @@ vim.opt.autoread = true --vim.opt.mapleader = "," vim.g.mapleader = "," --- Fast saving -map('n', 'w', ':w!', silentnoremap) - -- Convenient sudo saving of file vim.api.nvim_create_user_command( 'W', 'w !sudo tee % > /dev/null', @@ -183,12 +180,6 @@ map('v', 'P', '"+P', noremap) map('n', 'p', '"+p', noremap) map('n', 'P', '"+P', noremap) --- Delete trailing whitespace on save ---vim.api.nvim_create_autocmd("BufWritePre", { --- pattern = { "*" }, --- command = [[%s/\s\+$//e]] ---}) - --[[ Misc --]] diff --git a/Common/nvim/lua/lsp-conf.lua b/Common/nvim/lua/lsp-conf.lua index 7709c83..b80706d 100644 --- a/Common/nvim/lua/lsp-conf.lua +++ b/Common/nvim/lua/lsp-conf.lua @@ -50,31 +50,18 @@ vim.diagnostic.config({ }, }) + vim.cmd([[ set signcolumn=yes -autocmd CursorHold * lua vim.diagnostic.open_float(nil, { focusable = false }) ]]) +-- autocmd CursorHold * lua vim.diagnostic.open_float(nil, { focusable = false }) +map("n", "d", ":lua vim.diagnostic.open_float(nil, {})", silentnoremap) + ---Set completeopt to have a better completion experience --- :help completeopt --- menuone: popup even when there's only one match --- noinsert: Do not insert text until a selection is made --- noselect: Do not select, force to select one from the menu --- shortness: avoid showing extra messages when using completion --- updatetime: set updatetime for CursorHold vim.opt.completeopt = {'menuone', 'noselect', 'noinsert'} vim.opt.shortmess = vim.opt.shortmess + { c = true} vim.api.nvim_set_option('updatetime', 300) --- Fixed column for diagnostics to appear --- Show autodiagnostic popup on cursor hover_range --- Goto previous / next diagnostic warning / error --- Show inlay_hints more frequently -vim.cmd([[ -set signcolumn=yes -autocmd CursorHold * lua vim.diagnostic.open_float(nil, { focusable = false }) -]]) - -- Completion Plugin Setup local cmp = require'cmp' -- cgit v1.2.3