From 1656da45ad8ae7cec676571f02f740b5d3c30089 Mon Sep 17 00:00:00 2001 From: Alexander M Pickering Date: Tue, 27 May 2025 22:22:29 -0500 Subject: Add ollama prompts --- nvim/init.vim | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/nvim/init.vim b/nvim/init.vim index 28290e2..1b7fb4c 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -407,6 +407,49 @@ lua << EOF } EOF +lua << EOF +-- ollama.nvim integration +do + local function ollama_loaded() + return package.loaded.ollama and require("ollama").status ~= nil + end + local ollama_status = { + IDLE = "🦙", + WORKING = "🤖" + } + local function get_status_icon() + return ollama_status[require("ollama").status()] + end + require("lualine").setup({sections = {lualine_x = {get_status_icon, ollama_loaded}}}) + require("ollama").config.prompts.fgen = { + prompt = [[ +Generate $ftype code that follows this code, keep any comments: + +$sel + +Respond EXACTLY in this format: +```$ftype + +``` +]], + action = "insert" + } + require("ollama").config.prompts.extend= { + prompt = [[ +Change this $ftype code to $input, keep any comments: + +$sel + +Respond EXACTLY in this format: +```$ftype + +``` +]], + action = "display_replace" + } +end + +EOF " ollama.nvim - ai code assist -- cgit v1.2.3-70-g09d2