From 78e39017e024141e0d8a7ea2279cab39091d6b40 Mon Sep 17 00:00:00 2001 From: Juliano Barbosa Date: Thu, 10 Oct 2024 15:07:52 -0300 Subject: [PATCH] feat: Add formatter configuration for Rust in init.lua --- init.lua | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/init.lua b/init.lua index 91c16dcb..bc1805d9 100644 --- a/init.lua +++ b/init.lua @@ -831,16 +831,17 @@ require('lazy').setup({ } end, formatters_by_ft = { - bash = { 'shellcheck' }, - hcl = { 'hclfmt' }, - go = { 'goimports', 'gofumpt' }, - lua = { 'stylua' }, - -- Conform can also run multiple formatters sequentially - python = { 'isort', 'black' }, - markdown = { 'inject' }, -- + -- Conform can also run multiple formatters sequentially -- You can use 'stop_after_first' to run the first available formatter from the list + bash = { 'shellcheck' }, + go = { 'goimports', 'gofumpt' }, + hcl = { 'hclfmt' }, javascript = { 'prettierd', 'prettier', stop_after_first = true }, + lua = { 'stylua' }, + markdown = { 'inject' }, + python = { 'isort', 'black' }, + rust = { 'rustfmt', lsp_format = 'fallback' }, terraform = { 'terraform_fmt' }, yaml = { 'yamlfmt' }, },