Neovim, add opencode support
This commit is contained in:
parent
8ace9ff9b4
commit
cfe5f11691
1 changed files with 34 additions and 1 deletions
|
|
@ -19,6 +19,7 @@
|
||||||
lualine.enable = lib.mkOption { default = true; };
|
lualine.enable = lib.mkOption { default = true; };
|
||||||
luasnip.enable = lib.mkOption { default = false; };
|
luasnip.enable = lib.mkOption { default = false; };
|
||||||
nvimcmp.enable = lib.mkOption { default = true; };
|
nvimcmp.enable = lib.mkOption { default = true; };
|
||||||
|
opencode.enable = lib.mkOption { default = true; };
|
||||||
telescope = {
|
telescope = {
|
||||||
enable = lib.mkOption { default = true; };
|
enable = lib.mkOption { default = true; };
|
||||||
fzf.enable = lib.mkOption { default = true; };
|
fzf.enable = lib.mkOption { default = true; };
|
||||||
|
|
@ -83,7 +84,29 @@
|
||||||
# -- Easy copy and pasting to external programs
|
# -- Easy copy and pasting to external programs
|
||||||
# -- map <C-y> "+yy
|
# -- map <C-y> "+yy
|
||||||
# -- map <C-p> "+P
|
# -- map <C-p> "+P
|
||||||
];
|
] ++ lib.lists.optionals config.neovim.plugins.opencode.enable (let
|
||||||
|
ocFunc = cmd: let raw = "function() require('opencode').${cmd} end";
|
||||||
|
in (config.lib.nixvim.mkRaw raw);
|
||||||
|
in [
|
||||||
|
{
|
||||||
|
key = "<leader>ot";
|
||||||
|
action = ocFunc "toggle()";
|
||||||
|
mode = [ "n" "x" ];
|
||||||
|
options.desc = "Toggle opencode";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "<leader>oa";
|
||||||
|
action = ocFunc "ask('', { submit = true })";
|
||||||
|
mode = [ "n" "x" ];
|
||||||
|
options.desc = "Ask opencode...";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "<leader>or";
|
||||||
|
action = ocFunc "operator('@this ')";
|
||||||
|
mode = [ "n" "x" ];
|
||||||
|
options.desc = "Add range to opencode";
|
||||||
|
}
|
||||||
|
]);
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.nixvim.colorschemes = with config.neovim.themes; {
|
programs.nixvim.colorschemes = with config.neovim.themes; {
|
||||||
|
|
@ -126,6 +149,16 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
opencode = {
|
||||||
|
enable = opencode.enable;
|
||||||
|
settings = {
|
||||||
|
input.enabled = true;
|
||||||
|
lsp.enabled = true;
|
||||||
|
events.permissions.enabled = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
snacks.enable = opencode.enable;
|
||||||
|
|
||||||
telescope = {
|
telescope = {
|
||||||
enable = telescope.enable;
|
enable = telescope.enable;
|
||||||
keymaps = {
|
keymaps = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue