Skip to content

Commit 69d50a7

Browse files
committed
vibe wip
1 parent fe13110 commit 69d50a7

File tree

1 file changed

+45
-13
lines changed

1 file changed

+45
-13
lines changed

pub/vi/vimrc.lua

Lines changed: 45 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ end
66

77
local ok, codecompanion = pcall(require, "codecompanion")
88
if ok then
9+
local rust =
10+
"Read about the project in README.md. Your code must be in a strictly functional style while being highly efficient, avoid mutable variables (mut), avoid imperative statements like loops, for, while, and return, use functional style iterators instead, avoid redundant closures and redundant variables, use method and function chaining/compositions as much as possible, avoid the clone method, avoid redundant allocations, cover the code with tests, and follow the existing project code style. However, to achieve this, use only standard, simple Rust. Avoid relying on fancy custom traits, and write code in a simple, functional style. Ensure that all functions, variables, types, and other identifiers in the code are meaningful and clear in their context, while still preferring shorter names, as in the original code. Do not write any comments in the code, as good code should always be clear on its own. After making your changes, ensure that the code is formatted with rustfmt, compiles successfully, and passes all tests."
911
codecompanion.setup({
1012
strategies = {
1113
chat = {
@@ -21,32 +23,62 @@ if ok then
2123
adapter = "gemini_cli",
2224
},
2325
},
26+
prompt_library = {
27+
rust = {
28+
strategy = "chat",
29+
prompts = { { role = "system", content = rust } },
30+
opts = {},
31+
},
32+
},
2433
adapters = {
2534
acp = {
2635
gemini_cli = function()
2736
return require("codecompanion.adapters").extend("gemini_cli", {
2837
defaults = {
2938
auth_method = "gemini-api-key",
3039
mcpServers = {},
31-
timeout = 20000, -- 20 seconds
40+
timeout = 50000,
41+
},
42+
commands = {
43+
default = {
44+
"gemini",
45+
"--experimental-acp",
46+
"-m",
47+
"gemini-2.5-flash-lite",
48+
},
49+
lite = {
50+
"gemini",
51+
"--experimental-acp",
52+
"-m",
53+
"gemini-2.5-flash-lite",
54+
},
55+
flash = {
56+
"gemini",
57+
"--experimental-acp",
58+
"-m",
59+
"gemini-2.5-flash",
60+
},
61+
pro = {
62+
"gemini",
63+
"--experimental-acp",
64+
"-m",
65+
"gemini-2.5-pro",
66+
},
3267
},
3368
})
3469
end,
3570
},
3671
},
3772
})
38-
vim.keymap.set("n", "<leader>zz", "<CMD>CodeCompanionChat Toggle<CR>", {
39-
desc = "ai: ch[a]t",
40-
})
41-
vim.keymap.set("n", "<leader>zx", "<CMD>CodeCompanionActions<CR>", {
42-
desc = "ai: action[s]",
43-
})
44-
vim.keymap.set("n", "<leader>zc", "<CMD>CodeCompanionCmd<CR>", {
45-
desc = "ai: cm[d]",
46-
})
47-
vim.keymap.set({ "n", "v" }, "<leader>zv", "<CMD>CodeCompanion<CR>", {
48-
desc = "ai: [f]ile write with diff",
49-
})
73+
vim.api.nvim_create_user_command("CodeCompanionRust", function(opts)
74+
local prev = opts.args
75+
local next = rust .. (prev and " " .. prev or "")
76+
vim.cmd("CodeCompanionChat " .. next)
77+
end, { nargs = "*", complete = "file" })
78+
vim.keymap.set("n", "<leader>zz", "<CMD>CodeCompanionChat Toggle<CR>", {})
79+
vim.keymap.set("n", "<leader>zx", "<CMD>CodeCompanionActions<CR>", {})
80+
vim.keymap.set("n", "<leader>zc", ":CodeCompanionRust ", {})
81+
-- vim.g.codecompanion_yolo_mode = true
5082
end
5183

5284
local ok, minuet = pcall(require, "minuet")

0 commit comments

Comments
 (0)