From 2f8c4fd847dddc7ab1ed5f4f5875686626c88c1a Mon Sep 17 00:00:00 2001 From: Jonas Hagberg Date: Tue, 2 Apr 2024 16:48:48 +0200 Subject: [PATCH] Auto-format go code with golines --- init.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/init.lua b/init.lua index 5ffaf4a6..62774c6d 100644 --- a/init.lua +++ b/init.lua @@ -614,6 +614,7 @@ require('lazy').setup({ end, formatters_by_ft = { lua = { 'stylua' }, + go = { 'golines' }, -- Conform can also run multiple formatters sequentially -- python = { "isort", "black" }, -- @@ -865,5 +866,8 @@ require('lazy').setup({ }, }) +require('conform').formatters.golines = { + prepend_args = { '-w -m 128 --no-reformat-tags' }, +} -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et