Skip to content

Using the Prompt Library

There are numerous ways that the prompts defined in your prompt library can be used in CodeCompanion. You can invoke them via keymaps, the Action Palette, or slash commands in the chat buffer.

Keymaps

You can assign prompts from the prompt library to a keymap via the prompt function:

lua
vim.keymap.set("n", "<LocalLeader>d", function()
  require("codecompanion").prompt("docs")
end, { noremap = true, silent = true })

Where docs is the alias of the prompt.

Slash Commands

If your prompt library entries have an alias defined then you can invoke them using a slash command. In the cmd line :CodeCompanion /<alias> or /<alias> if you're in the chat buffer.

Released under the MIT License.