nvchad/lua/plugins/init.lua
Paul Trowbridge 4e50224edf add <leader>fm formatter mapping, auto-install formatters via Mason
Mason now ensures stylua, sql-formatter, and mdformat on startup, and
pip-installs mdformat-gfm into mdformat's venv so GFM tables snap.
Also includes incidental theme switch to github_dark and lazy-lock bump.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-30 23:10:58 -04:00

126 lines
3.2 KiB
Lua

return {
-- Conform (formatter)
{
"stevearc/conform.nvim",
lazy = false,
cmd = { "ConformInfo", "ConformFormat" }, -- enables :ConformInfo before load
keys = {
{
"g+w",
function()
require("conform").format({ async = false, lsp_fallback = true })
end,
mode = "n",
desc = "Format file (Conform)",
},
},
config = function()
require("conform").setup(require "configs.conform")
end,
},
-- LSP
{
"neovim/nvim-lspconfig",
config = function()
require "configs.lspconfig"
end,
},
-- File explorer
{
"nvim-tree/nvim-tree.lua",
opts = require "configs.nvimtree",
},
-- Telescope
{
'nvim-telescope/telescope.nvim',
dependencies = { 'nvim-lua/plenary.nvim' },
config = function()
require "configs.telescope"
end
},
-- Treesitter
{
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
config = function()
require'nvim-treesitter.configs'.setup {
ensure_installed = { "markdown", "sql", "vim", "lua", "vimdoc", "html", "css" },
highlight = {
enable = true,
additional_vim_regex_highlighting = { "markdown" },
},
}
end,
},
-- Transparent
{
'xiyaowong/transparent.nvim',
lazy = false
},
-- Gitsigns with border configuration
{
"lewis6991/gitsigns.nvim",
opts = {
preview_config = {
border = "rounded", -- Options: "single", "double", "rounded", "solid", "shadow"
style = "minimal",
relative = "cursor",
row = 0,
col = 1,
},
},
},
-- Mason (to install formatters like pgformatter/sqlfluff)
{
"williamboman/mason.nvim",
cmd = { "Mason", "MasonInstall", "MasonUpdate" },
-- run on startup so a fresh-clone install pulls the tools below automatically
lazy = false,
config = function()
require("mason").setup()
local registry = require("mason-registry")
local ensure = { "stylua", "sql-formatter", "mdformat" }
-- Mason's `mdformat` ships without plugins; we need mdformat-gfm for
-- table-snapping. Pip-installs into Mason's mdformat venv if missing.
local function ensure_mdformat_gfm()
local venv = vim.fn.stdpath("data") .. "/mason/packages/mdformat/venv"
local pip = venv .. "/bin/pip"
if vim.fn.executable(pip) == 0 then return end
vim.fn.system({ pip, "show", "mdformat-gfm" })
if vim.v.shell_error ~= 0 then
vim.fn.system({ pip, "install", "--quiet", "mdformat-gfm" })
end
end
registry.refresh(function()
for _, name in ipairs(ensure) do
local ok, pkg = pcall(registry.get_package, name)
if ok and not pkg:is_installed() then
pkg:install():once("closed", function()
if name == "mdformat" then vim.schedule(ensure_mdformat_gfm) end
end)
end
end
vim.schedule(ensure_mdformat_gfm)
end)
end,
},
-- {
-- "nvim-treesitter/nvim-treesitter",
-- opts = {
-- ensure_installed = {
-- "vim", "lua", "vimdoc",
-- "html", "css"
-- },
-- },
-- },
}