diff options
author | Toby Vincent <tobyv@tobyvin.dev> | 2023-11-20 15:07:31 -0600 |
---|---|---|
committer | Toby Vincent <tobyv@tobyvin.dev> | 2023-11-20 15:08:30 -0600 |
commit | b74796401a323f1e57a66b4db5dfa45f351e9f0a (patch) | |
tree | b7534c61bde7668e9705eb168afdf0eb6dc67405 | |
parent | ddc43fa1ff26ce6fe0a12d0ea68fbfcb8c0f1a42 (diff) |
fix(nvim): set djlint indent to tabstop
-rw-r--r-- | nvim/.config/nvim/lua/plugins/conform.lua | 11 | ||||
-rw-r--r-- | nvim/.config/nvim/lua/plugins/nvim-lint.lua | 2 |
2 files changed, 8 insertions, 5 deletions
diff --git a/nvim/.config/nvim/lua/plugins/conform.lua b/nvim/.config/nvim/lua/plugins/conform.lua index 53f0c8b..5c630e1 100644 --- a/nvim/.config/nvim/lua/plugins/conform.lua +++ b/nvim/.config/nvim/lua/plugins/conform.lua @@ -10,10 +10,8 @@ local M = { formatters_by_ft = { lua = { "stylua" }, css = { "prettier" }, - django = { "djlint" }, html = { "prettier" }, htmldjango = { "djlint" }, - ["jinja.html"] = { "djlint" }, tex = { "latexindent" }, plaintex = { "latexindent" }, -- FIX: Move "injected" back to "*" if/when https://github.com/stevearc/conform.nvim/issues/200 is fixed. @@ -26,7 +24,6 @@ local M = { scss = { "prettier" }, sh = { "shfmt" }, PKGBUILD = { "shfmt" }, - -- ["*"] = { "injected" }, }, formatters = { latexindent = { @@ -38,6 +35,14 @@ local M = { prettier = { prepend_args = { "--prose-wrap", "always" }, }, + djlint = { + prepend_args = function(ctx) + return { + "--indent=" .. vim.bo[ctx.buf].tabstop, + "--profile=" .. (vim.bo[ctx.buf].filetype:gsub("htmldjango", "django")), + } + end, + }, nginxbeautifier = { command = "nginxbeautifier", args = function(ctx) diff --git a/nvim/.config/nvim/lua/plugins/nvim-lint.lua b/nvim/.config/nvim/lua/plugins/nvim-lint.lua index afcd006..5c6f858 100644 --- a/nvim/.config/nvim/lua/plugins/nvim-lint.lua +++ b/nvim/.config/nvim/lua/plugins/nvim-lint.lua @@ -29,9 +29,7 @@ local M = { "mfussenegger/nvim-lint", opts = { linters_by_ft = { - django = { "djlint" }, htmldjango = { "djlint" }, - ["jinja.html"] = { "djlint" }, lua = { "selene" }, markdown = { "markdownlint" }, }, |