fix: conform-nvim option change

This commit is contained in:
xinyangli 2024-10-14 11:56:12 +08:00
parent c72cb643b4
commit 90a9302a0a
Signed by: xin
SSH key fingerprint: SHA256:UU5pRTl7NiLFJbWJZa+snLylZSXIz5rgHmwjzv8v4oE
2 changed files with 20 additions and 24 deletions

View file

@ -1,14 +1,21 @@
{ helpers, pkgs, ... }: {
{ helpers, pkgs, ... }:
{
plugins.conform-nvim = {
enable = true;
formatAfterSave = ''
{
format_after_save = {
lsp_format = "fallback",
},
}
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
'';
formattersByFt = {
formatters_by_ft = {
python = [ "black" ];
c = [ "clang-format" ];
cpp = [ "clang-format" ];