summaryrefslogtreecommitdiff
path: root/nvim/init.vim
diff options
context:
space:
mode:
authorAlexander M Pickering <alex@cogarr.net>2025-05-27 22:22:29 -0500
committerAlexander M Pickering <alex@cogarr.net>2025-05-27 22:22:29 -0500
commit1656da45ad8ae7cec676571f02f740b5d3c30089 (patch)
treecc0705d125b8eb3a0e90f576cd69e6898bf8c6b7 /nvim/init.vim
parentbcd1fb7de29722f719103cc6b06c1f3332d5f7bd (diff)
downloaddotfiles-1656da45ad8ae7cec676571f02f740b5d3c30089.tar.gz
dotfiles-1656da45ad8ae7cec676571f02f740b5d3c30089.tar.bz2
dotfiles-1656da45ad8ae7cec676571f02f740b5d3c30089.zip
Add ollama prompts
Diffstat (limited to 'nvim/init.vim')
-rw-r--r--nvim/init.vim43
1 files changed, 43 insertions, 0 deletions
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
+<your code>
+```
+]],
+ action = "insert"
+ }
+ require("ollama").config.prompts.extend= {
+ prompt = [[
+Change this $ftype code to $input, keep any comments:
+
+$sel
+
+Respond EXACTLY in this format:
+```$ftype
+<your code>
+```
+]],
+ action = "display_replace"
+ }
+end
+
+EOF
" ollama.nvim - ai code assist