From 470de9dfa7bd490872eb43e897a840caa2dc5a2c Mon Sep 17 00:00:00 2001 From: Oliver Hartmann Date: Sun, 30 Nov 2025 12:04:01 +0100 Subject: [PATCH] only use the node cmd if it exists --- lua/plugins/copilot.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/plugins/copilot.lua b/lua/plugins/copilot.lua index c006cde..d23d150 100644 --- a/lua/plugins/copilot.lua +++ b/lua/plugins/copilot.lua @@ -3,6 +3,11 @@ return { cmd = 'Copilot', event = 'InsertEnter', config = function() + local node_cmd = nil + local docker_node = vim.fn.expand('$HOME') .. '/.nvm/versions/node/v22.12.0/bin/node' + if vim.fn.executable(docker_node) == 1 then + node_cmd = docker_node + end require('copilot').setup({ filetypes = { yaml = false, @@ -17,7 +22,7 @@ return { cpp = true, ['.'] = false, }, - copilot_node_command = vim.fn.expand('$HOME') .. '/.nvm/versions/node/v22.12.0/bin/node', + copilot_node_command = node_cmd, suggestion = { enabled = false, auto_trigger = false }, panel = { enabled = false }, })