stevearc / conform.nvim

Lightweight yet powerful formatter plugin for Neovim
MIT License
3.15k stars 161 forks source link

feat: add formatter sqlfmt #307

Closed MattiasMTS closed 8 months ago

MattiasMTS commented 8 months ago

Fulfills #145.

Works with installing sqlfmt via e.g. Mason and adding optional configuration as:

  "conform.nvim",
  dev = true,
  enabled = true,
  event = { "BufWritePre" },
  cmd = { "ConformInfo" },
  opts = {
    formatters_by_ft = {
      sql = { "sqlfmt" },
    },
    formatters = {
      sqlfmt = {
        exe = "sqlfmt",
        stdin = true,
        args = { "-", "--fast", "--line-length", "120" },
      },
    },
  },
stevearc commented 8 months ago

LTGM thanks!