mirror of
https://github.com/akr2002/nv.git
synced 2024-11-09 10:39:44 +00:00
90 lines
1.9 KiB
Nix
90 lines
1.9 KiB
Nix
{
|
|
plugins.none-ls = {
|
|
enable = false;
|
|
enableLspFormat = false;
|
|
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";
|
|
# };
|
|
# }
|
|
# ];
|
|
}
|
|
|