nvim/lua/plugins/null-ls.lua

33 lines
638 B
Lua
Raw Normal View History

2024-07-28 15:50:04 +00:00
return {
"nvimtools/none-ls.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
opts = function()
local null_ls = require("null-ls")
null_ls.setup({
sources = {
null_ls.builtins.formatting.black,
2024-08-25 15:21:16 +00:00
null_ls.builtins.formatting.nixfmt,
null_ls.builtins.formatting.stylua,
null_ls.builtins.formatting.prettier
2024-07-28 15:50:04 +00:00
},
})
end,
keys = {
{
"<leader>lf",
function()
vim.lsp.buf.format()
end,
desc = "Format file",
},
{
"<leader>a",
function()
vim.lsp.buf.code_action()
end,
desc = "Code action",
},
},
}