added several plugins

This commit is contained in:
Ellis Rahhal 2025-02-16 23:22:51 -08:00
parent d67e8fdfc9
commit 51c37ffb23
6 changed files with 186 additions and 3 deletions

64
plugins/avante.nix Normal file
View file

@ -0,0 +1,64 @@
{ ... }:
{
programs.nixvim.plugins.avante = {
enable = true;
settings = {
provider = "ollama";
claude = {
api_key_name = "<api_key_name>";
};
openai = {
api_key_name = "<api_key_name>";
};
vendors = {
ollama = {
api_key_name = "";
endpoint = "http://localhost:11434/v1";
model = "hf.co/unsloth/DeepSeek-R1-Distill-Qwen-1.5B-GGUF";
temperature = "0.6";
parse_curl_args.__raw = ''
function(opts, code_opts)
return {
url = opts.endpoint .. "/chat/completions",
headers = {
["Accept"] = "application/json",
["Content-Type"] = "application/json",
["x-api-key"] = "ollama",
},
body = {
model = opts.model,
messages = require("avante.providers").copilot.parse_messages(code_opts),
max_tokens = opts.max_tokens,
stream = true,
},
}
end'';
parse_response_data.__raw = ''
function(data_stream, event_state, opts)
require("avante.providers").openai.parse_response(data_stream, event_state, opts)
end'';
};
};
mappings = {
ask = "<leader>ca";
edit = "<leader>ce";
refresh = "<leader>cr";
focus = "<leader>cf";
toggle = {
default = "<leader>ct";
debug = "<leader>cd";
hint = "<leader>ch";
suggestion = "<leader>cs";
repomap = "<leader>cR";
};
files = {
add_current = "<leader>cc";
};
};
};
};
}

24
plugins/bash.nix Normal file
View file

@ -0,0 +1,24 @@
{ pkgs, ... }:
{
programs.nixvim.plugins = {
lsp.servers.bashls = {
enable = true;
filetypes = ["sh" "zsh"];
};
none-ls = {
sources = {
formatting.shfmt.enable = true;
formatting.shellharden.enable = true;
};
};
};
environment.systemPackages = with pkgs; [
shellcheck
shellharden
shfmt
nodePackages.bash-language-server
];
}

View file

@ -42,6 +42,7 @@
option.get_bufnrs.__raw = "vim.api.nvim_list_bufs";
keywordLength = 3;
}
{ name = "codecompanion"; }
{ name = "copilot"; }
{
name = "path"; # file system paths

View file

@ -41,7 +41,7 @@
openai.__raw = ''
function()
return require('codecompanion.adapters').extend('copilot', {
return require('codecompanion.adapters').extend('openai', {
env = {
api_key = "cmd:${pkgs.passage}/bin/passage /apis/ai/openai"
}

87
plugins/dap.nix Normal file
View file

@ -0,0 +1,87 @@
{ ... }:
{
programs.nixvim = {
plugins = {
dap.enable = true;
dap-ui.enable = true;
dap-virtual-text.enable = true;
};
extraConfigLua = ''
vim.fn.sign_define("DapBreakpoint", { text = " ", texthl = "DiagnosticSignError", linehl = "", numhl = "" })
vim.fn.sign_define("DapBreakpointCondition", { text = " ", texthl = "DiagnosticSignWarn", linehl = "", numhl = "" })
vim.fn.sign_define("DapLogPoint", { text = " ", texthl = "DiagnosticSignInfo", linehl = "", numhl = "" })
vim.fn.sign_define("DapStopped", { text = " ", texthl = "DiagnosticSignWarn", linehl = "", numhl = "" })
vim.fn.sign_define("DapBreakpointReject", { text = "", texthl = "DiagnosticSignHint", linehl = "", numhl = "" })
'';
keymaps = [
{
mode = "n";
key = "<leader>dB";
action = "<cmd>lua require('dap').set_breakpoint(vim.fn.input('Breakpoint condition: '))<cr>";
options.desc = "set breakpoint with condition";
}
{
mode = "n";
key = "<leader>db";
action = "<cmd>lua require('dap').toggle_breakpoint()<cr>";
options.desc = "Toggle Breakpoint";
}
{
mode = "n";
key = "<leader>dc";
action = "<cmd>lua require('dapui').close()<cr>";
options.desc = "Close";
}
{
mode = "n";
key = "<leader>ddr";
action = "<cmd>lua require('dap').repl.open()<cr>";
options.desc = "Repl";
}
{
mode = "n";
key = "<leader>de";
action = "<cmd>lua require('dap').step_out()<cr>";
options.desc = "Step Out";
}
{
mode = "n";
key = "<leader>dlp";
action = "<cmd>lua require('dap').set_breakpoint(nil, nil, vim.fn.input('Log point message: '))<cr>";
options.desc = "Log Point Message";
}
{
mode = "n";
key = "<leader>dn";
action = "<cmd>lua require('dap').step_over()<cr>";
options.desc = "Step Over";
}
{
mode = "n";
key = "<leader>do";
action = "<cmd>lua require('dapui').open()<cr>";
options.desc = "Open";
}
{
mode = "n";
key = "<leader>dr";
action = "<cmd>lua require('dap').continue()<cr>";
options.desc = "Continue";
}
{
mode = "n";
key = "<leader>ds";
action = "<cmd>lua require('dap').step_into()<cr>";
options.desc = "Step Into";
}
{
mode = "n";
key = "<leader>dt";
action = "<cmd>lua require('dapui').close()<cr>";
options.desc = "Toggle";
}
];
};
}

View file

@ -1,6 +1,8 @@
{ config, ... }:
{
imports = [
./avante.nix
./bash.nix
# ./blink-cmp.nix
# ./blink-cmp-copilot.nix
# ./blink-cmp-dictionary.nix
@ -10,6 +12,7 @@
./cmp.nix
./codecompanion.nix
./copilot.nix
./dap.nix
./diffview.nix
./fzf-lua.nix
./indent-blankline.nix
@ -33,9 +36,12 @@
## are part of the buffer rotation
notify = {
enable = false;
topDown = false;
settings = {
top_down = false;
};
};
nvim-autopairs.enable = true;
nvim-bqf.enable = true;
nvim-lightbulb.enable = true;
# config = ''
# lua << EOF
@ -55,10 +61,11 @@
rainbow-delimiters.enable = true;
sleuth.enable = true;
startify.enable = config.nixvim-config.enable-startify;
tmux-navigator.enable = true;
treesitter.enable = true;
treesitter-context.enable = true;
tmux-navigator.enable = true;
trouble.enable = true;
ts-autotag.enable = true;
# ## Needed for telescope, nvim-tree, trouble, diffview, bufferline, and other plugins
# ## Only on unstable at the moment
web-devicons.enable = true;