+lazygit.nvim
This commit is contained in:
parent
9be26c1072
commit
64ce6b18c1
@ -827,57 +827,36 @@ require('lazy').setup({
|
||||
{
|
||||
'direnv/direnv.vim',
|
||||
},
|
||||
|
||||
{
|
||||
'David-Kunz/gen.nvim',
|
||||
opts = {
|
||||
model = 'dolphin-llama3:latest', -- 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 = 'float', -- 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 = true, -- Prints errors and the command which is run.
|
||||
"kdheepak/lazygit.nvim",
|
||||
lazy = true,
|
||||
cmd = {
|
||||
"LazyGit",
|
||||
"LazyGitConfig",
|
||||
"LazyGitCurrentFile",
|
||||
"LazyGitFilter",
|
||||
"LazyGitFilterCurrentFile",
|
||||
},
|
||||
config = function()
|
||||
require('gen').prompts['Fix_Code'] = {
|
||||
prompt = 'Fix the following code. Only ouput the result in format ```$filetype\n...\n```:\n```$filetype\n$text\n```',
|
||||
replace = true,
|
||||
extract = '```$filetype\n(.-)```',
|
||||
model = 'codellama:latest',
|
||||
}
|
||||
require('gen').prompts['Enhance_Code'] = {
|
||||
prompt = 'Fix the following code. Only ouput the result in format ```$filetype\n...\n```:\n```$filetype\n$text\n```',
|
||||
replace = true,
|
||||
extract = '```$filetype\n(.-)```',
|
||||
model = 'codellama:latest',
|
||||
}
|
||||
Review_Code = {
|
||||
prompt = 'Review the following code and make concise suggestions:\n```$filetype\n$text\n```',
|
||||
model = 'codellama:latest',
|
||||
}
|
||||
end,
|
||||
vim.keymap.set('n', '<leader>lo', vim.cmd.Gen, { desc = '[O]llama AI' }),
|
||||
-- optional for floating window border decoration
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
-- setting the keybinding for LazyGit with 'keys' is recommended in
|
||||
-- order to load the plugin when the command is run for the first time
|
||||
keys = {
|
||||
{ "<leader>lg", "<cmd>LazyGit<cr>", desc = "LazyGit" }
|
||||
}
|
||||
}, {
|
||||
"olimorris/codecompanion.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"hrsh7th/nvim-cmp", -- Optional: For using slash commands and variables in the chat buffer
|
||||
"nvim-telescope/telescope.nvim", -- Optional: For using slash commands
|
||||
{ "stevearc/dressing.nvim", opts = {} }, -- Optional: Improves `vim.ui.select`
|
||||
},
|
||||
config = true
|
||||
},
|
||||
{
|
||||
'folke/noice.nvim',
|
||||
event = 'VeryLazy',
|
||||
|
Loading…
x
Reference in New Issue
Block a user