From 8c62b4f5013cc54a57cb326f002c944b9ec784d8 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 14 Feb 2024 18:57:01 +0800 Subject: [PATCH] users/foo-dogsquared/programs/nixvim: add formatters settings Setting up formatters for individual NixVim users is preferential so we leave it alone. --- .../modules/programs/nixvim/dev.nix | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/configs/home-manager/foo-dogsquared/modules/programs/nixvim/dev.nix b/configs/home-manager/foo-dogsquared/modules/programs/nixvim/dev.nix index 5f82ea60..fcb2164d 100644 --- a/configs/home-manager/foo-dogsquared/modules/programs/nixvim/dev.nix +++ b/configs/home-manager/foo-dogsquared/modules/programs/nixvim/dev.nix @@ -1,8 +1,26 @@ # NixVim config for some light software development. This is where language -# support plugins mainly reside. -{ config, pkgs, ... }: +# support plugins mainly reside. Also formatters. +{ config, pkgs, lib, ... }: { + # Confirming these files are conforming. + plugins.conform-nvim = { + enable = true; + formatters = rec { + bash = [ "shfmt" ]; + c = lib.singleton [ "clang_format" ]; + cpp = c; + javascript = lib.singleton [ "prettierd" "prettier" ]; + lua = [ "stylua" ]; + nix = lib.singleton [ "nixpkgs-fmt" "alejandra" ]; + python = [ "isort" "black" ]; + ruby = lib.singleton [ "rubocop" "rufo" ]; + typescript = javascript; + typst = [ "typstfmt" ]; + }; + }; + + # Give language "support" through tree-sitter. plugins.treesitter.grammarPackages = with config.plugins.treesitter.package.builtGrammars; [ agda