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 nvim-web-devicons
FTerm-nvim FTerm-nvim
cmp-cmdline cmp-cmdline
formatter-nvim
]); ]);
# Formatting # Formatting
extraPackages = with pkgs; [ extraPackages = with pkgs; [
@ -96,25 +95,6 @@ in
-- require("dressing").setup() -- require("dressing").setup()
end 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 do -- Setup idris2-nvim
require("idris2").setup { } require("idris2").setup { }
end end

View file

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