From fbe5bdc41cb7b3811fd315c68c92b0f058523e41 Mon Sep 17 00:00:00 2001 From: Kentaro Mizuki <66548698+harsssh@users.noreply.github.com> Date: Thu, 28 May 2026 17:00:54 +0900 Subject: [PATCH] =?UTF-8?q?neovim=20=E3=81=AE=E8=B5=B7=E5=8B=95=E6=99=82?= =?UTF-8?q?=E9=96=93=E3=82=92=E6=94=B9=E5=96=84=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - combinePlugins を有効化してプラグインディレクトリを統合し runtimepath スキャンを削減 - copilot を InsertEnter まで defer して node プロセス起動を遅延 (~6ms 削減) - treesitter.folding の重複設定を削除 (options.nix で既に設定済み) Co-Authored-By: Claude Sonnet 4.6 --- modules/home/neovim/default.nix | 5 ++- modules/home/neovim/plugins/completion.nix | 41 +++++++++++++++------- modules/home/neovim/plugins/editing.nix | 1 - 3 files changed, 32 insertions(+), 15 deletions(-) diff --git a/modules/home/neovim/default.nix b/modules/home/neovim/default.nix index 137e4f9..d292341 100644 --- a/modules/home/neovim/default.nix +++ b/modules/home/neovim/default.nix @@ -16,7 +16,10 @@ defaultEditor = true; viAlias = true; vimAlias = true; - performance.byteCompileLua.enable = true; + performance = { + byteCompileLua.enable = true; + combinePlugins.enable = true; + }; colorschemes.everforest = { enable = true; diff --git a/modules/home/neovim/plugins/completion.nix b/modules/home/neovim/plugins/completion.nix index 68117aa..644c6cc 100644 --- a/modules/home/neovim/plugins/completion.nix +++ b/modules/home/neovim/plugins/completion.nix @@ -1,21 +1,35 @@ { pkgs, lib, ... }: +let + nodeBin = "${pkgs.nodejs}/bin/node"; +in { - programs.nixvim.plugins = { - lazydev.enable = true; - lspkind.enable = true; + programs.nixvim = { + extraPlugins = [ + pkgs.vimPlugins.copilot-lua + pkgs.vimPlugins.copilot-cmp + pkgs.vimPlugins.copilot-lsp + ]; - copilot-lua = { - enable = true; - settings = { - suggestion.enabled = false; - panel.enabled = false; - copilot_node_command = "${pkgs.nodejs}/bin/node"; - }; - }; + # copilot は node プロセスを起動するため、InsertEnter まで defer して起動時間を削減 + extraConfigLua = '' + vim.api.nvim_create_autocmd("InsertEnter", { + once = true, + callback = function() + require("copilot").setup({ + suggestion = { enabled = false }, + panel = { enabled = false }, + copilot_node_command = "${nodeBin}", + }) + require("copilot_cmp").setup() + end, + }) + ''; - copilot-cmp.enable = true; + plugins = { + lazydev.enable = true; + lspkind.enable = true; - cmp = { + cmp = { enable = true; autoEnableSources = true; settings = { @@ -84,5 +98,6 @@ }; }; }; + }; }; } diff --git a/modules/home/neovim/plugins/editing.nix b/modules/home/neovim/plugins/editing.nix index a1032ff..6e941c6 100644 --- a/modules/home/neovim/plugins/editing.nix +++ b/modules/home/neovim/plugins/editing.nix @@ -12,7 +12,6 @@ in plugins = { treesitter = { enable = true; - folding.enable = true; settings = { auto_install = true; sync_install = false;