forked from elythh/nixvim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcopilot.nix
56 lines (55 loc) · 1.15 KB
/
copilot.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{
pkgs,
lib,
...
}: let
copilotChatRepo = {
owner = "copilotc-nvim";
repo = "CopilotChat.nvim";
rev = "2771f1fa7af502ea4226a88a792f4e4319199906";
hash = "sha256-Q+g81BQVQTY5J2c2ZWB7bjJLuNSdI0PAan+75YJ7mI0=";
};
in {
extraPlugins = with pkgs.vimUtils; [
(buildVimPlugin {
pname = "copilotchat";
version = "2.4.0";
src = pkgs.fetchFromGitHub copilotChatRepo;
meta = {
description = "Chat with GitHub Copilot in Neovim";
homepage = "https://github.com/CopilotC-Nvim/CopilotChat.nvim/";
license = lib.licenses.gpl3;
};
})
];
extraConfigLua = ''
require("CopilotChat").setup { }
'';
keymaps = [
{
mode = "x";
key = "<leader>a";
action = "+copilot";
}
{
mode = "x";
key = "<leader>ae";
action = "<cmd>CopilotChatExplain<cr>";
}
{
mode = "x";
key = "<leader>af";
action = "<cmd>CopilotChatFix<cr>";
}
{
mode = "x";
key = "<leader>ad";
action = "<cmd>CopilotChatDocs<cr>";
}
{
mode = "x";
key = "<leader>ac";
action = "<cmd>CopilotChatCommit<cr>";
}
];
}