feat(neovim): simplify formatting, add clang lsp and fmt, remove qml lsp
This commit is contained in:
@@ -21,27 +21,22 @@
|
||||
};
|
||||
settings = {
|
||||
default_format_opts.lsp_format = "fallback";
|
||||
format_on_save = ''
|
||||
function(bufnr)
|
||||
local disable_filetypes = { c = true, cpp = true }
|
||||
local lsp_format_opt
|
||||
if disable_filetypes[vim.bo[bufnr].filetype] then
|
||||
lsp_format_opt = 'never'
|
||||
else
|
||||
lsp_format_opt = 'fallback'
|
||||
end
|
||||
return {
|
||||
timeout_ms = 500,
|
||||
lsp_format = lsp_format_opt,
|
||||
}
|
||||
end
|
||||
'';
|
||||
format_on_save = {
|
||||
lsp_format = "fallback";
|
||||
timeout_ms = 500;
|
||||
};
|
||||
|
||||
formatters_by_ft = {
|
||||
c = [ "clang-format" ];
|
||||
lua = [ "stylua" ];
|
||||
nix = [ "nixfmt" ];
|
||||
python = [ "ruff" ];
|
||||
};
|
||||
|
||||
formatters.clang-format.prepend_args = [
|
||||
"--style=file"
|
||||
"--fallback-style=LLVM"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user