✨ feat(nvim): add gen.nvim extra
This commit is contained in:
parent
336245d67c
commit
6dfeeb0d01
2 changed files with 30 additions and 0 deletions
1
.config/nvim/.github/README.md
vendored
1
.config/nvim/.github/README.md
vendored
|
@ -46,6 +46,7 @@
|
||||||
- [tzachar/cmp-tabnine](https://github.com/tzachar/cmp-tabnine)
|
- [tzachar/cmp-tabnine](https://github.com/tzachar/cmp-tabnine)
|
||||||
- [jackMort/ChatGPT.nvim](https://dotfyle.com/plugins/jackMort/ChatGPT.nvim)
|
- [jackMort/ChatGPT.nvim](https://dotfyle.com/plugins/jackMort/ChatGPT.nvim)
|
||||||
- [zbirenbaum/copilot.lua](https://dotfyle.com/plugins/zbirenbaum/copilot.lua)
|
- [zbirenbaum/copilot.lua](https://dotfyle.com/plugins/zbirenbaum/copilot.lua)
|
||||||
|
- [David-Kunz/gen.nvim](https://dotfyle.com/plugins/David-Kunz/gen.nvim)
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
|
29
.config/nvim/lua/plugins/extras/coding/ai/gen.lua
Normal file
29
.config/nvim/lua/plugins/extras/coding/ai/gen.lua
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
return {
|
||||||
|
"jellydn/gen.nvim",
|
||||||
|
opts = {
|
||||||
|
model = "codellama",
|
||||||
|
display_mode = "split",
|
||||||
|
show_prompt = true,
|
||||||
|
show_model = true,
|
||||||
|
no_auto_close = false,
|
||||||
|
init = function(options)
|
||||||
|
pcall(io.popen, "ollama serve > /dev/null 2>&1 &")
|
||||||
|
end,
|
||||||
|
command = "curl --silent --no-buffer -X POST http://localhost:11434/api/generate -d $body",
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
local gen = require("gen")
|
||||||
|
gen.setup(opts)
|
||||||
|
|
||||||
|
gen.prompts["Elaborate_Text"] = {
|
||||||
|
prompt = "Elaborate the following text:\n$text",
|
||||||
|
}
|
||||||
|
gen.prompts["Fix_Code"] = {
|
||||||
|
prompt = "Fix the following code. Only output the result in format ```$filetype\n...\n```:\n```$filetype\n$text\n```",
|
||||||
|
extract = "```$filetype\n(.-)```",
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
keys = {
|
||||||
|
{ "<leader>i", "<cmd>Gen<cr>", mode = { "n", "v" }, desc = "IA (Gen)" },
|
||||||
|
},
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue