return {
  'stevearc/conform.nvim',
  event = { 'BufReadPre', 'BufNewFile' },
  config = function()
    local conform = require('conform')

    local formatters = {
      stylua = {},
      clang_format = {},
      prettier = {},
      autopep8 = {},
      isort = {},
      shfmt = {},
    }

    local util = require('conform.util')
    for _, formatter in pairs(formatters) do
      formatter.cwd = util.root_file({
        '.git',
        'pyproject.toml',
        'package.json',
        'Makefile',
        '.editorconfig',
      })
    end

    conform.setup({
      formatters_by_ft = {
        lua = { 'stylua' },
        cpp = { 'clang-format' },
        c = { 'clang-format' },
        html = { 'prettier' },
        css = { 'prettier' },
        javascript = { 'prettier' },
        python = { 'autopep8', 'isort' },
        bash = { 'shfmt' },
        ksh = { 'shfmt' },
        sh = { 'shfmt' },
      },
      formatters = formatters,
      -- format_on_save = {
      --   lsp_fallback = true,
      --   async = false,
      --   timeout_ms = 1000,
      -- },
    })

    vim.keymap.set({ 'n', 'v' }, '<leader>cf', function()
      conform.format({
        lsp_fallback = true,
        async = false,
        timeout_ms = 1000,
      })
    end, { desc = 'Format file or range (in visual mode)' })
  end,
}
