From 069a65d4c7c11a8a569f16fd026297d937245f39 Mon Sep 17 00:00:00 2001 From: cy Date: Wed, 29 Jan 2025 16:23:33 -0500 Subject: [PATCH] nixvim: add copilot stuff --- home/nixvim/default.nix | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/home/nixvim/default.nix b/home/nixvim/default.nix index 89bfd94..f123392 100644 --- a/home/nixvim/default.nix +++ b/home/nixvim/default.nix @@ -24,7 +24,7 @@ extraPlugins = [ (pkgs.vimUtils.buildVimPlugin { - name = "gitub-theme"; + name = "github-theme"; src = inputs.nvim-github-theme; }) ]; @@ -71,6 +71,35 @@ key = ""; mode = "i"; } + # quick chat with copilot + { + key = "ccq"; + action.__raw = '' + function() + local input = vim.fn.input("Quick chat: ") + if input ~= "" then + require("CopilotChat").ask(input, { selection = require("CopilotChat.select").buffer }) + end + end + ''; + mode = [ "n" "v" ]; + } + # ask perplexity a quick question + { + key = "ccs"; + action.__raw = '' + function() + local input = vim.fn.input("Perplexity: ") + if input ~= "" then + require("CopilotChat").ask(input, { + agent = "perplexityai", + selection = false, + }) + end + end + ''; + mode = [ "n" "v" ]; + } ]; plugins.cmp = { @@ -197,6 +226,13 @@ settings.current_line_blame = true; }; + plugins.copilot-chat = { + enable = true; + settings = { + model = "claude-3.5-sonnet"; + }; + }; + plugins.cmp-buffer.enable = true; plugins.cmp-emoji.enable = true; plugins.cmp-nvim-lsp.enable = true;