fix: conform-nvim option change
This commit is contained in:
parent
c72cb643b4
commit
0df66b4ab6
2 changed files with 34 additions and 36 deletions
|
@ -1,26 +1,35 @@
|
|||
{ helpers, pkgs, ... }: {
|
||||
{ helpers, pkgs, ... }:
|
||||
{
|
||||
plugins.conform-nvim = {
|
||||
enable = true;
|
||||
formatAfterSave = ''
|
||||
{
|
||||
format_after_save = {
|
||||
lsp_format = "fallback",
|
||||
},
|
||||
}
|
||||
'';
|
||||
formattersByFt = {
|
||||
python = [ "black" ];
|
||||
c = [ "clang-format" ];
|
||||
cpp = [ "clang-format" ];
|
||||
cmake = [ "cmake_format" ];
|
||||
nix = [ "nixfmt" ];
|
||||
# Standalone scalafmt is too slow, so we use it as a fallback
|
||||
scala = helpers.mkRaw ''
|
||||
{ scalafmt, lsp_format = "prefer" }
|
||||
settings = {
|
||||
format_after_save = ''
|
||||
function(bufnr)
|
||||
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
|
||||
return
|
||||
end
|
||||
|
||||
if not slow_format_filetypes[vim.bo[bufnr].filetype] then
|
||||
return
|
||||
end
|
||||
|
||||
return { lsp_fallback = true }
|
||||
end
|
||||
'';
|
||||
toml = [ "taplo" ];
|
||||
yaml = [ "yq" ];
|
||||
json = [ "jq" ];
|
||||
formatters_by_ft = {
|
||||
python = [ "black" ];
|
||||
c = [ "clang-format" ];
|
||||
cpp = [ "clang-format" ];
|
||||
cmake = [ "cmake_format" ];
|
||||
nix = [ "nixfmt" ];
|
||||
# Standalone scalafmt is too slow, so we use it as a fallback
|
||||
scala = helpers.mkRaw ''
|
||||
{ scalafmt, lsp_format = "prefer" }
|
||||
'';
|
||||
toml = [ "taplo" ];
|
||||
yaml = [ "yq" ];
|
||||
json = [ "jq" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue