added several plugins
This commit is contained in:
parent
d67e8fdfc9
commit
51c37ffb23
6 changed files with 186 additions and 3 deletions
64
plugins/avante.nix
Normal file
64
plugins/avante.nix
Normal 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
24
plugins/bash.nix
Normal 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
|
||||||
|
];
|
||||||
|
}
|
|
@ -42,6 +42,7 @@
|
||||||
option.get_bufnrs.__raw = "vim.api.nvim_list_bufs";
|
option.get_bufnrs.__raw = "vim.api.nvim_list_bufs";
|
||||||
keywordLength = 3;
|
keywordLength = 3;
|
||||||
}
|
}
|
||||||
|
{ name = "codecompanion"; }
|
||||||
{ name = "copilot"; }
|
{ name = "copilot"; }
|
||||||
{
|
{
|
||||||
name = "path"; # file system paths
|
name = "path"; # file system paths
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
|
|
||||||
openai.__raw = ''
|
openai.__raw = ''
|
||||||
function()
|
function()
|
||||||
return require('codecompanion.adapters').extend('copilot', {
|
return require('codecompanion.adapters').extend('openai', {
|
||||||
env = {
|
env = {
|
||||||
api_key = "cmd:${pkgs.passage}/bin/passage /apis/ai/openai"
|
api_key = "cmd:${pkgs.passage}/bin/passage /apis/ai/openai"
|
||||||
}
|
}
|
||||||
|
|
87
plugins/dap.nix
Normal file
87
plugins/dap.nix
Normal 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";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,6 +1,8 @@
|
||||||
{ config, ... }:
|
{ config, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
./avante.nix
|
||||||
|
./bash.nix
|
||||||
# ./blink-cmp.nix
|
# ./blink-cmp.nix
|
||||||
# ./blink-cmp-copilot.nix
|
# ./blink-cmp-copilot.nix
|
||||||
# ./blink-cmp-dictionary.nix
|
# ./blink-cmp-dictionary.nix
|
||||||
|
@ -10,6 +12,7 @@
|
||||||
./cmp.nix
|
./cmp.nix
|
||||||
./codecompanion.nix
|
./codecompanion.nix
|
||||||
./copilot.nix
|
./copilot.nix
|
||||||
|
./dap.nix
|
||||||
./diffview.nix
|
./diffview.nix
|
||||||
./fzf-lua.nix
|
./fzf-lua.nix
|
||||||
./indent-blankline.nix
|
./indent-blankline.nix
|
||||||
|
@ -33,9 +36,12 @@
|
||||||
## are part of the buffer rotation
|
## are part of the buffer rotation
|
||||||
notify = {
|
notify = {
|
||||||
enable = false;
|
enable = false;
|
||||||
topDown = false;
|
settings = {
|
||||||
|
top_down = false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
nvim-autopairs.enable = true;
|
nvim-autopairs.enable = true;
|
||||||
|
nvim-bqf.enable = true;
|
||||||
nvim-lightbulb.enable = true;
|
nvim-lightbulb.enable = true;
|
||||||
# config = ''
|
# config = ''
|
||||||
# lua << EOF
|
# lua << EOF
|
||||||
|
@ -55,10 +61,11 @@
|
||||||
rainbow-delimiters.enable = true;
|
rainbow-delimiters.enable = true;
|
||||||
sleuth.enable = true;
|
sleuth.enable = true;
|
||||||
startify.enable = config.nixvim-config.enable-startify;
|
startify.enable = config.nixvim-config.enable-startify;
|
||||||
|
tmux-navigator.enable = true;
|
||||||
treesitter.enable = true;
|
treesitter.enable = true;
|
||||||
treesitter-context.enable = true;
|
treesitter-context.enable = true;
|
||||||
tmux-navigator.enable = true;
|
|
||||||
trouble.enable = true;
|
trouble.enable = true;
|
||||||
|
ts-autotag.enable = true;
|
||||||
# ## Needed for telescope, nvim-tree, trouble, diffview, bufferline, and other plugins
|
# ## Needed for telescope, nvim-tree, trouble, diffview, bufferline, and other plugins
|
||||||
# ## Only on unstable at the moment
|
# ## Only on unstable at the moment
|
||||||
web-devicons.enable = true;
|
web-devicons.enable = true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue