mirror of
https://github.com/zoriya/flake.git
synced 2026-08-15 18:43:42 +00:00
Configure opencode
This commit is contained in:
@@ -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
@@ -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 = [ ];
|
||||
};
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user