Compare commits

..

No commits in common. "fea59fd13381d70d47c025ffee98ac4224f0761d" and "9452693037960f28f00c4df74691eb418957cf6a" have entirely different histories.

4 changed files with 52 additions and 63 deletions

View file

@ -48,7 +48,7 @@ else
vim.o.breakindent = true vim.o.breakindent = true
-- smart indenting -- smart indenting
vim.o.smartindent = true vim.o.smartindent = false
-- Save undo history -- Save undo history
vim.o.undofile = true vim.o.undofile = true
@ -90,7 +90,7 @@ else
-- sets the tab size for json files -- sets the tab size for json files
vim.api.nvim_create_autocmd("FileType", { vim.api.nvim_create_autocmd("FileType", {
pattern = { "json", "lua", "nix" }, pattern = "json",
callback = function() callback = function()
vim.bo.tabstop = 2 vim.bo.tabstop = 2
vim.bo.shiftwidth = 2 vim.bo.shiftwidth = 2

View file

@ -1,48 +0,0 @@
return {
"yetone/avante.nvim",
event = "VeryLazy",
lazy = false,
version = false, -- set this if you want to always pull the latest change
opts = {
provider = "openai",
openai = {
api_key_name = "cmd:cat ~/.openai",
},
},
-- if you want to build from source then do `make BUILD_FROM_SOURCE=true`
build = "make",
-- build = "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" -- for windows
dependencies = {
"nvim-treesitter/nvim-treesitter",
"stevearc/dressing.nvim",
"nvim-lua/plenary.nvim",
"MunifTanjim/nui.nvim",
--- The below dependencies are optional,
"nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons
{
-- support for image pasting
"HakonHarnes/img-clip.nvim",
event = "VeryLazy",
opts = {
-- recommended settings
default = {
embed_image_as_base64 = false,
prompt_for_file_name = false,
drag_and_drop = {
insert_mode = true,
},
-- required for Windows users
use_absolute_path = true,
},
},
},
{
-- Make sure to set this up properly if you have lazy=true
"MeanderingProgrammer/render-markdown.nvim",
opts = {
file_types = { "markdown", "Avante" },
},
ft = { "markdown", "Avante" },
},
},
}

48
lua/plugins/gen.lua Normal file
View file

@ -0,0 +1,48 @@
return {
"David-Kunz/gen.nvim",
lazy = true,
keys = {
{ "<leader>ai", ":Gen<CR>", mode = { "n", "v" }, desc = "AI tools using Ollama" },
{ "<leader>aa", ":Gen Ask<CR>", mode = { "n", "v" }, desc = "[A]I [A]sk" },
{
"<leader>am",
function()
require("gen").select_model()
end,
mode = { "n", "v" },
desc = "Select [A]I [m]odel",
},
},
config = function()
require("gen").setup({
{
model = "codellama",
host = "localhost",
port = "11434",
quit_map = "q",
retry_map = "<c-r>",
init = function(options)
pcall(io.popen, "ollama serve > /dev/null 2>&1 &")
end,
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,
display_mode = "split", -- "split" or "float"
show_prompt = true,
show_model = true,
no_auto_close = false,
debug = false,
},
})
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(.-)```",
}
end,
}

View file

@ -4,12 +4,7 @@ return {
-- build = function() -- build = function()
-- pcall(require("nvim-treesitter.install").update({ with_sync = true })) -- pcall(require("nvim-treesitter.install").update({ with_sync = true }))
-- end, -- end,
dependencies = { dependencies = { "nvim-treesitter/nvim-treesitter-textobjects", "nvim-treesitter/playground" },
"nvim-treesitter/nvim-treesitter-context",
"nvim-treesitter/nvim-treesitter-refactor",
"nvim-treesitter/nvim-treesitter-textobjects",
"nvim-treesitter/playground",
},
config = function() config = function()
require("nvim-treesitter.configs").setup({ require("nvim-treesitter.configs").setup({
-- Add languages to be installed here that you want installed for treesitter -- Add languages to be installed here that you want installed for treesitter
@ -63,13 +58,7 @@ return {
auto_install = true, auto_install = true,
highlight = { enable = true }, highlight = { enable = true },
indent = { indent = { enable = true },
enable = true,
disable = {
"python",
"css",
},
},
incremental_selection = { incremental_selection = {
enable = true, enable = true,
keymaps = { keymaps = {