From 508e84bde61d27e91c909bb848cd96dd894a46eb Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Thu, 2 Jan 2025 22:42:23 +0100 Subject: [PATCH 1/5] chore(overlay): apply change in nur package overlay method --- nixos/includes/system/overlay.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/includes/system/overlay.nix b/nixos/includes/system/overlay.nix index 24dae79..d4c3daa 100644 --- a/nixos/includes/system/overlay.nix +++ b/nixos/includes/system/overlay.nix @@ -6,6 +6,6 @@ enableWideVine = if pkgs.system == "x86_64-linux" then true else false; }; }) - inputs.nur.overlay + inputs.nur.overlays.default ]; } From f1b295db43e5daccc9f12c8d211490f46761315d Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Fri, 3 Jan 2025 00:15:36 +0100 Subject: [PATCH 2/5] chore(neovim): rework lua lsp configuration --- .../home-manager/cli/neovim/files/lspconfig.lua | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/modules/home-manager/cli/neovim/files/lspconfig.lua b/modules/home-manager/cli/neovim/files/lspconfig.lua index a7df681..a672376 100644 --- a/modules/home-manager/cli/neovim/files/lspconfig.lua +++ b/modules/home-manager/cli/neovim/files/lspconfig.lua @@ -77,6 +77,21 @@ vim.api.nvim_create_autocmd("FileType", { lspconfig.lua_ls.setup { capabilities = capabilities, single_file_support = true, + settings = { + Lua = { + diagnostics = { + globals = {'vim'} -- Add any globals you want to ignore as undefined + }, + workspace = { + library = { + [vim.fn.expand('$VIMRUNTIME/lua')] = true + } + }, + telemetry = { + enable = false -- Disable telemetry + } + } + }, flags = { debounce_text_changes = 150, } @@ -192,7 +207,7 @@ vim.api.nvim_create_autocmd('LspAttach', { -- Jumps to the definition of the type symbol bufmap('n', 'go', 'lua vim.lsp.buf.type_definition()') - -- Lists all the references + -- Lists all the references bufmap('n', 'gr', 'lua vim.lsp.buf.references()') -- Displays a function's signature information From a1c7776c7b3574462771bf6c73f98304400b143f Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Fri, 3 Jan 2025 00:58:23 +0100 Subject: [PATCH 3/5] chore(neovim): rework indentation --- .../home-manager/cli/neovim/files/options.lua | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/modules/home-manager/cli/neovim/files/options.lua b/modules/home-manager/cli/neovim/files/options.lua index 755cd91..2dd3332 100644 --- a/modules/home-manager/cli/neovim/files/options.lua +++ b/modules/home-manager/cli/neovim/files/options.lua @@ -30,17 +30,24 @@ vim.opt.signcolumn = "yes" -- alway show sign column vim.opt.number = true vim.opt.relativenumber = true vim.opt.cursorline = true -- highlight current line -vim.opt.shiftwidth = 4 vim.opt.showmatch = true vim.opt.smartcase = true -- search: try :to be smart about cases vim.opt.smartindent = true -vim.opt.tabstop = 4 +vim.opt.tabstop = 2 +vim.opt.shiftwidth = 2 +vim.opt.softtabstop = 2 vim.opt.wildmenu = true -- activate enhanced user menu vim.opt.wildmode = 'lastused:full,list' -- enhance menu vim.opt.pumheight = 10 vim.opt.pumwidth = 50 vim.opt.pumblend = 10 +-- manage line break smartly +vim.opt.wrap = true +vim.opt.breakindent = true +vim.opt.linebreak = true +vim.opt.showbreak = string.rep(" ", 3) -- Make it so that long lines wrap smartly + -- need to activate this for cmp vim.opt.completeopt = {'menu', 'menuone', 'noselect'} -- -- Code Fold @@ -48,16 +55,6 @@ vim.opt.completeopt = {'menu', 'menuone', 'noselect'} vim.cmd('au BufWinLeave *.* mkview') vim.cmd('au BufWinEnter *.* silent! loadview') - --- Diagnostic settings --- --- diagnostic windows must be float -vim.diagnostic.config { - virtual_text = false, - signs = true, - underline = true, -} - local signs = { Error = "", Warn = "", Hint = "󰌶", Info = "" } for type, icon in pairs(signs) do local hl = "DiagnosticSign" .. type @@ -70,8 +67,6 @@ vim.o.updatetime = 250 vim.cmd [[autocmd! CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {scope='cursor', header = "", prefix = "", focus=false})]] -- Autotype -vim.cmd('au BufRead,BufNewFile *.md setlocal textwidth=80') -vim.cmd('au BufRead,BufNewFile *.tex setlocal textwidth=80') vim.cmd('au BufRead,BufNewFile *.nix setlocal tabstop=2 shiftwidth=2 ') vim.cmd('au BufNewFile,BufRead /tmp/neomutt* set tw=72 fo=awq comments+=nb:> noautoindent filetype=mail') From 57df48733fae937a99097f6a6fd9b247ce771f31 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Fri, 3 Jan 2025 01:52:16 +0100 Subject: [PATCH 4/5] chore(neovim): add shell formatter --- modules/home-manager/cli/neovim/files/conform.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/home-manager/cli/neovim/files/conform.lua b/modules/home-manager/cli/neovim/files/conform.lua index ff3d6d8..54ec4f6 100644 --- a/modules/home-manager/cli/neovim/files/conform.lua +++ b/modules/home-manager/cli/neovim/files/conform.lua @@ -6,6 +6,7 @@ require("conform").setup({ }, formatters_by_ft = { yaml = {"yamlfmt"}, + sh = { "shfmt" }, ["_"] = { "trim_whitespace" }, } }) From fa2267c1a6ec75818d63db772da2cb44785e65d0 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Fri, 3 Jan 2025 01:53:13 +0100 Subject: [PATCH 5/5] chore(neovim): disable diagnostic virtual text --- modules/home-manager/cli/neovim/files/lsp-line.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/home-manager/cli/neovim/files/lsp-line.lua b/modules/home-manager/cli/neovim/files/lsp-line.lua index d10b0bc..78aa9ad 100644 --- a/modules/home-manager/cli/neovim/files/lsp-line.lua +++ b/modules/home-manager/cli/neovim/files/lsp-line.lua @@ -1,2 +1,7 @@ require('lsp_lines').setup() vim.diagnostic.config({ virtual_lines = true }) + +-- Disable virtual_text since it's redundant due to lsp_lines. +vim.diagnostic.config({ + virtual_text = false, +})