feat(neovim): simplify formatting, add clang lsp and fmt, remove qml lsp
This commit is contained in:
@@ -21,27 +21,22 @@
|
|||||||
};
|
};
|
||||||
settings = {
|
settings = {
|
||||||
default_format_opts.lsp_format = "fallback";
|
default_format_opts.lsp_format = "fallback";
|
||||||
format_on_save = ''
|
format_on_save = {
|
||||||
function(bufnr)
|
lsp_format = "fallback";
|
||||||
local disable_filetypes = { c = true, cpp = true }
|
timeout_ms = 500;
|
||||||
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
|
|
||||||
'';
|
|
||||||
|
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
|
c = [ "clang-format" ];
|
||||||
lua = [ "stylua" ];
|
lua = [ "stylua" ];
|
||||||
nix = [ "nixfmt" ];
|
nix = [ "nixfmt" ];
|
||||||
python = [ "ruff" ];
|
python = [ "ruff" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
formatters.clang-format.prepend_args = [
|
||||||
|
"--style=file"
|
||||||
|
"--fallback-style=LLVM"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -51,13 +51,7 @@
|
|||||||
installCargo = false;
|
installCargo = false;
|
||||||
installRustc = false;
|
installRustc = false;
|
||||||
};
|
};
|
||||||
qmlls = {
|
clangd.enable = true;
|
||||||
enable = true;
|
|
||||||
cmd = [
|
|
||||||
"qmlls"
|
|
||||||
"-E"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user