Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions plugins/nobbz/lua/nobbz/augment.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
local augment_workspace = vim.env.AUGMENT_WORKSPACE
local augment_node = vim.env.AUGMENT_NODE

---Returns a closure that accepts the current augmentation completion.
---
---The returned function invokes Vim's "augment#Accept". If a fallback string is provided,
---it passes the fallback value to "augment#Accept"; otherwise, it calls the function without arguments.
---@param fallback string? Optional fallback text used when accepting completion.
---@return function A closure that triggers the augment accept command.
local function accept_completion(fallback)
if fallback then
return function() vim.fn["augment#Accept"](fallback) end
else
return function() vim.fn["augment#Accept"]() end
end
end

require("nobbz.lazy").add_specs({ {
"augment",
enabled = function()
Expand All @@ -9,8 +23,11 @@ require("nobbz.lazy").add_specs({ {
before = function(plugin)
vim.g.augment_workspace_folders = { augment_workspace, }
vim.g.augment_node_command = augment_node

vim.g.augment_disable_tab_mapping = true
end,
cmd = "Augment",
event = "DeferredUIEnter",
}, })

WK.add({
Expand All @@ -19,4 +36,7 @@ WK.add({
{ "<leader>an", "<cmd>Augment chat-new<cr>", desc = "Start new conversation", },
{ "<leader>at", "<cmd>Augment chat-toggle<cr>", desc = "Toggle chat panel", },
{ "<leader>as", "<cmd>Augment status<cr>", desc = "Check Augment status", },
{ "<C-y>", accept_completion(), desc = "Accept Augment completion", mode = { "i", "s", }, },
{ "<C-cr>", accept_completion("\n"), desc = "Accept Augment completion (or newline)", mode = { "i", "s", }, },

})