Skip to content

Commit adce533

Browse files
committed
Commit ai and markdown and init lua cleanup
1 parent 3fb8c2f commit adce533

File tree

3 files changed

+47
-2
lines changed

3 files changed

+47
-2
lines changed

init.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' }
182182
-- vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>')
183183
-- vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>')
184184

185-
-- Keybinds to make split navigation easier.
186185
-- Use CTRL+<hjkl> to switch between windows
187186
--
188187
-- See `:help wincmd` for a list of all window commands
@@ -242,7 +241,6 @@ vim.opt.rtp:prepend(lazypath)
242241
--
243242
-- NOTE: Here is where you install your plugins.
244243
require('lazy').setup 'plugins'
245-
246244
-- The line beneath this is called `modeline`. See `:help modeline`
247245
-- vim: ts=2 sts=2 sw=2 et
248246
--

lua/plugins/gennvim.lua

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

lua/plugins/markdownnvim.lua

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
return {
2+
{
3+
'MeanderingProgrammer/render-markdown.nvim',
4+
dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.nvim' }, -- if you use the mini.nvim suite
5+
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.icons' }, -- if you use standalone mini plugins
6+
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons
7+
---@module 'render-markdown'
8+
---@type render.md.UserConfig
9+
opts = {},
10+
},
11+
}

0 commit comments

Comments
 (0)