1
Fork 0
satellite/dotfiles/neovim/lua/my/plugins/null-ls.lua

28 lines
704 B
Lua
Raw Normal View History

2022-12-27 20:45:43 +01:00
local env = require("my.helpers.env")
2022-03-09 19:44:21 +01:00
2022-12-27 20:45:43 +01:00
local M = {
"jose-elias-alvarez/null-ls.nvim", -- generic language server
event = "BufReadPre",
dependencies = "neovim/nvim-lspconfig",
cond = env.vscode.not_active(),
}
2022-02-22 21:52:01 +01:00
2022-12-27 20:45:43 +01:00
function M.config()
local lspconfig = require("my.plugins.lspconfig")
2022-10-09 03:28:51 +02:00
local null_ls = require("null-ls")
2022-02-23 14:52:27 +01:00
2022-10-09 03:28:51 +02:00
local sources = {
2022-12-26 20:07:10 +01:00
null_ls.builtins.formatting.prettierd.with({ extra_filetypes = {} }), -- format ts files
null_ls.builtins.formatting.stylua.with({}), -- format lua code
2022-12-27 20:45:43 +01:00
-- null_ls.builtins.formatting.lua_format.with({}), -- format lua code
2022-10-09 03:28:51 +02:00
}
null_ls.setup({
2022-11-14 01:16:10 +01:00
sources = sources,
on_attach = lspconfig.on_attach,
2022-12-26 20:07:10 +01:00
debug = true,
2022-11-14 01:16:10 +01:00
})
2022-02-22 21:52:01 +01:00
end
return M