From ca3b35afc020e01809efe9ae0da4763c47e2deb6 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Fri, 25 Apr 2025 16:54:33 +0200 Subject: [PATCH 1/3] chore(honme-manager): rework neovim cmp plugin configuration --- modules/home-manager/cli/neovim/default.nix | 14 -------- .../home-manager/cli/neovim/files/options.lua | 17 ++++----- .../cli/neovim/files/plugins/blink-cmp.lua | 36 ++++++++++++++++++- 3 files changed, 44 insertions(+), 23 deletions(-) diff --git a/modules/home-manager/cli/neovim/default.nix b/modules/home-manager/cli/neovim/default.nix index 507e21f..1932b2e 100644 --- a/modules/home-manager/cli/neovim/default.nix +++ b/modules/home-manager/cli/neovim/default.nix @@ -177,20 +177,6 @@ in config = ( builtins.readFile ./files/plugins/treesitter_context.lua); } - { - plugin = lspsaga-nvim; - type = "lua"; - config = '' - require('lspsaga').setup { - ui = { - code_action = '' - }, - lightbulb = { - virtual_text = false - } - } - ''; - } { plugin = which-key-nvim; type = "lua"; diff --git a/modules/home-manager/cli/neovim/files/options.lua b/modules/home-manager/cli/neovim/files/options.lua index bee83db..b683e0a 100644 --- a/modules/home-manager/cli/neovim/files/options.lua +++ b/modules/home-manager/cli/neovim/files/options.lua @@ -66,16 +66,16 @@ vim.opt.completeopt = {'menu', 'menuone', 'noselect'} vim.cmd('au BufWinLeave *.* mkview') vim.cmd('au BufWinEnter *.* silent! loadview') -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 = hl }) -end +-- 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 = hl }) +-- end -- You will likely want to reduce updatetime which affects CursorHold -- note: this setting is global and should be set only once vim.o.updatetime = 250 -vim.cmd [[autocmd! CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {scope='cursor', header = "", prefix = "", focus=false})]] +-- vim.cmd [[autocmd! CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {scope='cursor', header = "", prefix = "", focus=false})]] -- Autotype vim.cmd('au BufRead,BufNewFile *.nix setlocal tabstop=2 shiftwidth=2 ') @@ -124,12 +124,13 @@ vim.g.matchparen_insert_timeout = 2 -- activate virtual lines for diagnistics -- no more plugins needed +local x = vim.diagnostic.severity vim.diagnostic.config({ - virtual_lines = true - + virtual_lines = true, -- Alternatively, customize specific options -- virtual_lines = { -- -- Only show virtual line diagnostics for the current cursor line -- current_line = true, -- }, + signs = { text = { [x.ERROR] = "󰅙", [x.WARN] = "", [x.INFO] = "󰋼", [x.HINT] = "󰌵" } }, }) diff --git a/modules/home-manager/cli/neovim/files/plugins/blink-cmp.lua b/modules/home-manager/cli/neovim/files/plugins/blink-cmp.lua index 1d42f63..f5aad60 100644 --- a/modules/home-manager/cli/neovim/files/plugins/blink-cmp.lua +++ b/modules/home-manager/cli/neovim/files/plugins/blink-cmp.lua @@ -1,8 +1,14 @@ require("blink.cmp").setup({ keymap = { - preset = "cmdline", + preset = "none", [''] = { 'scroll_documentation_up', 'fallback' }, [''] = { 'scroll_documentation_down', 'fallback' }, + [''] = { 'select_next', 'fallback' }, + [''] = { 'select_prev', 'fallback' }, + [''] = { 'show', 'fallback' }, + [''] = { 'select_and_accept' }, + [''] = { 'cancel' }, + }, completion = { menu = { @@ -38,6 +44,16 @@ require("blink.cmp").setup({ "dictionary", }, providers = { + path = { + module = 'blink.cmp.sources.path', + score_offset = 3, + opts = { + trailing_slash = false, + label_trailing_slash = false, + get_cwd = function(context) return vim.fn.expand(('#%d:p:h'):format(context.bufnr)) end, + show_hidden_files_by_default = true, + } + }, emoji = { module = "blink-emoji", name = "Emoji", @@ -61,8 +77,26 @@ require("blink.cmp").setup({ end, }, }, + buffer = { + module = 'blink.cmp.sources.buffer', + score_offset = -3, + min_keyword_length = 4, + opts = { + -- default to all visible buffers + get_bufnrs = function() + return vim + .iter(vim.api.nvim_list_wins()) + :map(function(win) return vim.api.nvim_win_get_buf(win) end) + :filter(function(buf) return vim.bo[buf].buftype ~= 'nofile' end) + :totable() + end, + } + }, }, }, + fuzzy = { + max_typos = function() return 0 end, + }, cmdline = { enabled = false, }, From d161cef25058695d65ac80e319aa4c54a77a7bc3 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Fri, 25 Apr 2025 16:55:22 +0200 Subject: [PATCH 2/3] chore(home-manager): rework starship pompt configuration regarding mode --- modules/home-manager/cli/starship/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/home-manager/cli/starship/default.nix b/modules/home-manager/cli/starship/default.nix index e04bc4c..65db136 100644 --- a/modules/home-manager/cli/starship/default.nix +++ b/modules/home-manager/cli/starship/default.nix @@ -22,9 +22,9 @@ in format = "[$read_only]($read_only_style)[$path]($style) "; }; character = { - success_symbol = "[](purple)"; + success_symbol = "[](green)"; error_symbol = "[](red)"; - vimcmd_symbol = "[](green)"; + vimcmd_symbol = "[](blue)"; }; git_branch = { format = "[$branch]($style)"; From d77c22221c825d99275e94cda2d7372def59813e Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Fri, 25 Apr 2025 16:56:59 +0200 Subject: [PATCH 3/3] fix(host): error in gpg key for work --- hosts/work/home-config.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hosts/work/home-config.nix b/hosts/work/home-config.nix index e1b4578..4ba15cc 100644 --- a/hosts/work/home-config.nix +++ b/hosts/work/home-config.nix @@ -14,9 +14,8 @@ git = { enable = true; userEmail = "ybarbanneau@sellsy.com"; - signingKey ="6E1A834E282FBD98B48069444447A19BBEDB8DBA"; + signingKey = "6E1A834E282FBD98B48069444447A19BBEDB8DBA"; signByDefault = true; - signingKey="6E1A834E282FBD98B48069444447A19BBEDB8DBA"; }; neovim.enable = true; starship.enable = true;