nvim: change pythons style to be more campact

master
tiyn 10 months ago
parent 7931d193b6
commit 4bfc54bcc1

@ -5,14 +5,17 @@ return {
config = function() config = function()
require("conform").setup({ require("conform").setup({
formatters_by_ft = { formatters_by_ft = {
python = { "isort", "black" }, python = { "isort", "yapf" },
markdown = { "mdformat" }, markdown = { "mdformat" },
tex = { "latexindent" }, tex = { "latexindent" },
lua = { "stylua" }, lua = { "stylua" },
}, },
}) })
require("conform").formatters.latexindent = { require("conform").formatters.latexindent = {
prepend_args = { "-y=defaultIndent: ' '" }, args = require("conform.util").extend_args(
require("conform.formatters.latexindent").args,
{ "-y=defaultIndent: ' '" }
),
} }
end, end,
}, },

@ -15,8 +15,8 @@ return {
-- markdown -- markdown
require("null-ls").builtins.formatting.mdformat, require("null-ls").builtins.formatting.mdformat,
-- python -- python
require("null-ls").builtins.formatting.black,
require("null-ls").builtins.formatting.isort, require("null-ls").builtins.formatting.isort,
require("null-ls").builtins.formatting.yapf,
} }
}) })
end end
@ -26,11 +26,15 @@ return {
opts = { opts = {
automatic_installation = true, automatic_installation = true,
ensure_installed = { ensure_installed = {
"black", -- latex
"isort",
"latexindent", "latexindent",
"mdformat", -- lua
"stylua", "stylua",
-- markdown
"mdformat",
-- python
"isort",
"yapf",
} }
} }
} }

@ -0,0 +1,6 @@
[style]
based_on_style = google
column_limit = 99
indent_width = 2
spaces_before_comment = 2
continuation_indent_width = 2
Loading…
Cancel
Save