diff --git a/config/config.nix b/config/config.nix index 7772461..cf7971c 100644 --- a/config/config.nix +++ b/config/config.nix @@ -20,5 +20,20 @@ }; globals.mapleader = " "; + + autoCmd = [ + { + callback = '' + function(args) + require("conform").format({ bufnr = args.buf }) + end + ''; + event = ["BufWritePre"]; + pattern = [ + "*" + ]; + desc = "autoformatting on save"; + } + ]; } diff --git a/config/plugins.nix b/config/plugins.nix index 61cb37a..7ff69aa 100644 --- a/config/plugins.nix +++ b/config/plugins.nix @@ -32,6 +32,15 @@ conform-nvim = { enable = true; + settings.formatters_by_ft = { + rust = ["rustfmt"]; + lua = ["stylua"]; + javascript = { + __unkeyed-1 = "prettierd"; + __unkeyed-2 = "prettier"; + stop_after_first = true; + }; + }; }; markdown-preview = { @@ -66,7 +75,7 @@ enable = true; }; - presence-nvim = { + cord = { enable = true; }; @@ -100,8 +109,8 @@ enable = true; }; - lazygit.enable = true; + lazygit.enable = true; + mini.enable = true; }; - }