Finally, a way to actually browse your CodeCompanion prompts!
Stop memorizing prompt names or hunting through files. This plugin gives you a beautiful, fast picker with rich markdown previews that shows you exactly what each prompt does before you use it. Think Telescope for files, but for your AI prompts.
Perfect for:
Coming soon - screenshots of the beautiful prompt previews and selection UI
{
'3ZsForInsomnia/code-companion-picker.nvim',
dependencies = { 'folke/snacks.nvim' },
opts = {
picker = "snacks",
},
keys = {
{ "<leader>cp", "<cmd>CodeCompanionPrompts<cr>", desc = "Browse CodeCompanion Prompts" },
},
}
{
'3ZsForInsomnia/code-companion-picker.nvim',
dependencies = { 'nvim-telescope/telescope.nvim' },
opts = {
picker = "telescope",
},
keys = {
{ "<leader>cp", "<cmd>CodeCompanionPrompts<cr>", desc = "Browse CodeCompanion Prompts" },
},
}
Add this to your CodeCompanion config for in-chat slash command access:
{
strategies = {
chat = {
slash_commands = {
prompts = require("code-companion-picker").select_slash_command,
},
},
},
}
Then use /prompts in any CodeCompanion chat buffer to browse and insert prompts on the fly!
When you select a prompt:
Want to customize how prompt previews look? The plugin uses a composable rendering system where you can override individual sections or disable them entirely.
Quick example:
{
renderers = {
description = function(text, _)
return text and ("📋 " .. text) or nil
end,
current_system = false, -- disable showing current system prompt
model = function(model, _)
return model and ("🤖 " .. model) or nil
end,
}
}
📖 See the full customization guide →
The guide covers all 9 sections, advanced examples, and real-world configurations.
{
'3ZsForInsomnia/code-companion-picker.nvim',
opts = {
picker = "snacks", -- "snacks" or "telescope"
highlights = {
-- Customize syntax highlighting colors
yaml_key = { fg = "#79dac8", bold = true },
yaml_description = { fg = "#ff9e64" },
yaml_model = { fg = "#9d7cd8" },
system_header = { fg = "#f7768e", bold = true },
user_header = { fg = "#9ece6a", bold = true },
-- ... see source for all options
},
renderers = {
-- Customize how each section is rendered in the preview
description = function(text, _)
return text and ("📋 **Description:** " .. text) or nil
end,
model = function(model, _)
return model and ("🤖 **Model:** " .. model) or nil
end,
tools = function(tools_array, _)
return (#tools_array > 0) and ("🔧 **Tools:** " .. table.concat(tools_array, ", ")) or nil
end,
current_system = false, -- Disable showing current system prompt
-- Override other sections: opts, mode, context, system_prompt, user_prompt
},
}
}
Got VS Code prompts? Check out vs-code-companion - easily import your VS Code style prompts into CodeCompanion format. Perfect for migrating existing prompt libraries or sharing prompts between VS Code and Neovim!
The plugin exposes several functions for custom integrations:
local picker = require("code-companion-picker")
-- Get all prompts from CodeCompanion's prompt library
local prompts = picker.get_codecompanion_prompts()
-- Create display text for a prompt
local display = picker.create_prompt_display_text(prompt_info)
-- Convert prompt to markdown with custom renderers
local markdown = picker.codecompanion_to_markdown(prompt_data, prompt_name, custom_renderers)
-- Apply syntax highlighting to buffer
picker.apply_markdown_highlighting(bufnr, lines, highlights)
To add support for a new picker backend:
local picker = require("code-companion-picker")
local handlers = require("code-companion-picker.ui.handlers")
-- Get prompts
local prompts = picker.get_codecompanion_prompts()
-- Create your picker UI with the prompts
-- When user selects a prompt, call:
handlers.handle_prompt_selection(selected_prompt_info)
The handle_prompt_selection function handles all the complexity of applying prompts correctly based on their type and content.
Happy prompting! 🚀