setup copilot inline suggestions + chat
This commit is contained in:
parent
7aca777bf9
commit
b13e372fd6
7 changed files with 116 additions and 2 deletions
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
# Completion
|
# Completion
|
||||||
./plugins/cmp/cmp.nix
|
./plugins/cmp/cmp.nix
|
||||||
|
./plugins/cmp/copilot.nix
|
||||||
|
|
||||||
# Debug Adapter Protocol
|
# Debug Adapter Protocol
|
||||||
./plugins/dap/dap.nix
|
./plugins/dap/dap.nix
|
||||||
|
@ -39,6 +40,7 @@
|
||||||
./plugins/git/lazygit.nix
|
./plugins/git/lazygit.nix
|
||||||
|
|
||||||
# Utils
|
# Utils
|
||||||
|
./plugins/utils/copilot-chat.nix
|
||||||
./plugins/utils/markdown-preview.nix
|
./plugins/utils/markdown-preview.nix
|
||||||
./plugins/utils/render-markdown.nix
|
./plugins/utils/render-markdown.nix
|
||||||
./plugins/utils/oil.nix
|
./plugins/utils/oil.nix
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
conceallevel = 1;
|
conceallevel = 1;
|
||||||
updatetime=100;
|
updatetime=100;
|
||||||
undofile = true;
|
undofile = true;
|
||||||
|
splitright = true;
|
||||||
|
|
||||||
# Tabs & Spaces
|
# Tabs & Spaces
|
||||||
tabstop = 2;
|
tabstop = 2;
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
"<Up>" =
|
"<Up>" =
|
||||||
# Lua
|
# Lua
|
||||||
"cmp.mapping(cmp.mapping.select_prev_item({behavior = cmp.SelectBehavior.Select}), {'i', 's'})";
|
"cmp.mapping(cmp.mapping.select_prev_item({behavior = cmp.SelectBehavior.Select}), {'i', 's'})";
|
||||||
"<Tab>" =
|
"<cr>" =
|
||||||
# Lua
|
# Lua
|
||||||
"cmp.mapping.confirm({ select = true, behavior = cmp.ConfirmBehavior.Replace })";
|
"cmp.mapping.confirm({ select = true, behavior = cmp.ConfirmBehavior.Replace })";
|
||||||
};
|
};
|
||||||
|
|
44
config/plugins/cmp/copilot.nix
Normal file
44
config/plugins/cmp/copilot.nix
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
{...}: {
|
||||||
|
plugins.copilot-vim = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
# Disable Copilot by default.
|
||||||
|
enabled = 0;
|
||||||
|
# Use the following workspace folders to improve suggestions.
|
||||||
|
workspace_folders = [
|
||||||
|
"/home/sajenim/.repositories/personal"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
keymaps = [
|
||||||
|
{
|
||||||
|
mode = ["n" "v"];
|
||||||
|
key = "<leader>c";
|
||||||
|
action = "<Nop>";
|
||||||
|
options = {
|
||||||
|
desc = "+copilot";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
mode = ["n"];
|
||||||
|
key = "<leader>ce";
|
||||||
|
action = "<cmd>Copilot enable<cr>";
|
||||||
|
options = {
|
||||||
|
silent = true;
|
||||||
|
desc = "Enable inline suggestions";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
mode = ["n"];
|
||||||
|
key = "<leader>cd";
|
||||||
|
action = "<cmd>Copilot disable<cr>";
|
||||||
|
options = {
|
||||||
|
silent = true;
|
||||||
|
desc = "Disable inline suggestions";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
59
config/plugins/utils/copilot-chat.nix
Normal file
59
config/plugins/utils/copilot-chat.nix
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
{ ... }: {
|
||||||
|
plugins.copilot-chat = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
# Copilot Chat settings.
|
||||||
|
settings = {
|
||||||
|
# Model to use for Copilot Chat.
|
||||||
|
model = "gpt-4.1";
|
||||||
|
# Window settings for Copilot Chat.
|
||||||
|
window = {
|
||||||
|
# Width of the chat window.
|
||||||
|
width = 0.3;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Keymaps for Copilot Chat.
|
||||||
|
keymaps = [
|
||||||
|
{
|
||||||
|
mode = ["n"];
|
||||||
|
key = "<leader>ct";
|
||||||
|
action = "<cmd>CopilotChatToggle<cr>";
|
||||||
|
options = {
|
||||||
|
silent = true;
|
||||||
|
desc = "Toggle chat";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
mode = ["n"];
|
||||||
|
key = "<leader>cp";
|
||||||
|
action = "<cmd>CopilotChatPrompts<cr>";
|
||||||
|
options = {
|
||||||
|
silent = true;
|
||||||
|
desc = "Select prompt";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
mode = ["n"];
|
||||||
|
key = "<leader>cm";
|
||||||
|
action = "<cmd>CopilotChatModels<cr>";
|
||||||
|
options = {
|
||||||
|
silent = true;
|
||||||
|
desc = "Select model";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
mode = ["n"];
|
||||||
|
key = "<leader>ca";
|
||||||
|
action = "<cmd>CopilotChatAgents<cr>";
|
||||||
|
options = {
|
||||||
|
silent = true;
|
||||||
|
desc = "Select agent";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
|
@ -8,6 +8,10 @@
|
||||||
fzf-native = {
|
fzf-native = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
# Enable telescope UI select.
|
||||||
|
ui-select = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Configure telescope settings.
|
# Configure telescope settings.
|
||||||
|
|
|
@ -25,10 +25,14 @@
|
||||||
system,
|
system,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
|
pkgsWithUnfree = import inputs.nixpkgs {
|
||||||
|
inherit system;
|
||||||
|
config.allowUnfree = true;
|
||||||
|
};
|
||||||
nixvimLib = nixvim.lib.${system};
|
nixvimLib = nixvim.lib.${system};
|
||||||
nixvim' = nixvim.legacyPackages.${system};
|
nixvim' = nixvim.legacyPackages.${system};
|
||||||
nixvimModule = {
|
nixvimModule = {
|
||||||
inherit pkgs;
|
pkgs = pkgsWithUnfree;
|
||||||
module = import ./config; # import the module directly
|
module = import ./config; # import the module directly
|
||||||
# You can use `extraSpecialArgs` to pass additional arguments to your module files
|
# You can use `extraSpecialArgs` to pass additional arguments to your module files
|
||||||
extraSpecialArgs = {
|
extraSpecialArgs = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue