From eb4b1e78e3d41681bde950a0780ae91a1c4cf2ef Mon Sep 17 00:00:00 2001 From: He4eT Date: Sat, 6 Jan 2024 08:51:13 +0100 Subject: [PATCH] nvim: replace codium with ollama --- nvim/init.lua | 42 +++++++++++++++++------------------------- 1 file changed, 17 insertions(+), 25 deletions(-) diff --git a/nvim/init.lua b/nvim/init.lua index b997ef8..96fd9be 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -128,31 +128,23 @@ require('lazy').setup({ build = ':TSUpdate', }, { - 'Exafunction/codeium.vim', - keys = { { '', mode = 'i' } }, - config = function() - vim.g.codeium_manual = 1 - vim.g.codeium_disable_bindings = 1 - vim.keymap.set('i', '', function() - return vim.fn['codeium#Complete']() - end, { expr = true }) - vim.keymap.set('i', '', function() - return vim.fn['codeium#Accept']() - end, { expr = true }) - vim.keymap.set('i', '', function() - return vim.fn['codeium#Clear']() - end, { expr = true }) - - vim.keymap.set('i', '', function() - vim.fn['codeium#CycleCompletions'](1) - print(vim.fn['codeium#GetStatusString']()) - end, { expr = true }) - - vim.keymap.set('i', '', function() - vim.fn['codeium#CycleCompletions'](-1) - print(vim.fn['codeium#GetStatusString']()) - end, { expr = true }) - end, + 'nomnivore/ollama.nvim', + dependencies = { + 'nvim-lua/plenary.nvim', + }, + cmd = { 'Ollama', 'OllamaModel' }, + keys = { + { + 'j', + ":lua require('ollama').prompt()", + desc = 'ollama prompt', + mode = { 'n', 'v' }, + }, + }, + opts = { + model = 'mistral', + url = 'http://ollama.internal:11434', + }, }, }, { -- Lazy options