mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-22 13:20:44 +00:00
feat: TabNine and Copilot assistants
This commit is contained in:
parent
7d1558c387
commit
78d3ae31d1
7 changed files with 112 additions and 1 deletions
34
flake.lock
34
flake.lock
|
@ -208,6 +208,22 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"copilot-lua": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1675346663,
|
||||
"narHash": "sha256-+a286iUK7UijcbRLb8gXwmDFZAf1gYupS5f9EHB+dxU=",
|
||||
"owner": "zbirenbaum",
|
||||
"repo": "copilot.lua",
|
||||
"rev": "a54e7b11a2c6efc9ddd3f42e56cf7d9eed1a9683",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "zbirenbaum",
|
||||
"repo": "copilot.lua",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"crates-nvim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
|
@ -961,6 +977,7 @@
|
|||
"cmp-vsnip": "cmp-vsnip",
|
||||
"codewindow-nvim": "codewindow-nvim",
|
||||
"colorizer": "colorizer",
|
||||
"copilot-lua": "copilot-lua",
|
||||
"crates-nvim": "crates-nvim",
|
||||
"dashboard-nvim": "dashboard-nvim",
|
||||
"discord-nvim": "discord-nvim",
|
||||
|
@ -1005,6 +1022,7 @@
|
|||
"rust-tools": "rust-tools",
|
||||
"scrollbar-nvim": "scrollbar-nvim",
|
||||
"sqls-nvim": "sqls-nvim",
|
||||
"tabnine-nvim": "tabnine-nvim",
|
||||
"tabular": "tabular",
|
||||
"telescope": "telescope",
|
||||
"tidalcycles": "tidalcycles",
|
||||
|
@ -1108,6 +1126,22 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"tabnine-nvim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1675586775,
|
||||
"narHash": "sha256-7vd+moqQ5bA58VXlHSWXcJbI6ovp7z2Nf6Cn7cq08Ps=",
|
||||
"owner": "codota",
|
||||
"repo": "tabnine-nvim",
|
||||
"rev": "85b3ad6df16ad09f8c486ec4c21defa75cebe22c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "codota",
|
||||
"repo": "tabnine-nvim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"tabular": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
|
|
18
flake.nix
18
flake.nix
|
@ -168,6 +168,11 @@
|
|||
vim.ui = {
|
||||
noice.enable = true;
|
||||
};
|
||||
|
||||
vim.assistant = {
|
||||
copilot.enable = false;
|
||||
tabnine.enable = false; # FIXME: this is not working because the plugin depends on an internal script to be ran by the package manager
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -560,12 +565,23 @@
|
|||
flake = false;
|
||||
};
|
||||
|
||||
# UI44444
|
||||
# UI
|
||||
noice-nvim = {
|
||||
url = "github:folke/noice.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Assistant
|
||||
copilot-lua = {
|
||||
url = "github:zbirenbaum/copilot.lua";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
tabnine-nvim = {
|
||||
url = "github:codota/tabnine-nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Dependencies
|
||||
plenary-nvim = {
|
||||
# (required by crates-nvim)
|
||||
|
|
24
modules/assistant/copilot.nix
Normal file
24
modules/assistant/copilot.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with builtins; let
|
||||
cfg = config.vim.assistant.copilot;
|
||||
in {
|
||||
options.vim.assistant.copilot = {
|
||||
enable = mkEnableOption "Enable GitHub Copilot";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
vim.startPlugins = ["copilot-lua"];
|
||||
|
||||
vim.luaConfigRC.copilot = nvim.dag.entryAnywhere ''
|
||||
require("copilot").setup({
|
||||
-- available options: https://github.com/zbirenbaum/copilot.lua
|
||||
})
|
||||
'';
|
||||
};
|
||||
}
|
6
modules/assistant/default.nix
Normal file
6
modules/assistant/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
_: {
|
||||
imports = [
|
||||
./copilot.nix
|
||||
./tabnine.nix
|
||||
];
|
||||
}
|
28
modules/assistant/tabnine.nix
Normal file
28
modules/assistant/tabnine.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with builtins; let
|
||||
cfg = config.vim.assistant.tabnine;
|
||||
in {
|
||||
options.vim.assistant.tabnine = {
|
||||
enable = mkEnableOption "Enable TabNine assistant";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
vim.startPlugins = ["tabnine-nvim"];
|
||||
|
||||
vim.luaConfigRC.tabnine-nvim = nvim.dag.entryAnywhere ''
|
||||
require('tabnine').setup({
|
||||
disable_auto_comment=true,
|
||||
accept_keymap="<Tab>",
|
||||
dismiss_keymap = "<C-]>",
|
||||
debounce_ms = 800,
|
||||
execlude_filetypes = {"TelescopePrompt", "NvimTree", "alpha"}
|
||||
})
|
||||
'';
|
||||
};
|
||||
}
|
|
@ -62,6 +62,8 @@ with lib; let
|
|||
"toggleterm-nvim"
|
||||
"noice-nvim"
|
||||
"nui-nvim"
|
||||
"copilot-lua"
|
||||
"tabnine-nvim"
|
||||
];
|
||||
# You can either use the name of the plugin or a package.
|
||||
pluginsType = with types; listOf (nullOr (either (enum availablePlugins) package));
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
./notes
|
||||
./terminal
|
||||
./ui
|
||||
./assistant
|
||||
];
|
||||
|
||||
pkgsModule = {config, ...}: {
|
||||
|
|
Loading…
Reference in a new issue