Skip to content

Commit a74c09f

Browse files
Mon Jul 29 08:20:47 -03 2024
1 parent f74ae10 commit a74c09f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lua/custom/plugins/init.lua

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,18 @@ conform.formatters_by_ft = {
5353
javascript = { 'prettierd ' },
5454
typescript = { 'prettierd ' },
5555
ruby = { 'rubocop' },
56+
markdown = { 'markdownlint' },
5657
}
58+
conform.format_on_save = function(bufnr)
59+
-- Disable "format_on_save lsp_fallback" for languages that don't
60+
-- have a well standardized coding style. You can add additional
61+
-- languages here or re-enable it for the disabled ones.
62+
local disable_filetypes = { c = true, cpp = true }
63+
return {
64+
timeout_ms = 5000,
65+
lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype],
66+
}
67+
end
5768

5869
return {
5970
{

0 commit comments

Comments
 (0)