mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
copilot: init plugin (#50)
This commit is contained in:
parent
f2a103da30
commit
369b586fa9
2 changed files with 37 additions and 0 deletions
36
plugins/completion/copilot.nix
Normal file
36
plugins/completion/copilot.nix
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.plugins.copilot;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options = {
|
||||||
|
plugins.copilot = {
|
||||||
|
enable = mkEnableOption "Enable copilot";
|
||||||
|
filetypes = mkOption {
|
||||||
|
type = types.attrsOf types.bool;
|
||||||
|
description = "A dictionary mapping file types to their enabled status";
|
||||||
|
default = { };
|
||||||
|
example = literalExpression ''{
|
||||||
|
"*": false,
|
||||||
|
python: true
|
||||||
|
}'';
|
||||||
|
};
|
||||||
|
proxy = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
description = "Tell Copilot what proxy server to use.";
|
||||||
|
default = null;
|
||||||
|
example = "localhost:3128";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config =
|
||||||
|
mkIf cfg.enable {
|
||||||
|
extraPlugins = [ pkgs.vimPlugins.copilot-vim ];
|
||||||
|
globals = {
|
||||||
|
copilot_node_command = "${pkgs.nodejs-16_x}/bin/node";
|
||||||
|
copilot_filetypes = cfg.filetypes;
|
||||||
|
} // (if cfg.proxy != null then { copilot_proxy = cfg.proxy; } else { });
|
||||||
|
};
|
||||||
|
}
|
|
@ -11,6 +11,7 @@
|
||||||
./colorschemes/tokyonight.nix
|
./colorschemes/tokyonight.nix
|
||||||
|
|
||||||
./completion/coq.nix
|
./completion/coq.nix
|
||||||
|
./completion/copilot.nix
|
||||||
./completion/nvim-cmp
|
./completion/nvim-cmp
|
||||||
./completion/nvim-cmp/sources
|
./completion/nvim-cmp/sources
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue