11return { -- Autoformat
2- ' stevearc/conform.nvim' ,
3- event = { ' BufWritePre' , ' BufReadPre' , ' BufNewFile' },
4- cmd = { ' ConformInfo' },
2+ " stevearc/conform.nvim" ,
3+ event = { " BufWritePre" , " BufReadPre" , " BufNewFile" },
4+ cmd = { " ConformInfo" },
55 keys = {
66 {
7- ' <leader>f' ,
7+ " <leader>f" ,
88 function ()
9- require (' conform' ).format ({ async = true , lsp_format = ' fallback' })
9+ require (" conform" ).format ({ async = true , lsp_format = " fallback" })
1010 end ,
11- mode = ' ' ,
12- desc = ' [F]ormat buffer' ,
11+ mode = " " ,
12+ desc = " [F]ormat buffer" ,
1313 },
1414 },
1515 opts = {
@@ -21,35 +21,35 @@ return { -- Autoformat
2121 timeout_ms = 5000 ,
2222 },
2323 formatters_by_ft = {
24- go = { ' goimports' , ' gofmt' },
25- terraform = { ' terraform_fmt' },
26- lua = { ' stylua' },
27- javascript = { ' prettier' },
28- typescript = { ' prettier' },
29- javascriptreact = { ' prettier' },
30- typescriptreact = { ' prettier' },
31- svelte = { ' prettier' },
32- css = { ' prettier' },
33- html = { ' prettier' },
34- json = { ' prettier' },
35- yaml = { ' prettier' },
36- markdown = { ' prettier' },
37- graphql = { ' prettier' },
38- liquid = { ' prettier' },
24+ go = { " goimports" , " gofmt" },
25+ terraform = { " terraform_fmt" },
26+ lua = { " stylua" },
27+ javascript = { " prettier" },
28+ typescript = { " prettier" },
29+ javascriptreact = { " prettier" },
30+ typescriptreact = { " prettier" },
31+ svelte = { " prettier" },
32+ css = { " prettier" },
33+ html = { " prettier" },
34+ json = { " prettier" },
35+ yaml = { " prettier" },
36+ markdown = { " prettier" },
37+ graphql = { " prettier" },
38+ liquid = { " prettier" },
3939 -- python = { 'isort', 'black' },
4040 -- You can use a function here to determine the formatters dynamically
4141 python = function (bufnr )
42- if require (' conform' ).get_formatter_info (' ruff_format' , bufnr ).available then
43- return { ' ruff_format' }
42+ if require (" conform" ).get_formatter_info (" ruff_format" , bufnr ).available then
43+ return { " ruff_format" }
4444 else
45- return { ' isort' , ' black' }
45+ return { " isort" , " black" }
4646 end
4747 end ,
4848 -- Use the "*" filetype to run formatters on all filetypes.
49- [' * ' ] = { ' codespell' },
49+ [" * " ] = { " codespell" },
5050 -- Use the "_" filetype to run formatters on filetypes that don't
5151 -- have other formatters configured.
52- [' _ ' ] = { ' trim_whitespace' },
52+ [" _ " ] = { " trim_whitespace" },
5353 -- Conform can also run multiple formatters sequentially
5454 -- python = { "isort", "black" },
5555 --
0 commit comments