return { { "mason-org/mason.nvim", lazy = false, --cmd = { "Mason", "MasonInstall", "MasonUninstall", "MasonUpdate", "MasonUninstallAll", "MasonLog" }, opts = {}, }, { "nvim-treesitter/nvim-treesitter", lazy = false, build = ":TSUpdate", event = { "BufRead" }, opts = { sync_install = false, auto_install = true, highlight = { enable = true, -- disable for files bigger than 500KB disable = function(lang, buf) local max_filesize = 500 * 1024 -- 500 KB local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) if ok and stats and stats.size > max_filesize then return true end end, additional_vim_regex_highlighting = false, }, indent = { enable = true, }, ensure_installed = { "html", "javascript", "gdscript", "lua", "php", "rust", "python", "typescript", "vim", }, }, }, { "mason-org/mason-lspconfig.nvim", lazy = false, opts = { ensure_installed = { "rust_analyzer", "ruff", "biome", --"quick_lint_js", --"eslint", "html", "cssls", "sqls", "hyprls", "lua_ls", -- "pylyzer", "vimls", "ts_ls", }, automatic_enable = { true, rust_analyzer = false }, }, }, { "neovim/nvim-lspconfig", lazy = false, -- REQUIRED: tell lazy.nvim to start this plugin at startup dependencies = { -- main one { "ms-jpq/coq_nvim", branch = "coq", lazy = false }, -- 9000+ Snippets { "ms-jpq/coq.artifacts", branch = "artifacts", lazy = false }, -- lua & third party sources -- See https://github.com/ms-jpq/coq.thirdparty -- Need to **configure separately** --{ "ms-jpq/coq.thirdparty", branch = "3p", lazy = false }, -- - shell repl -- - nvim lua api -- - scientific calculator -- - comment banner -- - etc }, init = function() vim.g.coq_settings = { auto_start = true, -- if you want to start COQ at startup -- Your COQ settings here display = { statusline = { helo = false } }, -- disable greeting notification } end, config = function() vim.lsp.config( "rust_analyzer", coq.lsp_ensure_capabilities({ settings = { ["rust-analyzer"] = { imports = { granularity = { group = "module", }, prefix = "self", }, cargo = { buildScripts = { enable = true, }, }, procMacro = { enable = true, }, }, }, }) ) vim.lsp.config("gdscript", coq.lsp_ensure_capabilities({})) --vim.lsp.enable({ "lua_ls" }) vim.api.nvim_create_autocmd("LspAttach", { group = vim.api.nvim_create_augroup("UserLspConfig", {}), callback = function(ev) -- Enable completion triggered by vim.bo[ev.buf].omnifunc = "v:lua.vim.lsp.omnifunc" vim.keymap.set("n", "[d", vim.diagnostic.goto_prev) vim.keymap.set("n", "]d", vim.diagnostic.goto_next) vim.keymap.set("n", "le", vim.diagnostic.open_float) vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts) vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts) vim.keymap.set("n", "K", vim.lsp.buf.hover, opts) vim.keymap.set("n", "wa", vim.lsp.buf.add_workspace_folder, opts) vim.keymap.set("n", "wr", vim.lsp.buf.remove_workspace_folder, opts) vim.keymap.set("n", "F", function() vim.lsp.buf.format({ async = true }) end, opts) end, }) end, }, { "mfussenegger/nvim-lint", event = { "BufEnter", "InsertLeave" }, lazy = true, opts = { linters_by_ft = { cpp = { "cpplint" }, gdscript = { "gdlint" }, gitcommit = { "commitlint" }, lua = { "ast-grep" }, markdown = {}, fish = { "fish_lsp" }, sql = { "sqruff" }, python = { "ruff" }, r = { "r-languageserver" }, javascript = { "eslint" }, typescript = { "eslint" }, }, }, config = function() local lint = require("lint") vim.api.nvim_create_autocmd({ "BufEnter", "InsertLeave" }, { callback = function() lint.try_lint() end, }) end, }, -- supposedly faster formatter { "stevearc/conform.nvim", event = { "BufWritePost" }, keys = { { "i", function() require("conform").format({ async = true }) end, desc = "Auto format file with formatter, also on F3", }, { "F3", function() require("conform").format({ async = true }) end, mode = { "n", "i" }, desc = "Auto format file with formatter", }, }, opts = {}, config = { formatters_by_ft = { lua = { "stylua" }, rust = { "rustfmt", lsp_format = "fallback" }, -- Conform will run multiple formatters sequentially python = { "ruff", "autopep8", lsp_format = "fallback" }, gdscript = { "gdformat" }, bash = { "shellharden" }, javascript = { "biome" }, typescript = { "biome" }, r = { "air" }, -- how to make air use tabs not spaces css = { "ast-grep" }, html = { "ast-grep" }, -- sql = { "sqruff" }, json = { "biome" }, yaml = { "biome" }, vue = { "biome" }, }, format_on_save = { timeout_ms = 700, lsp_format = "fallback", }, log_level = vim.log.levels.WARNING, vim.api.nvim_create_autocmd({ "BufWritePost" }, { pattern = "*", callback = function(args) require("conform").format({ bufnr = args.buf }) end, }), function() require("conform").formatters.prettier = { inherit = true, command = "prettier", prepend_args = { "--tab-width", "4" }, } require("conform").formatters.biome = { command = "biome format", prepend_args = "--indent-width=4 --use-editorconfig=true", } require("conform").formatters.stylua = { prepend = "--column-width=80", } require("conform").formatters.gdformat = { command = "gdformat", prepend_args = { "--fast {%}" }, } end, }, }, { "nvim-treesitter/nvim-treesitter-textobjects", lazy = true, event = "BufRead" }, { "nvim-treesitter/nvim-treesitter-context", lazy = true, event = "BufRead", opts = { enable = true, -- Enable this plugin (Can be enabled/disabled later via commands) max_lines = 3, -- How many lines the window should span. Values <= 0 mean no limit. min_window_height = 35, -- Minimum editor window height to enable context. Values <= 0 mean no limit. line_numbers = true, lazy = true, multiline_threshold = 1, -- Maximum number of lines to show for a single context trim_scope = "outer", -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer' mode = "topline", -- Line used to calculate context. Choices: 'cursor', 'topline'. -- Separator between context and content. Should be a single character string, like '-'. -- When separator is set, the context will only show up when there are at least 2 lines above cursorline. separator = "—", zindex = 20, -- The Z-index of the context window on_attach = nil, -- (fun(buf: integer): boolean) return false to disable attaching }, }, { "jubnzv/virtual-types.nvim", lazy = false, }, }