55 lines
1.3 KiB
Lua
55 lines
1.3 KiB
Lua
local nonels_augroup = core.misc.augroup("nullls formatting")
|
|
|
|
return {
|
|
{ "mason-org/mason.nvim",
|
|
reqs = "neovim/nvim-lspconfig",
|
|
load = function()
|
|
require("mason").setup {
|
|
ui = {
|
|
-- not sure why these are nerdfont icons by default
|
|
icons = {
|
|
package_installed = "+",
|
|
package_pending = "?",
|
|
package_uninstalled = "x"
|
|
}
|
|
}
|
|
}
|
|
|
|
core.mason.ensure_installed()
|
|
end
|
|
},
|
|
|
|
{ "mfussenegger/nvim-jdtls",
|
|
reqs = "mfussenegger/nvim-dap"
|
|
},
|
|
|
|
{ "nvimtools/none-ls.nvim",
|
|
lazy = dep_short.ft("python"),
|
|
load = function()
|
|
local null_ls = require("null-ls")
|
|
|
|
null_ls.setup {
|
|
sources = {
|
|
null_ls.builtins.formatting.black
|
|
},
|
|
|
|
on_attach = function(client, bufnr)
|
|
if client:supports_method("textDocument/formatting") then
|
|
vim.api.nvim_clear_autocmds({
|
|
group = nonels_augroup,
|
|
buffer = bufnr
|
|
})
|
|
core.misc.auto("BufWritePre", {
|
|
group = nonels_augroup,
|
|
buffer = bufnr,
|
|
callback = function()
|
|
vim.lsp.buf.format({ bufnr = bufnr })
|
|
end
|
|
})
|
|
end
|
|
end
|
|
}
|
|
end
|
|
}
|
|
}
|