nvim: add formatters

nixos
Moritz Böhme 2023-02-18 17:14:56 +01:00
parent b26149af98
commit 77b1ef7a07
Signed by: moritz
GPG Key ID: 970C6E89EB0547A9
2 changed files with 26 additions and 2 deletions

View File

@ -42,9 +42,16 @@ in
withPython3 = true;
extraLuaConfig = builtins.readFile ./init.lua;
extraPackages = with pkgs; [
sumneko-lua-language-server
black
isort
nil
nixpkgs-fmt
rustfmt
shfmt
stylua
sumneko-lua-language-server
taplo
yamlfmt
];
plugins = with pkgs.vimPlugins; [
catppuccin-nvim

View File

@ -192,7 +192,24 @@ require("formatter").setup({
-- "lua" filetype
require("formatter.filetypes.lua").stylua,
},
nix = {
require("formatter.filetypes.nix").nixpkgs_fmt,
},
python = {
require("formatter.filetypes.python").black,
},
rust = {
require("formatter.filetypes.rust").rustfmt,
},
sh = {
require("formatter.filetypes.sh").shfmt,
},
toml = {
require("formatter.filetypes.toml").taplo,
},
yaml = {
require("formatter.filetypes.yaml").yamlfmt,
},
-- Use the special "*" filetype for defining formatter configurations on
-- any filetype
["*"] = {