diff --git a/lua/plugins/none-ls.lua b/lua/plugins/none-ls.lua index 6e36b91..b014141 100644 --- a/lua/plugins/none-ls.lua +++ b/lua/plugins/none-ls.lua @@ -1,14 +1,26 @@ return { - "nvimtools/none-ls.nvim", - config = function() - local null_ls = require("null-ls") - null_ls.setup({ - sources = { - null_ls.builtins.formatting.beautysh, - null_ls.builtins.formatting.black, - null_ls.builtins.formatting.stylua, - }, - }) - vim.keymap.set("n", "fb", vim.lsp.buf.format, {}) - end, + "nvimtools/none-ls.nvim", + dependencies = { -- NEW ◀─ pulls in the extra sources + "nvimtools/none-ls-extras.nvim", + }, + + config = function () + local null_ls = require("null-ls") + + null_ls.setup({ + sources = { + -- Beautysh now lives in none-ls-extras + require("none-ls.formatting.beautysh"), + + -- the regular built-ins still work the same way + null_ls.builtins.formatting.black, + null_ls.builtins.formatting.stylua, + }, + }) + + -- optional: make the keymap async so it doesn't block the UI + vim.keymap.set("n", "fb", function() + vim.lsp.buf.format({ async = true }) + end, {}) + end, } diff --git a/lua/plugins/none-ls.lua b/lua/plugins/none-ls.lua index 6e36b91..b014141 100644 --- a/lua/plugins/none-ls.lua +++ b/lua/plugins/none-ls.lua @@ -1,14 +1,26 @@ return { - "nvimtools/none-ls.nvim", - config = function() - local null_ls = require("null-ls") - null_ls.setup({ - sources = { - null_ls.builtins.formatting.beautysh, - null_ls.builtins.formatting.black, - null_ls.builtins.formatting.stylua, - }, - }) - vim.keymap.set("n", "fb", vim.lsp.buf.format, {}) - end, + "nvimtools/none-ls.nvim", + dependencies = { -- NEW ◀─ pulls in the extra sources + "nvimtools/none-ls-extras.nvim", + }, + + config = function () + local null_ls = require("null-ls") + + null_ls.setup({ + sources = { + -- Beautysh now lives in none-ls-extras + require("none-ls.formatting.beautysh"), + + -- the regular built-ins still work the same way + null_ls.builtins.formatting.black, + null_ls.builtins.formatting.stylua, + }, + }) + + -- optional: make the keymap async so it doesn't block the UI + vim.keymap.set("n", "fb", function() + vim.lsp.buf.format({ async = true }) + end, {}) + end, } diff --git a/lua/plugins/none-ls.lua.old b/lua/plugins/none-ls.lua.old new file mode 100644 index 0000000..6e36b91 --- /dev/null +++ b/lua/plugins/none-ls.lua.old @@ -0,0 +1,14 @@ +return { + "nvimtools/none-ls.nvim", + config = function() + local null_ls = require("null-ls") + null_ls.setup({ + sources = { + null_ls.builtins.formatting.beautysh, + null_ls.builtins.formatting.black, + null_ls.builtins.formatting.stylua, + }, + }) + vim.keymap.set("n", "fb", vim.lsp.buf.format, {}) + end, +}