diff --git a/nvim/lua/olinpin/plugins/avante.lua b/nvim/lua/olinpin/plugins/avante.lua index 1aff690..fb1e17b 100644 --- a/nvim/lua/olinpin/plugins/avante.lua +++ b/nvim/lua/olinpin/plugins/avante.lua @@ -1,104 +1,104 @@ -return { - "yetone/avante.nvim", - event = "VeryLazy", - lazy = false, - config = function(_, opts) - require("avante").setup(opts) - -- Then remove the default mappings - vim.schedule(function() - vim.keymap.del({ "n", "v" }, "aa") - vim.keymap.del("n", "ar") - vim.keymap.del("v", "ae") - vim.keymap.del("n", "ah") - vim.keymap.del("n", "ad") - vim.keymap.del("n", "af") - vim.keymap.del("n", "aR") - vim.keymap.del("n", "as") - vim.keymap.del("n", "at") - vim.keymap.del("n", "a?") - vim.keymap.del("n", "aB") - vim.keymap.del("n", "aS") - vim.keymap.del("n", "an") - vim.keymap.del("n", "aC") - vim.keymap.del("n", "az") - end) - end, - opts = { - -- add any opts here - provider = "copilot", - providers = { - copilot = { - model = "claude-sonnet-4", - -- max_tokens = 4096, - }, - }, - system_prompt = function() - local hub = require("mcphub").get_hub_instance() - return hub and hub:get_active_servers_prompt() or "" - end, - -- Using function prevents requiring mcphub before it's loaded - custom_tools = function() - return { - require("mcphub.extensions.avante").mcp_tool(), - } - end, - }, - build = "make", - keys = { - { - "ca", - function() - require("avante.api").ask() - end, - desc = "avante: ask", - mode = { "n", "v" }, - }, - { - "cr", - function() - require("avante.api").refresh() - end, - desc = "avante: refresh", - }, - { - "ce", - function() - require("avante.api").edit() - end, - desc = "avante: edit", - mode = "v", - }, - { - "ch", - function() - require("avante.api").hint() - end, - desc = "avante: hint", - mode = "n", - }, - { - "cd", - function() - require("avante.api").debug() - end, - desc = "avante: debug", - mode = "n", - }, - }, - dependencies = { - "stevearc/dressing.nvim", - "nvim-lua/plenary.nvim", - "MunifTanjim/nui.nvim", - --- The below dependencies are optional, - -- "nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons - { - -- Make sure to setup it properly if you have lazy=true - "MeanderingProgrammer/render-markdown.nvim", - -- "zbirenbaum/copilot.lua", -- for providers='copilot' - opts = { - file_types = { "markdown", "Avante" }, - }, - ft = { "markdown", "Avante" }, - }, - }, -} +return {} +-- "yetone/avante.nvim", +-- event = "VeryLazy", +-- lazy = false, +-- config = function(_, opts) +-- require("avante").setup(opts) +-- -- Then remove the default mappings +-- vim.schedule(function() +-- vim.keymap.del({ "n", "v" }, "aa") +-- vim.keymap.del("n", "ar") +-- vim.keymap.del("v", "ae") +-- vim.keymap.del("n", "ah") +-- vim.keymap.del("n", "ad") +-- vim.keymap.del("n", "af") +-- vim.keymap.del("n", "aR") +-- vim.keymap.del("n", "as") +-- vim.keymap.del("n", "at") +-- vim.keymap.del("n", "a?") +-- vim.keymap.del("n", "aB") +-- vim.keymap.del("n", "aS") +-- vim.keymap.del("n", "an") +-- vim.keymap.del("n", "aC") +-- vim.keymap.del("n", "az") +-- end) +-- end, +-- opts = { +-- -- add any opts here +-- provider = "copilot", +-- providers = { +-- copilot = { +-- model = "claude-sonnet-4", +-- -- max_tokens = 4096, +-- }, +-- }, +-- system_prompt = function() +-- local hub = require("mcphub").get_hub_instance() +-- return hub and hub:get_active_servers_prompt() or "" +-- end, +-- -- Using function prevents requiring mcphub before it's loaded +-- custom_tools = function() +-- return { +-- require("mcphub.extensions.avante").mcp_tool(), +-- } +-- end, +-- }, +-- build = "make", +-- keys = { +-- { +-- "ca", +-- function() +-- require("avante.api").ask() +-- end, +-- desc = "avante: ask", +-- mode = { "n", "v" }, +-- }, +-- { +-- "cr", +-- function() +-- require("avante.api").refresh() +-- end, +-- desc = "avante: refresh", +-- }, +-- { +-- "ce", +-- function() +-- require("avante.api").edit() +-- end, +-- desc = "avante: edit", +-- mode = "v", +-- }, +-- { +-- "ch", +-- function() +-- require("avante.api").hint() +-- end, +-- desc = "avante: hint", +-- mode = "n", +-- }, +-- { +-- "cd", +-- function() +-- require("avante.api").debug() +-- end, +-- desc = "avante: debug", +-- mode = "n", +-- }, +-- }, +-- dependencies = { +-- "stevearc/dressing.nvim", +-- "nvim-lua/plenary.nvim", +-- "MunifTanjim/nui.nvim", +-- --- The below dependencies are optional, +-- -- "nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons +-- { +-- -- Make sure to setup it properly if you have lazy=true +-- "MeanderingProgrammer/render-markdown.nvim", +-- -- "zbirenbaum/copilot.lua", -- for providers='copilot' +-- opts = { +-- file_types = { "markdown", "Avante" }, +-- }, +-- ft = { "markdown", "Avante" }, +-- }, +-- }, +-- } diff --git a/nvim/lua/olinpin/plugins/mason.lua b/nvim/lua/olinpin/plugins/mason.lua index 2734ee8..7352408 100644 --- a/nvim/lua/olinpin/plugins/mason.lua +++ b/nvim/lua/olinpin/plugins/mason.lua @@ -6,7 +6,6 @@ -- https://mason-registry.dev/registry/list local PACKAGES = { -- LSP - "angular-language-server", "ansible-language-server", "css-lsp", "cssmodules-language-server", @@ -186,9 +185,23 @@ return { }, }) - vim.lsp.config("ts_ls", { - on_attach = on_attach, + vim.lsp.config("ts_ls", { + on_attach = on_attach, capabilities = capabilities, + root_markers = { "tsconfig.json", "jsconfig.json", "package.json", ".git" }, + init_options = { + hostInfo = "neovim", + preferences = { + importModuleSpecifierPreference = "relative", + }, + }, + settings = { + typescript = { + preferences = { + importModuleSpecifierPreference = "relative", + }, + }, + }, }) vim.lsp.enable("ts_ls") @@ -196,6 +209,7 @@ return { vim.lsp.config("html", { on_attach = on_attach, capabilities = capabilities }) vim.lsp.config("cssls", { on_attach = on_attach, capabilities = capabilities }) vim.lsp.config("jsonls", { on_attach = on_attach, capabilities = capabilities }) + vim.lsp.enable("jsonls") vim.lsp.config("yamlls", { on_attach = on_attach, capabilities = capabilities }) vim.lsp.config("intelephense", { on_attach = on_attach, @@ -208,7 +222,15 @@ return { }, }, }) - vim.lsp.config("eslint", { on_attach = on_attach, capabilities = capabilities }) + vim.lsp.config("eslint", { + on_attach = on_attach, + capabilities = capabilities, + root_markers = { "eslint.config.js", ".eslintrc.js", ".eslintrc.json", ".eslintrc", "package.json" }, + settings = { + workingDirectories = { mode = "auto" }, + }, + }) + vim.lsp.enable("eslint") vim.lsp.config("vue_ls", { on_attach = on_attach, capabilities = capabilities, diff --git a/nvim/lua/olinpin/plugins/telescope.lua b/nvim/lua/olinpin/plugins/telescope.lua index 4ae4561..222f408 100644 --- a/nvim/lua/olinpin/plugins/telescope.lua +++ b/nvim/lua/olinpin/plugins/telescope.lua @@ -31,6 +31,7 @@ return { telescope.setup({ extensions = { smart_open = { + cwd_only = true, mappings = { i = { -- works around smart_open overriding ctrl-w keybind for deleting