mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-05 18:01:32 +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
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…
Add table
Add a link
Reference in a new issue