From fcfc54871715cfba1ec1c6d0632cf5f290760874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Mon, 17 Jun 2024 10:02:10 +0200 Subject: [PATCH] feat: improve nvim experience --- flake.nix | 4 ++-- .../programs/nvim/plugins/lua/null-ls-nvim.lua | 4 ++-- modules/programs/nvim/plugins/lua/nvim-cmp.lua | 18 ++++++++++-------- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/flake.nix b/flake.nix index f5fa4f3..16bb6a4 100644 --- a/flake.nix +++ b/flake.nix @@ -37,8 +37,6 @@ smartcolumn-nvim.url = "github:m4xshen/smartcolumn.nvim"; telekasten-nvim.flake = false; telekasten-nvim.url = "github:renerocksai/telekasten.nvim"; - none-ls-nvim.flake = false; - none-ls-nvim.url = "github:nvimtools/none-ls.nvim"; neotest-python.flake = false; neotest-python.url = "github:MoritzBoehme/neotest-python/fix-runtimepath-search"; statuscol-nvim.flake = false; @@ -47,6 +45,8 @@ gen-nvim.url = "github:David-Kunz/gen.nvim"; hawtkeys-nvim.flake = false; hawtkeys-nvim.url = "github:tris203/hawtkeys.nvim"; + none-ls-shellcheck-nvim.flake = false; + none-ls-shellcheck-nvim.url = "github:gbprod/none-ls-shellcheck.nvim"; # river river.url = "git+https://github.com/riverwm/river?submodules=1"; diff --git a/modules/programs/nvim/plugins/lua/null-ls-nvim.lua b/modules/programs/nvim/plugins/lua/null-ls-nvim.lua index fe88108..b5717c0 100644 --- a/modules/programs/nvim/plugins/lua/null-ls-nvim.lua +++ b/modules/programs/nvim/plugins/lua/null-ls-nvim.lua @@ -3,14 +3,14 @@ local null_ls = require("null-ls") null_ls.setup({ sources = { -- Code actions - null_ls.builtins.code_actions.shellcheck, + require("none-ls-shellcheck.code_actions"), null_ls.builtins.code_actions.statix, -- Diagnostics null_ls.builtins.diagnostics.checkmake, null_ls.builtins.diagnostics.deadnix, null_ls.builtins.diagnostics.dotenv_linter, null_ls.builtins.diagnostics.fish, - null_ls.builtins.diagnostics.shellcheck, + require("none-ls-shellcheck.diagnostics"), null_ls.builtins.diagnostics.statix, null_ls.builtins.diagnostics.trail_space, null_ls.builtins.diagnostics.yamllint, diff --git a/modules/programs/nvim/plugins/lua/nvim-cmp.lua b/modules/programs/nvim/plugins/lua/nvim-cmp.lua index 04b3daa..4da693c 100644 --- a/modules/programs/nvim/plugins/lua/nvim-cmp.lua +++ b/modules/programs/nvim/plugins/lua/nvim-cmp.lua @@ -8,6 +8,9 @@ cmp.setup({ mode = "symbol", -- show only symbol annotations maxwidth = 50, -- prevent the popup from showing more than provided characters ellipsis_char = "...", -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead + symbol_map = { + Copilot = "", + }, }), }, enabled = function() @@ -59,14 +62,13 @@ cmp.setup({ end, { "i", "s" }), }), sources = cmp.config.sources({ - { name = "async_path", priority = 1 }, - { name = "nvim_lsp", priority = 2 }, - { name = "nvim_lsp_signature_help", priority = 3 }, - { name = "luasnip", priority = 4 }, - }, { - { name = "async_path" }, - { name = "buffer" }, - { name = "spell" }, + { priority = 1, name = "async_path" }, + { priority = 1, name = "buffer" }, + { priority = 1, name = "spell" }, + { priority = 2, name = "nvim_lsp" }, + { priority = 3, name = "copilot" }, + { priority = 3, name = "nvim_lsp_signature_help" }, + { priority = 4, name = "luasnip" }, }), })