add stuff

This commit is contained in:
2025-04-23 09:58:34 +02:00
parent 6eb4b228ff
commit df0600601b
7 changed files with 82 additions and 79 deletions

View File

@@ -1,19 +1,67 @@
{ lib, config, ... }:
{
lib,
pkgs,
config,
...
}:
let
cfg = config.presets.base.completion;
in
{
options.presets.base.completion = {
enable = lib.mkEnableOption "completion";
copilot = lib.mkEnableOption "Copilot";
ollama = lib.mkEnableOption "Ollama";
};
config = lib.mkIf cfg.enable {
extraConfigLua =
lib.mkIf cfg.ollama
#lua
''
require('minuet').setup({
provider = 'openai_fim_compatible',
n_completions = 1,
context_window = 1024,
provider_options = {
openai_fim_compatible = {
api_key = 'TERM',
name = 'Ollama',
end_point = 'http://localhost:11434/v1/completions',
model = 'deepseek-coder-v2:16b',
optional = {
max_tokens = 56,
stop = { '\n' },
top_p = 0.9,
},
},
},
virtualtext = {
show_on_completion_menu = true,
auto_trigger_ft = { "*" },
keymap = {
accept = '<A-l>',
},
},
throttle = 0,
debounce = 0,
})
'';
plugins = {
luasnip.enable = true;
lspkind = {
enable = true;
mode = "symbol_text";
};
lualine.settings.sections.lualine_x = lib.mkIf cfg.ollama (
lib.mkBefore [
{ __unkeyed-1.__raw = "require('minuet.lualine')"; }
]
);
copilot-lua = lib.mkIf cfg.copilot {
enable = true;
settings.suggestion.auto_trigger = true;
};
cmp = {
enable = true;
settings = {
@@ -53,5 +101,6 @@ in
};
};
};
extraPlugins = lib.mkIf cfg.ollama [ pkgs.vimPlugins.minuet-ai-nvim ];
};
}

View File

@@ -16,27 +16,17 @@ in
extraConfigLuaPre = # lua
''
vim.lsp.set_log_level("off")
require("actions-preview").setup({})
local signs = {
{ name = "DiagnosticSignError", text = "" },
{ name = "DiagnosticSignWarn", text = "" },
{ name = "DiagnosticSignHint", text = "󰌵" },
{ name = "DiagnosticSignInfo", text = "" },
}
for _, sign in ipairs(signs) do
vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" })
end
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = "solid" })
'';
diagnostics = {
signs.text = {
"__rawKey__vim.diagnostic.severity.ERROR" = "";
"__rawKey__vim.diagnostic.severity.WARN" = "";
"__rawKey__vim.diagnostic.severity.INFO" = "";
"__rawKey__vim.diagnostic.severity.HINT" = "󰌵";
virtual_text.prefix = "";
signs = false;
float = {
focusable = false;
header = "";
border = "solid";
scope = "cursor";
prefix = "";
};
underline = true;
update_in_insert = true;
@@ -44,11 +34,11 @@ in
};
keymaps = [
{
key = "<leader>sa";
key = "<leader>sn";
mode = "n";
options.silent = true;
action.__raw = # lua
"require('actions-preview').code_actions";
"function() vim.diagnostic.open_float(nil) end";
}
{
key = "<leader>sx";
@@ -68,13 +58,6 @@ in
mode = "n";
action = ":IncRename ";
}
{
key = "<leader>sn";
mode = "n";
options.silent = true;
action.__raw = # lua
"vim.lsp.buf.hover";
}
{
key = "<leader>sh";
mode = "n";
@@ -86,7 +69,7 @@ in
plugins = {
lsp = {
enable = true;
inlayHints = false;
inlayHints = true;
};
telescope = {
enable = true;
@@ -96,6 +79,7 @@ in
"<leader>si" = "lsp_implementations";
"<leader>sw" = "lsp_workspace_symbols";
"<leader>st" = "lsp_type_definitions";
"<leader>sa" = "quickfix";
};
};
inc-rename.enable = true;
@@ -105,11 +89,6 @@ in
group = "LSP";
icon = "󱐋";
}
{
__unkeyed-1 = "<leader>sn";
desc = "Hover";
icon = "";
}
{
__unkeyed-1 = "<leader>sr";
desc = "References";
@@ -155,6 +134,11 @@ in
desc = "Code Actions";
icon = "";
}
{
__unkeyed-1 = "<leader>sn";
desc = "Diagnostics";
icon = "";
}
{
__unkeyed-1 = "<leader>sx";
desc = "LSP Format";
@@ -162,6 +146,5 @@ in
}
];
};
extraPlugins = [ pkgs.vimPlugins.actions-preview-nvim ];
};
}