From 1929a5322954b5f7571dfdc7a6e62bf7c175161c Mon Sep 17 00:00:00 2001 From: Jeremy Kaplan Date: Wed, 22 Oct 2025 16:16:42 -0400 Subject: [PATCH] neovim: Restore none-ls/null-ls for Prettier formatting --- neovim/lazy-lock.json | 1 + neovim/lua/plugins/ide.lua | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/neovim/lazy-lock.json b/neovim/lazy-lock.json index 0c9ee9f..fe304f8 100644 --- a/neovim/lazy-lock.json +++ b/neovim/lazy-lock.json @@ -12,6 +12,7 @@ "mason-lspconfig.nvim": { "branch": "main", "commit": "2304ff65ecc8cb2afc2484de3e2ed9a407edf0b9" }, "mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" }, "nerdtree": { "branch": "master", "commit": "690d061b591525890f1471c6675bcb5bdc8cdff9" }, + "none-ls.nvim": { "branch": "main", "commit": "a96172f673f720cd4f3572e1fcd08400ed3eb25d" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, "nvim-autopairs": { "branch": "master", "commit": "7a2c97cccd60abc559344042fefb1d5a85b3e33b" }, "nvim-cmp": { "branch": "main", "commit": "a7bcf1d88069fc67c9ace8a62ba480b8fe879025" }, diff --git a/neovim/lua/plugins/ide.lua b/neovim/lua/plugins/ide.lua index d807bc9..afafd11 100644 --- a/neovim/lua/plugins/ide.lua +++ b/neovim/lua/plugins/ide.lua @@ -396,6 +396,28 @@ return { }, -- LSP + { + "nvimtools/none-ls.nvim", + config = function(_plugin, opts) + local null_ls = require("null-ls") + + local group = vim.api.nvim_create_augroup("lsp_format_on_save", { clear = false }) + + local prettier_filetypes = {} + for k, v in ipairs(null_ls.builtins.formatting.prettier.filetypes) do + prettier_filetypes[k] = v + end + table.insert(prettier_filetypes, "htmldjango") -- Jinja templates + + null_ls.setup({ + sources = { + null_ls.builtins.formatting.prettier.with({ + filetypes = prettier_filetypes, + }), + }, + }) + end, + }, { "mrcjkb/rustaceanvim", version = '^6',