diff --git a/init.lua b/init.lua index 479f1b3..97c23c0 100644 --- a/init.lua +++ b/init.lua @@ -48,7 +48,7 @@ else vim.o.breakindent = true -- smart indenting - vim.o.smartindent = false + vim.o.smartindent = true -- Save undo history vim.o.undofile = true @@ -90,7 +90,7 @@ else -- sets the tab size for json files vim.api.nvim_create_autocmd("FileType", { - pattern = "json", + pattern = { "json", "lua", "nix" }, callback = function() vim.bo.tabstop = 2 vim.bo.shiftwidth = 2 diff --git a/lua/plugins/avante.lua b/lua/plugins/avante.lua new file mode 100644 index 0000000..e83cf4f --- /dev/null +++ b/lua/plugins/avante.lua @@ -0,0 +1,48 @@ +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" }, + }, + }, +} diff --git a/lua/plugins/gen.lua b/lua/plugins/gen.lua deleted file mode 100644 index 4a01257..0000000 --- a/lua/plugins/gen.lua +++ /dev/null @@ -1,48 +0,0 @@ -return { - "David-Kunz/gen.nvim", - lazy = true, - keys = { - { "ai", ":Gen", mode = { "n", "v" }, desc = "AI tools using Ollama" }, - { "aa", ":Gen Ask", mode = { "n", "v" }, desc = "[A]I [A]sk" }, - { - "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 = "", - 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, -} diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index cfc5538..4834476 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -4,7 +4,12 @@ return { -- build = function() -- pcall(require("nvim-treesitter.install").update({ with_sync = true })) -- end, - dependencies = { "nvim-treesitter/nvim-treesitter-textobjects", "nvim-treesitter/playground" }, + dependencies = { + "nvim-treesitter/nvim-treesitter-context", + "nvim-treesitter/nvim-treesitter-refactor", + "nvim-treesitter/nvim-treesitter-textobjects", + "nvim-treesitter/playground", + }, config = function() require("nvim-treesitter.configs").setup({ -- Add languages to be installed here that you want installed for treesitter @@ -58,7 +63,13 @@ return { auto_install = true, highlight = { enable = true }, - indent = { enable = true }, + indent = { + enable = true, + disable = { + "python", + "css", + }, + }, incremental_selection = { enable = true, keymaps = {