mirror of
https://github.com/lightly-toasted/nix-config.git
synced 2025-12-10 07:59:43 +00:00
feat(nixvim): add opencode plugin
- Added opencode plugin - Added keymaps for opencode actions (<leader>oa, <leader>ox, <leader>og) - Included lsof package for opencode.nvim to function
This commit is contained in:
parent
868cc11458
commit
934f2ed339
3 changed files with 41 additions and 15 deletions
|
|
@ -17,19 +17,11 @@
|
|||
|
||||
imports = [
|
||||
./keymaps.nix
|
||||
./plugins/bufferline.nix
|
||||
./plugins/lualine.nix
|
||||
./plugins/cmp.nix
|
||||
./plugins/comment.nix
|
||||
./plugins/colorizer.nix
|
||||
./plugins/nvim-autopairs.nix
|
||||
./plugins/gitsigns.nix
|
||||
./plugins/telescope.nix
|
||||
./plugins/treesitter.nix
|
||||
./plugins/nvim-tree.nix
|
||||
./plugins/web-devicons.nix
|
||||
./plugins/wakatime.nix
|
||||
./plugins/which-key.nix
|
||||
./plugins/lsp.nix
|
||||
];
|
||||
] ++ (
|
||||
let
|
||||
pluginsPath = ./plugins;
|
||||
pluginFiles = builtins.attrNames (builtins.readDir pluginsPath);
|
||||
in
|
||||
map (module: pluginsPath + ("/" + module)) pluginFiles
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,6 +88,24 @@
|
|||
action = "<cmd>lua vim.lsp.buf.code_action()<CR>";
|
||||
options.desc = "LSP Code Action";
|
||||
}
|
||||
{
|
||||
mode = ["n" "x"];
|
||||
key = "<leader>oa";
|
||||
action.__raw = ''function() require("opencode").ask("@selection: ", { submit = true }) end'';
|
||||
options.desc = "Ask opencode";
|
||||
}
|
||||
{
|
||||
mode = ["n" "x"];
|
||||
key = "<leader>ox";
|
||||
action.__raw = ''function() require("opencode").select() end'';
|
||||
options.desc = "Execute opencode action...";
|
||||
}
|
||||
{
|
||||
mode = ["n" "x"];
|
||||
key = "<leader>og";
|
||||
action.__raw = ''function() require("opencode").prompt("@selection") end'';
|
||||
options.desc = "Add to opencode";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
16
home/modules/cli/nixvim/plugins/opencode.nix
Normal file
16
home/modules/cli/nixvim/plugins/opencode.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{ pkgs, ...}:
|
||||
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
lsof
|
||||
];
|
||||
programs.nixvim = {
|
||||
plugins.opencode = {
|
||||
enable = true;
|
||||
settings = {
|
||||
auto_reload = true;
|
||||
};
|
||||
};
|
||||
opts.autoread = true;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue