Configure opencode

This commit is contained in:
2026-02-10 11:22:02 +01:00
parent c1d7d596cf
commit 1401918355
5 changed files with 37 additions and 59 deletions
+12
View File
@@ -10,6 +10,18 @@
./tools/tmux.nix
];
programs.opencode = {
enable = true;
settings = {
keybinds = {
variant_cycle = "ctrl+n";
input_clear = "ctrl+u";
session_interrupt = "ctrl+d";
app_exit = "none";
};
};
};
xdg.configFile."nixpkgs/config.nix".text = '' {
allowUnfree = true;
android_sdk.accept_license = true;
+1 -5
View File
@@ -108,11 +108,7 @@ in
nvim-navic
virt-column-nvim
codecompanion-nvim
# enable this just to signin (used by the chat plugin above)
# (copilot-vim.overrideAttrs {
# postPatch = "rm doc/copilot.txt";
# })
opencode-nvim
];
opt = [ ];
};
-54
View File
@@ -1,54 +0,0 @@
return {
{
"codecompanion",
keys = {
{
"<leader>l",
"<cmd>CodeCompanionChat Toggle<cr>",
desc = "Copilot",
mode = { "n", "v" },
}
},
opts = {
display = {
diff = {
enabled = false,
},
chat = {
window = {
opts = {
conceallevel = 3,
},
},
},
},
interactions = {
chat = {
adapter = "copilot",
start_in_insert_mode = true,
keymaps = {
send = {
modes = { n = "<C-s>", i = "<C-s>" },
},
close = {
modes = { n = "q", i = "<C-d>" },
},
},
tools = {
opts = {
auto_submit_success = true,
auto_submit_errors = true,
},
}
},
inline = {
adapter = "copilot",
},
},
},
after = function(plug)
require("codecompanion").setup(plug.opts)
end,
},
}
+22
View File
@@ -0,0 +1,22 @@
return {
{
"opencode-nvim",
keys = {
{
"<leader>l",
function() require("opencode").toggle() end,
desc = "Opencode",
mode = { "n", "v" },
}
},
---@type opencode.Opts
opts = {
provider = {
enabled = "terminal",
}
},
after = function(plug)
vim.g.opencode_opts = plug.opts
end,
},
}
+2
View File
@@ -68,6 +68,8 @@ vim.keymap.set("t", "<esc>", "<C-\\><C-N>", { desc = "Normal mode" })
-- Why is this not the default?
vim.keymap.set("c", "<c-a>", "<home>", { desc = "Begining" })
vim.keymap.set("i", "<a-d>", "<c-o>de")
-- Stay in indent mode
vim.keymap.set("v", "<", "<gv")
vim.keymap.set("v", ">", ">gv")