|
1 | | -return { -- Autoformat |
2 | | - 'stevearc/conform.nvim', |
3 | | - lazy = false, |
4 | | - keys = { |
5 | | - { |
6 | | - '<leader>f', |
7 | | - function() |
8 | | - require('conform').format { async = true, lsp_fallback = true } |
9 | | - end, |
10 | | - mode = '', |
11 | | - desc = '[F]ormat buffer', |
12 | | - }, |
13 | | - }, |
14 | | - opts = { |
15 | | - notify_on_error = false, |
16 | | - format_on_save = function(bufnr) |
17 | | - -- Disable "format_on_save lsp_fallback" for languages that don't |
18 | | - -- have a well standardized coding style. You can add additional |
19 | | - -- languages here or re-enable it for the disabled ones. |
20 | | - local disable_filetypes = { c = true, cpp = true } |
21 | | - return { |
22 | | - timeout_ms = 500, |
23 | | - lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype], |
24 | | - } |
25 | | - end, |
26 | | - formatters_by_ft = { |
27 | | - lua = { 'stylua' }, |
28 | | - -- Conform can also run multiple formatters sequentially |
29 | | - -- python = { "isort", "black" }, |
30 | | - -- |
31 | | - -- You can use a sub-list to tell conform to run *until* a formatter |
32 | | - -- is found. |
33 | | - -- javascript = { { "prettierd", "prettier" } }, |
34 | | - }, |
35 | | - }, |
36 | | -} |
| 1 | +return { } |
| 2 | +-- return { -- Autoformat |
| 3 | +-- 'stevearc/conform.nvim', |
| 4 | +-- lazy = false, |
| 5 | +-- keys = { |
| 6 | +-- { |
| 7 | +-- '<leader>f', |
| 8 | +-- function() |
| 9 | +-- require('conform').format { async = true, lsp_fallback = true } |
| 10 | +-- end, |
| 11 | +-- mode = '', |
| 12 | +-- desc = '[F]ormat buffer', |
| 13 | +-- }, |
| 14 | +-- }, |
| 15 | +-- opts = { |
| 16 | +-- notify_on_error = false, |
| 17 | +-- format_on_save = function(bufnr) |
| 18 | +-- -- Disable "format_on_save lsp_fallback" for languages that don't |
| 19 | +-- -- have a well standardized coding style. You can add additional |
| 20 | +-- -- languages here or re-enable it for the disabled ones. |
| 21 | +-- local disable_filetypes = { c = true, cpp = true } |
| 22 | +-- return { |
| 23 | +-- timeout_ms = 500, |
| 24 | +-- lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype], |
| 25 | +-- } |
| 26 | +-- end, |
| 27 | +-- formatters_by_ft = { |
| 28 | +-- lua = { 'stylua' }, |
| 29 | +-- -- Conform can also run multiple formatters sequentially |
| 30 | +-- -- python = { "isort", "black" }, |
| 31 | +-- -- |
| 32 | +-- -- You can use a sub-list to tell conform to run *until* a formatter |
| 33 | +-- -- is found. |
| 34 | +-- -- javascript = { { "prettierd", "prettier" } }, |
| 35 | +-- }, |
| 36 | +-- }, |
| 37 | +-- } |
0 commit comments