diff --git a/flake.lock b/flake.lock index 091046e..5bf5b91 100644 --- a/flake.lock +++ b/flake.lock @@ -98,6 +98,22 @@ "type": "github" } }, + "cmp-async-path": { + "flake": false, + "locked": { + "lastModified": 1673896803, + "narHash": "sha256-dgAiVbdMiKjiKWk+dJf/Zz8T20+D4OalGH5dTzYi5aM=", + "owner": "FelipeLema", + "repo": "cmp-async-path", + "rev": "d8229a93d7b71f22c66ca35ac9e6c6cd850ec61d", + "type": "github" + }, + "original": { + "owner": "FelipeLema", + "repo": "cmp-async-path", + "type": "github" + } + }, "comment-box-nvim": { "flake": false, "locked": { @@ -669,6 +685,7 @@ "asus-touchpad-numpad-driver": "asus-touchpad-numpad-driver", "attic": "attic", "bufferline-nvim": "bufferline-nvim", + "cmp-async-path": "cmp-async-path", "comment-box-nvim": "comment-box-nvim", "copilot-lua": "copilot-lua", "flake-utils": "flake-utils", diff --git a/flake.nix b/flake.nix index a5ea24c..8275c77 100644 --- a/flake.nix +++ b/flake.nix @@ -39,6 +39,9 @@ bufferline-nvim.flake = false; bufferline-nvim.url = "github:akinsho/bufferline.nvim"; + cmp-async-path.url = "github:FelipeLema/cmp-async-path"; + cmp-async-path.flake = false; + comment-box-nvim.flake = false; comment-box-nvim.url = "github:LudoPinelli/comment-box.nvim"; diff --git a/modules/programs/fish.nix b/modules/programs/fish.nix index 1101cbf..549a363 100644 --- a/modules/programs/fish.nix +++ b/modules/programs/fish.nix @@ -27,9 +27,7 @@ in fish = { enable = true; shellAbbrs = shellConfig.abbreviations; - shellAliases = shellConfig.aliases; - shellInit = '' # Vi Mode fish_vi_key_bindings diff --git a/modules/programs/nvim/default.nix b/modules/programs/nvim/default.nix index 4d566e9..101343f 100644 --- a/modules/programs/nvim/default.nix +++ b/modules/programs/nvim/default.nix @@ -66,6 +66,7 @@ in yamlfmt ]; plugins = with pkgs.vimPlugins; [ + cmp-async-path cmp-nvim-lsp cmp_luasnip copilot-cmp diff --git a/modules/programs/nvim/init.lua b/modules/programs/nvim/init.lua index bd08d4c..d7bc4e7 100644 --- a/modules/programs/nvim/init.lua +++ b/modules/programs/nvim/init.lua @@ -21,6 +21,13 @@ vim.api.nvim_create_autocmd("InsertEnter", { require("luasnip.loaders.from_vscode").lazy_load() require("copilot_cmp").setup() + local default_sources = { + { name = "async_path", priority = 4 }, + { name = "copilot", priority = 3 }, + { name = "luasnip", priority = 2 }, + { name = "nvim_lsp", priority = 4 }, + } + cmp.setup({ formatting = { format = require("lspkind").cmp_format({ @@ -63,13 +70,14 @@ vim.api.nvim_create_autocmd("InsertEnter", { end end, { "i", "s" }), }), - sources = { - { name = "buffer", priority = 1 }, - { name = "copilot", priority = 8 }, - { name = "luasnip", priority = 7 }, - { name = "nvim_lsp", priority = 9 }, - { name = "orgmode", priority = 9 }, - }, + sources = default_sources, + }) + + cmp.setup.filetype("org", { + sources = vim.tbl_deep_extend("force", default_sources, { + { name = "buffer", priority = 5 }, + { name = "orgmode", priority = 5 }, + }), }) end, }) diff --git a/overlays/vimPlugins.nix b/overlays/vimPlugins.nix index 1f56a3c..71a81a1 100644 --- a/overlays/vimPlugins.nix +++ b/overlays/vimPlugins.nix @@ -26,11 +26,11 @@ with lib.my; src = inputs.lspsaga-nvim; }); - advanced-git-search-nvim = prev.vimUtils.buildVimPluginFrom2Nix { - pname = "advanced-git-search-nvim"; - version = mkVersionInput inputs.advanced-git-search-nvim; - src = inputs.advanced-git-search-nvim; - }; + cmp-async-path = prev.vimPlugins.cmp-path.overrideAttrs (old: { + pname = "cmp-async-path"; + version = mkVersionInput inputs.cmp-async-path; + src = inputs.cmp-async-path; + }); comment-box-nvim = prev.vimUtils.buildVimPluginFrom2Nix { pname = "comment-box-nvim";