added a prompt2prompt for code companion and some other tweaks like return will complete the autocomplete

This commit is contained in:
lowell 2025-02-01 15:17:12 -05:00
parent 94b29a3de2
commit 836586ebc9
3 changed files with 21 additions and 5 deletions

View File

@ -29,10 +29,10 @@ vim.keymap.set('n', 'n', 'nzzzv', opts)
vim.keymap.set('n', 'N', 'Nzzzv', opts) vim.keymap.set('n', 'N', 'Nzzzv', opts)
-- Resize with arrows -- Resize with arrows
vim.keymap.set('n', '<Up>', ':resize -2<CR>', opts) vim.keymap.set('n', '<C-Up>', ':resize -2<CR>', opts)
vim.keymap.set('n', '<Down>', ':resize +2<CR>', opts) vim.keymap.set('n', '<C-Down>', ':resize +2<CR>', opts)
vim.keymap.set('n', '<Left>', ':vertical resize -2<CR>', opts) vim.keymap.set('n', '<C-Left>', ':vertical resize -2<CR>', opts)
vim.keymap.set('n', '<Right>', ':vertical resize +2<CR>', opts) vim.keymap.set('n', '<C-Right>', ':vertical resize +2<CR>', opts)
-- Buffers -- Buffers
vim.keymap.set('n', '<Tab>', ':bnext<CR>', opts) vim.keymap.set('n', '<Tab>', ':bnext<CR>', opts)

View File

@ -96,7 +96,7 @@ return { -- Autocompletion
-- If you prefer more traditional completion keymaps, -- If you prefer more traditional completion keymaps,
-- you can uncomment the following lines -- you can uncomment the following lines
--['<CR>'] = cmp.mapping.confirm { select = true }, ['<CR>'] = cmp.mapping.confirm { select = true },
--['<Tab>'] = cmp.mapping.select_next_item(), --['<Tab>'] = cmp.mapping.select_next_item(),
--['<S-Tab>'] = cmp.mapping.select_prev_item(), --['<S-Tab>'] = cmp.mapping.select_prev_item(),

View File

@ -5,6 +5,22 @@ return {
'nvim-treesitter/nvim-treesitter', 'nvim-treesitter/nvim-treesitter',
}, },
config = { config = {
prompt_library = {
['prompt2prompt'] = {
strategy = 'chat',
description = 'a prompt to get the LLM to help you create a prompt',
prompts = {
{
role = 'system',
content = 'You are a prompt engineer that knows exactly how to prompt LLMs for them to be most effective and helpful',
},
{
role = 'user',
content = ' I would like you to help me craft the best possible to achieve my goal. The prompt will be used by you, the LLM. You will follow the following process: 1. Your first response will be to ask me what the prompt should be about. I will provide my answer, but we will need to improve it through continual iterations by going through the next steps. 2. Based on my input, you will generate 2 sections, a) Revised prompt (provide your rewritten prompt, it should be clear, concise, and easily understood by you), b) Questions (ask any relevant questions pertaining to what additional information is needed from me to improve the prompt). 3. We will continue this iterative process with me providing additional information to you and you updating the prompt in the Revised prompt section until I say we are done.',
},
},
},
},
adapters = { adapters = {
llama3 = function() llama3 = function()
return require('codecompanion.adapters').extend('ollama', { return require('codecompanion.adapters').extend('ollama', {