Skip to content

Commit

Permalink
Merge pull request #29 from redyf/dev
Browse files Browse the repository at this point in the history
refactor: Convert copilot config to nix options instead of lua
  • Loading branch information
redyf authored Jan 31, 2024
2 parents 3ab6510 + 80c1942 commit 2be8738
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 74 deletions.
110 changes: 39 additions & 71 deletions config/completion/copilot.nix
Original file line number Diff line number Diff line change
@@ -1,79 +1,47 @@
{
plugins.copilot-lua = {
enable = true;
};

# keymaps = [
# {
# mode = "n";
# key = "<leader>t";
# action = "+copilot";
# }
#
# {
# mode = "n";
# key = "<leader>to";
# action = "<cmd>:Copilot panel<cr>";
# options = {
# silent = true;
# desc = "Open Copilot";
# };
# }
#
# {
# mode = "n";
# key = "<leader>tc";
# action = "<cmd>:lua require('copilot.suggestion').toggle_auto_trigger()<cr>";
# options = {
# silent = true;
# desc = "Toggle Copilot";
# };
# }
# ];

extraConfigLua = ''
require('copilot').setup({
plugins.copilot-lua =
{
enable = true;
panel = {
enabled = false,
auto_refresh = true,
enabled = false;
autoRefresh = true;
keymap = {
jump_prev = "[[",
jump_next = "]]",
accept = "<CR>",
refresh = "gr",
open = "<M-CR>"
},
jumpPrev = "[[";
jumpNext = "]]";
accept = "<CR>";
refresh = "gr";
open = "<M-CR>";
};
layout = {
position = "bottom", -- | top | left | right
ratio = 0.4
},
},
position = "bottom"; # | top | left | right
ratio = 0.4;
};
};
suggestion = {
enabled = false,
auto_trigger = true,
debounce = 75,
enabled = false;
autoTrigger = true;
debounce = 75;
keymap = {
accept = "<M-l>",
accept_word = false,
accept_line = false,
next = "<M-]>",
prev = "<M-[>",
dismiss = "<C-]>",
},
},
accept = "<M-l>";
acceptWord = false;
acceptLine = false;
next = "<M-]>";
prev = "<M-[>";
dismiss = "<C-]>";
};
};
filetypes = {
yaml = false,
markdown = false,
help = false,
gitcommit = false,
gitrebase = false,
hgcommit = false,
svn = false,
cvs = false,
["."] = false,
},
copilot_node_command = 'node', -- Node.js version must be > 18.x
server_opts_overrides = {},
})
'';
yaml = false;
markdown = false;
help = false;
gitcommit = false;
gitrebase = false;
hgcommit = false;
svn = false;
cvs = false;
"." = false;
};
copilotNodeCommand = "node"; # Node.js version must be > 18.x
serverOptsOverrides = { };
};
}
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2be8738

Please sign in to comment.