From 62847aca509b266419b7dbd9639c6963324672fb Mon Sep 17 00:00:00 2001 From: Jimmy Bates Date: Wed, 3 Jul 2024 10:31:34 -0700 Subject: [PATCH] Autoformatting for django does 4-spaces now thank fucking god --- lua/custom/plugins/autoformat.lua | 11 +++++++++-- lua/kickstart/plugins/lint.lua | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lua/custom/plugins/autoformat.lua b/lua/custom/plugins/autoformat.lua index 4ef4ca5d..e8989393 100644 --- a/lua/custom/plugins/autoformat.lua +++ b/lua/custom/plugins/autoformat.lua @@ -27,13 +27,13 @@ return { formatters_by_ft = { lua = { 'stylua' }, python = { 'autopep8' }, - javascript = { { 'prettierd', 'prettier' } }, + javascript = { 'prettier' }, c = { 'clang-format' }, cpp = { 'clang-format' }, yaml = { 'yamlfmt' }, html = { 'djlint' }, htmldjango = { 'djlint' }, - css = { { 'prettierd', 'prettier' } }, + css = { 'prettier' }, json = { 'deno_fmt' }, -- Conform can also run multiple formatters sequentially -- python = { "isort", "black" }, @@ -42,5 +42,12 @@ return { -- is found. -- javascript = { { "prettierd", "prettier" } }, }, + formatters = { + djlint = { + args = function() + return { '-', '--reformat', '--profile', 'django', '--indent', 4 } + end, + }, + }, }, } diff --git a/lua/kickstart/plugins/lint.lua b/lua/kickstart/plugins/lint.lua index 28ebd255..ee77f4e4 100644 --- a/lua/kickstart/plugins/lint.lua +++ b/lua/kickstart/plugins/lint.lua @@ -12,6 +12,7 @@ return { javascript = { 'eslint' }, css = { 'stylelint' }, html = { 'djlint' }, + htmldjango = { 'djlint' }, } -- To allow other plugins to add linters to require('lint').linters_by_ft,