From c4c6d8b4d127caa6db17807d032261331abbf820 Mon Sep 17 00:00:00 2001 From: He4eT Date: Sat, 6 Jan 2024 08:51:34 +0100 Subject: [PATCH] nvim: ollama: add custom prompts --- nvim/init.lua | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/nvim/init.lua b/nvim/init.lua index 96fd9be..0eaadf4 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -136,14 +136,34 @@ require('lazy').setup({ keys = { { 'j', - ":lua require('ollama').prompt()", + ":Ollama", desc = 'ollama prompt', - mode = { 'n', 'v' }, + mode = { 'v' }, }, }, opts = { model = 'mistral', url = 'http://ollama.internal:11434', + prompts = { + Ask_About_Code = false, + Simplify_Code = false, + Improve_Text = { + prompt = "Make this text simple and readable. Respond with improved version of this text: ```$sel```", + extract = false, + action = "replace", + }, + Modify_Text = { + prompt = "Modify this text in the following way: $input\n\n" + .. "```$sel```", + extract = false, + action = "replace", + }, + Use_selection_as_prompt = { + prompt = "$sel", + extract = false, + action = "replace", + }, + }, }, }, }, {