nv/config/none-ls/none-ls.nix

91 lines
1.9 KiB
Nix
Raw Normal View History

2024-03-06 12:53:26 +00:00
{
plugins.none-ls = {
2024-03-06 12:59:28 +00:00
enable = false;
enableLspFormat = false;
2024-03-06 12:53:26 +00:00
updateInInsert = false;
onAttach = ''
function(client, bufnr)
if client.supports_method "textDocument/formatting" then
vim.api.nvim_clear_autocmds { group = augroup, buffer = bufnr }
vim.api.nvim_create_autocmd("BufWritePre", {
group = augroup,
buffer = bufnr,
callback = function()
vim.lsp.buf.format { bufnr = bufnr }
end,
})
end
end
'';
sources = {
code_actions = {
eslint_d.enable = true;
gitsigns.enable = true;
statix.enable = true;
};
diagnostics = {
checkstyle = {
enable = true;
};
statix = {
enable = true;
};
luacheck = {
enable = true;
};
flake8 = {
enable = true;
};
eslint_d = {
enable = true;
};
};
formatting = {
alejandra = {
enable = true;
};
prettier = {
enable = true;
withArgs = ''
{
extra_args = { "--no-semi", "--single-quote" },
}
'';
};
google_java_format = {
enable = true;
};
rustfmt = {
enable = true;
};
stylua = {
enable = true;
};
black = {
enable = true;
withArgs = ''
{
extra_args = { "--fast" },
}
'';
};
jq = {
enable = true;
};
};
};
};
# keymaps = [
# {
# mode = [ "n" "v" ];
# key = "<leader>cf";
# action = "<cmd>lua vim.lsp.buf.format()<cr>";
# options = {
# silent = true;
# desc = "Format";
# };
# }
# ];
}