feat(nvim): Replace formatter with conform

This commit is contained in:
Jalil David Salamé Messina 2024-03-02 21:27:50 +01:00
parent f872b0e054
commit d98afc2ee5
Signed by: jalil
GPG key ID: F016B9E770737A0B
2 changed files with 7 additions and 20 deletions

View file

@ -52,7 +52,6 @@ in
nvim-web-devicons
FTerm-nvim
cmp-cmdline
formatter-nvim
]);
# Formatting
extraPackages = with pkgs; [
@ -96,25 +95,6 @@ in
-- require("dressing").setup()
end
do -- Setup formatter.nvim
-- local util = require "formatter.util"
require("formatter").setup {
logging = true,
log_level = vim.log.levels.WARN,
["*"] = { require("formatter.filetypes.any").remove_trailing_whitespace },
-- Filetype Formatting
c = { require("formatter.filetypes.c").clangformat },
sh = { require("formatter.filetypes.sh").shfmt },
cpp = { require("formatter.filetypes.cpp").clangformat },
lua = { require("formatter.filetypes.lua").stylua },
nix = { require("formatter.filetypes.nix").nixpkgs_fmt },
zig = { require("formatter.filetypes.zig").zigfmt },
rust = { require("formatter.filetypes.rust").rustfmt },
toml = { require("formatter.filetypes.toml").taplo },
yaml = { require("formatter.filetypes.yaml").yamlfmt },
}
end
do -- Setup idris2-nvim
require("idris2").setup { }
end

View file

@ -144,4 +144,11 @@
lua = true;
options.desc = "Find Quickfix";
}
{
mode = "n";
key = "<leader>w";
action = "require'conform'.format";
lua = true;
options.desc = "Format buffer";
}
]