mirror of
https://github.com/kossLAN/nvim-flake.git
synced 2025-11-04 17:59:50 -05:00
25 lines
834 B
Lua
25 lines
834 B
Lua
require('conform').setup {
|
|
formatters_by_ft = {
|
|
lua = { 'stylua' },
|
|
nix = { 'alejandra' },
|
|
rust = { 'rustfmt' },
|
|
typescript = { 'prettierd' },
|
|
|
|
-- Conform will run multiple formatters sequentially
|
|
-- python = { "isort", "black" },
|
|
-- You can customize some of the format options for the filetype (:help conform.format)
|
|
-- rust = { "rustfmt", lsp_format = "fallback" },
|
|
-- Conform will run the first available formatter
|
|
-- javascript = { "prettierd", "prettier", stop_after_first = true },
|
|
},
|
|
format_on_save = nil,
|
|
-- format_on_save = {
|
|
-- -- These options will be passed to conform.format()
|
|
-- timeout_ms = 500,
|
|
-- lsp_format = 'fallback',
|
|
-- },
|
|
}
|
|
|
|
vim.keymap.set('n', '<space>f', function()
|
|
require('conform').format { async = true }
|
|
end, { desc = '[f]ormat buffer' })
|