nvim: added stylua with custom config

master
tiyn 10 months ago
parent abed395a87
commit 7931d193b6

@ -1,18 +1,19 @@
return { return {
-- improved refactoring -- improved refactoring
{ {
'stevearc/conform.nvim', "stevearc/conform.nvim",
config = function() config = function()
require("conform").setup({ require("conform").setup({
formatters_by_ft = { formatters_by_ft = {
python = { "isort", "black" }, python = { "isort", "black" },
markdown = { "mdformat" }, markdown = { "mdformat" },
tex = { "latexindent" }, tex = { "latexindent" },
} lua = { "stylua" },
},
}) })
require("conform").formatters.latexindent = { require("conform").formatters.latexindent = {
prepend_args = { "-y=defaultIndent: ' '" }, prepend_args = { "-y=defaultIndent: ' '" },
} }
end end,
} },
} }

@ -8,13 +8,15 @@ return {
config = function() config = function()
require("null-ls").setup({ require("null-ls").setup({
sources = { sources = {
-- python
require("null-ls").builtins.formatting.isort,
require("null-ls").builtins.formatting.black,
-- markdown
require("null-ls").builtins.formatting.mdformat,
-- latex -- latex
require("null-ls").builtins.formatting.latexindent, require("null-ls").builtins.formatting.latexindent,
-- lua
require("null-ls").builtins.formatting.stylua,
-- markdown
require("null-ls").builtins.formatting.mdformat,
-- python
require("null-ls").builtins.formatting.black,
require("null-ls").builtins.formatting.isort,
} }
}) })
end end
@ -28,6 +30,7 @@ return {
"isort", "isort",
"latexindent", "latexindent",
"mdformat", "mdformat",
"stylua",
} }
} }
} }

@ -0,0 +1,10 @@
column_width = 100
line_endings = "Unix"
indent_type = "Spaces"
indent_width = 2
quote_style = "AutoPreferDouble"
call_parentheses = "Always"
collapse_simple_statement = "Never"
[sort_requires]
enabled = true
Loading…
Cancel
Save