add ollama pluigin

This commit is contained in:
Barak Michener 2024-06-14 12:38:14 -07:00
parent cc1b5ae9c7
commit 010f692b41
4 changed files with 43 additions and 22 deletions

View file

@ -2,18 +2,30 @@ require('lsp-progress').setup({
}) })
-- Define a function to check the status and return the corresponding icon
local function get_ollama_status()
local status = require("ollama").status()
if status == "IDLE" then
return ""
elseif status == "WORKING" then
return "OLLAMA BUSY"
end
end
local config = { local config = {
sections = { sections = {
lualine_c = { lualine_c = {
'filename', 'filename',
function() function()
return require('lsp-progress').progress() return require('lsp-progress').progress()
end, end,
}, },
lualine_x = { lualine_x = {
'filetype', 'filetype',
} get_ollama_status,
} }
}
} }
--local function ins_left(component) --local function ins_left(component)

View file

@ -0,0 +1,7 @@
require("ollama").setup({
model = "codellama",
url = "http://ollama.ollama.svc.k8s.barakmich.com",
serve = {
on_start = false,
},
})

View file

@ -342,17 +342,17 @@ require('trouble').setup {
jump = { "o", "<tab>" }, -- jump to the diagnostic or open / close folds jump = { "o", "<tab>" }, -- jump to the diagnostic or open / close folds
--open_split = { "<c-x>" }, -- open buffer in new split --open_split = { "<c-x>" }, -- open buffer in new split
--open_vsplit = { "<c-v>" }, -- open buffer in new vsplit --open_vsplit = { "<c-v>" }, -- open buffer in new vsplit
open_tab = {}, -- open buffer in new tab open_tab = {}, -- open buffer in new tab
jump_close = { "<cr>" }, -- jump to the diagnostic and close the list jump_close = { "<cr>" }, -- jump to the diagnostic and close the list
toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode
toggle_preview = "P", -- toggle auto_preview toggle_preview = "P", -- toggle auto_preview
hover = "K", -- opens a small popup with the full multiline message hover = "K", -- opens a small popup with the full multiline message
preview = "p", -- preview the diagnostic location preview = "p", -- preview the diagnostic location
close_folds = { "zM", "zm" }, -- close all folds close_folds = { "zM", "zm" }, -- close all folds
open_folds = { "zR", "zr" }, -- open all folds open_folds = { "zR", "zr" }, -- open all folds
toggle_fold = { "zA", "za" }, -- toggle fold of current file toggle_fold = { "zA", "za" }, -- toggle fold of current file
previous = "k", -- previous item previous = "k", -- previous item
next = "j" -- next item next = "j" -- next item
}, },
} }
@ -504,7 +504,7 @@ require 'nvim-treesitter.configs'.setup {
playground = { playground = {
enable = true, enable = true,
disable = {}, disable = {},
updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code
persist_queries = false, -- Whether the query persists across vim sessions persist_queries = false, -- Whether the query persists across vim sessions
keybindings = { keybindings = {
toggle_query_editor = 'o', toggle_query_editor = 'o',
@ -623,6 +623,7 @@ end
require("hoversplit").setup({}) require("hoversplit").setup({})
require("murdock") --require("murdock")
require("ollama_setup")
require("lir_setup") require("lir_setup")
require("lualine_setup") require("lualine_setup")

View file

@ -233,6 +233,7 @@ Plug 'nvim-lua/popup.nvim'
Plug 'nvim-lua/plenary.nvim' Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim' Plug 'nvim-telescope/telescope.nvim'
Plug 'sindrets/diffview.nvim' Plug 'sindrets/diffview.nvim'
Plug 'nomnivore/ollama.nvim'
Plug 'kyazdani42/nvim-web-devicons' " for file icons Plug 'kyazdani42/nvim-web-devicons' " for file icons
"Plug 'kyazdani42/nvim-tree.lua' "Plug 'kyazdani42/nvim-tree.lua'