nvim-snappy/lua/plugins/editing/conform-nvim.lua

47 lines
892 B
Lua
Raw Normal View History

2025-02-12 11:49:02 +01:00
return {
'stevearc/conform.nvim',
2025-02-13 08:58:49 +01:00
commit = '363243c03102a531a8203311d4f2ae704c620d9b',
2025-02-12 11:49:02 +01:00
lazy = true,
2025-02-13 08:58:49 +01:00
cmd = { 'ConformInfo' },
2025-02-12 11:49:02 +01:00
init = function()
2025-02-13 08:58:49 +01:00
vim.treesitter.language.register('markdown', { 'quarto', 'rmd' })
2025-02-12 11:49:02 +01:00
end,
opts = {
formatters_by_ft = {
python = { 'ruff_format', 'ruff_organize_imports' },
2025-02-13 08:58:49 +01:00
lua = { 'stylua' },
2025-02-12 11:49:02 +01:00
--python = { 'ruff_format' },
quarto = { 'injected' },
},
default_format_opts = {
lsp_format = 'fallback',
},
formatters = {
injected = {
options = {
ignore_errors = false,
lang_to_ext = {
bash = 'sh',
c_sharp = 'cs',
elixir = 'exs',
javascript = 'js',
julia = 'jl',
latex = 'tex',
markdown = 'md',
python = 'py',
ruby = 'rb',
rust = 'rs',
teal = 'tl',
r = 'r',
typescript = 'ts',
},
lang_to_formatters = {},
},
},
},
},
}