nvim: add formatters

This commit is contained in:
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; withPython3 = true;
extraLuaConfig = builtins.readFile ./init.lua; extraLuaConfig = builtins.readFile ./init.lua;
extraPackages = with pkgs; [ extraPackages = with pkgs; [
sumneko-lua-language-server black
isort
nil nil
nixpkgs-fmt
rustfmt
shfmt
stylua stylua
sumneko-lua-language-server
taplo
yamlfmt
]; ];
plugins = with pkgs.vimPlugins; [ plugins = with pkgs.vimPlugins; [
catppuccin-nvim catppuccin-nvim

View file

@ -192,7 +192,24 @@ require("formatter").setup({
-- "lua" filetype -- "lua" filetype
require("formatter.filetypes.lua").stylua, 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 -- Use the special "*" filetype for defining formatter configurations on
-- any filetype -- any filetype
["*"] = { ["*"] = {