From 247c9510cc46d4d70d3174808d09acb4ae5da4d3 Mon Sep 17 00:00:00 2001 From: Sean Herman Date: Sat, 9 Aug 2025 16:07:46 -0400 Subject: [PATCH] Tidy formatters (#20) --- .gitignore | 1 + lua/config/lazy.lua | 1 + lua/config/options.lua | 2 + lua/plugins/avante.lua | 124 ----------------------------------------- lua/plugins/format.lua | 12 ++-- lua/plugins/lsp.lua | 14 ++++- lua/plugins/mason.lua | 24 +++++++- 7 files changed, 46 insertions(+), 132 deletions(-) delete mode 100644 lua/plugins/avante.lua diff --git a/.gitignore b/.gitignore index cc5457a..f11e9dd 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ debug foo.* *.log data +.claude diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index 366b9b0..56fcc2a 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -26,6 +26,7 @@ require("lazy").setup({ { import = "lazyvim.plugins.extras.lang.go" }, { import = "lazyvim.plugins.extras.lang.ruby" }, { import = "lazyvim.plugins.extras.lang.python" }, + { import = "lazyvim.plugins.extras.lang.prisma" }, { import = "lazyvim.plugins.extras.lang.json" }, { import = "lazyvim.plugins.extras.lang.markdown" }, { import = "lazyvim.plugins.extras.lang.typescript" }, diff --git a/lua/config/options.lua b/lua/config/options.lua index 5cb9476..0b3f484 100644 --- a/lua/config/options.lua +++ b/lua/config/options.lua @@ -9,3 +9,5 @@ vim.g.lazyvim_python_lsp = "basedpyright" vim.g.lazyvim_python_ruff = "ruff" vim.opt.termguicolors = true + +vim.g.lazyvim_prettier_needs_config = true diff --git a/lua/plugins/avante.lua b/lua/plugins/avante.lua deleted file mode 100644 index ea1ad21..0000000 --- a/lua/plugins/avante.lua +++ /dev/null @@ -1,124 +0,0 @@ -local enabled = false --- stylua: ignore -if not enabled then return {} end - -return { - "yetone/avante.nvim", - event = "VeryLazy", - lazy = false, - version = "*", -- set this if you want to always pull the latest change - -- 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 = { - "stevearc/dressing.nvim", - "nvim-lua/plenary.nvim", - "MunifTanjim/nui.nvim", - --- The below dependencies are optional, - -- "hrsh7th/nvim-cmp", -- autocompletion for avante commands and mentions - "nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons - -- "zbirenbaum/copilot.lua", -- for providers='copilot' - { - -- 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" }, - }, - }, - - keys = { - { - "ax", - "AvanteClear", - desc = "avante: clear context window", - }, - }, - opts = function() - local config = { - provider = "claude", - auto_suggestions_provider = "claude", - behaviour = { - auto_suggestions = false, - auto_set_highlight_group = true, - auto_set_keymaps = true, - enable_cursor_planning_mode = true, - }, - claude = { - endpoint = "https://api.anthropic.com", - model = "claude-3-7-sonnet-latest", - temperature = 0, - max_tokens = 4096, - }, - openai = { - endpoint = "https://api.openai.com/v1", - model = "gpt-4o", - temperature = 0, - max_tokens = 4096, - }, - ollama = { - model = "qwen2.5-coder:7b", - }, - -- vendors = { - -- groq = { -- define groq provider - -- __inherited_from = "openai", - -- endpoint = "https://api.groq.com/openai/v1/", - -- -- model = "llama-3.3-70b-versatile", - -- model = "qwen-2.5-coder-32b", - -- max_tokens = 32768, - -- }, - -- ollama = { - -- __inherited_from = "openai", - -- api_key_name = "", - -- endpoint = "http://127.0.0.1:11434/v1", - -- model = "qwen2.5-coder:7b", - -- -- model = "codellama:7b", - -- -- model = "deepseek-r1:7b", - -- }, - -- }, - file_selector = { - provider = "fzf", - provider_opts = {}, - }, - compat = { - "avante_commands", - "avante_mentions", - "avante_files", - }, - suggestion = { - debounce = 600, - throttle = 600, - }, - windows = { - position = "right", - width = 30, - }, - } - - -- if vim.fn.executable("ollama") == 1 then - -- config.provider = "ollama" - -- config.auto_suggestions_provider = "ollama" - -- config.behaviour.auto_suggestions = true - -- end - - return config - end, -} diff --git a/lua/plugins/format.lua b/lua/plugins/format.lua index 32e27ed..bd998a2 100644 --- a/lua/plugins/format.lua +++ b/lua/plugins/format.lua @@ -13,12 +13,12 @@ return { formatters_by_ft = { nix = { "nixfmt" }, lua = { "stylua" }, - javascript = { "prettierd" }, - javascriptreact = { "prettierd" }, - typescript = { "prettierd" }, - typescriptreact = { "prettierd" }, - json = { "jq" }, - jsonc = { "jq" }, + javascript = { "prettier" }, + javascriptreact = { "prettier" }, + typescript = { "prettier" }, + typescriptreact = { "prettier" }, + json = { "fixjson" }, + jsonc = { "fixjson" }, yaml = { "yamlfix" }, markdown = { "markdownlint" }, ["markdown.mdx"] = { "markdownlint" }, diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index e923ba5..cac86c5 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -12,11 +12,23 @@ return { root_dir = require("lspconfig").util.root_pattern("tailwind.config.js", "tailwind.config.ts"), }, rubocop = { enabled = false }, + oxlint = { + root_dir = require("lspconfig").util.root_pattern(".oxlintrc.json"), + }, ruby_lsp = { mason = false, - cmd = { "bundle", "exec", "ruby-lsp" }, + setup = function() + local cmd = vim.fn.executable("ruby-lsp") == 1 and { "ruby-lsp" } or { "bundle", "exec", "ruby-lsp" } + require("lspconfig").ruby_lsp.setup({ cmd = cmd, mason = false }) + return true -- prevent default setup + end, }, }, }, }, + { + "b0o/SchemaStore.nvim", + lazy = true, + version = false, -- last release is way too old + }, } diff --git a/lua/plugins/mason.lua b/lua/plugins/mason.lua index d813b11..a82ef96 100644 --- a/lua/plugins/mason.lua +++ b/lua/plugins/mason.lua @@ -6,6 +6,8 @@ return { PATH = "append", ensure_installed = { "marksman", + "yamlls", + "jsonls", }, }, }, @@ -14,7 +16,27 @@ return { "mason-org/mason.nvim", opts = { ensure_installed = { - "markdownlint-cli2", + "oxlint", + "nil", + "markdownlint", + "fixjson", + "prettierd", + "nixfmt", + "yamlfix", + }, + }, + }, + { + "nvim-lspconfig", + opts = { + servers = { + vtsls = { + preferences = { + -- importModuleSpecifier = "relative", + importModuleSpecifier = "non-relative", + importModuleSpecifierEnding = "minimal", + }, + }, }, }, },