Commit ai and markdown and init lua cleanup

This commit is contained in:
marctalcott 2024-12-04 19:23:14 -05:00
parent 3fb8c2f77f
commit adce533558
3 changed files with 47 additions and 2 deletions

View File

@ -182,7 +182,6 @@ vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' }
-- vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>')
-- vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>')
-- Keybinds to make split navigation easier.
-- Use CTRL+<hjkl> to switch between windows
--
-- See `:help wincmd` for a list of all window commands
@ -242,7 +241,6 @@ vim.opt.rtp:prepend(lazypath)
--
-- NOTE: Here is where you install your plugins.
require('lazy').setup 'plugins'
-- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et
--

36
lua/plugins/gennvim.lua Normal file
View File

@ -0,0 +1,36 @@
return {
'David-Kunz/gen.nvim',
opts = {
model = 'llama3.2', -- The default model to use.
quit_map = 'q', -- set keymap to close the response window
retry_map = '<c-r>', -- set keymap to re-send the current prompt
accept_map = '<c-cr>', -- set keymap to replace the previous selection with the last result
host = 'localhost', -- The host running the Ollama service.
port = '11434', -- The port on which the Ollama service is listening.
display_mode = 'split', -- The display mode. Can be "float" or "split" or "horizontal-split".
show_prompt = false, -- Shows the prompt submitted to Ollama.
show_model = false, -- Displays which model you are using at the beginning of your chat session.
no_auto_close = false, -- Never closes the window automatically.
file = false, -- Write the payload to a temporary file to keep the command short.
hidden = false, -- Hide the generation window (if true, will implicitly set `prompt.replace = true`), requires Neovim >= 0.10
init = function(options)
pcall(io.popen, 'ollama serve > /dev/null 2>&1 &')
end,
-- Function to initialize Ollama
command = function(options)
local body = { model = options.model, stream = true }
return 'curl --silent --no-buffer -X POST http://' .. options.host .. ':' .. options.port .. '/api/chat -d $body'
end,
-- The command for the Ollama service. You can use placeholders $prompt, $model and $body (shellescaped).
-- This can also be a command string.
-- The executed command must return a JSON object with { response, context }
-- (context property is optional).
-- list_models = '<omitted lua function>', -- Retrieves a list of model names
debug = false, -- Prints errors and the command which is run.
opts = function()
require('gen').prompts['Review_Code'] = {
prompt = 'Review the following code and make concise suggestions:\n```$filetype\n$text\n```',
}
end,
},
}

View File

@ -0,0 +1,11 @@
return {
{
'MeanderingProgrammer/render-markdown.nvim',
dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.nvim' }, -- if you use the mini.nvim suite
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.icons' }, -- if you use standalone mini plugins
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons
---@module 'render-markdown'
---@type render.md.UserConfig
opts = {},
},
}