diff options
| author | Ibrahim Muftee <ibrahim@muftee.net> | 2024-10-03 17:54:22 -0500 |
|---|---|---|
| committer | Ibrahim Muftee <ibrahim@muftee.net> | 2026-07-01 00:23:31 -0400 |
| commit | 7876fabd7c5c625194ee723972e63105eca4b505 (patch) | |
| tree | 8a60254fdba136242a10954bc0429747e509a46c /dot_config/nvim/lua/plugins/conform.lua | |
| parent | 25845fce1beb28e783e7f9495a0fadf19e26bee6 (diff) | |
feat(nvim): neovim config rewrite
Diffstat (limited to 'dot_config/nvim/lua/plugins/conform.lua')
| -rw-r--r-- | dot_config/nvim/lua/plugins/conform.lua | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/dot_config/nvim/lua/plugins/conform.lua b/dot_config/nvim/lua/plugins/conform.lua deleted file mode 100644 index c1b38ab..0000000 --- a/dot_config/nvim/lua/plugins/conform.lua +++ /dev/null @@ -1,48 +0,0 @@ --- Use prettierd if it's available or prettier otherwise, but don't --- try to run them both. -local prettier = { { "prettierd", "prettier" } } - -return { - "stevearc/conform.nvim", - event = { "BufReadPre", "BufNewFile" }, - cmd = { "ConformInfo", "Format" }, - opts = { - formatters = { - sqlfluff = { - -- By default, SQLFluff uses "ansi" formatting. My projects - -- right now use MySQL formatting instead. - -- Still looking for a better way to manage this. - args = { "fix", "--force", "--dialect=mysql", "-" }, - }, - }, - formatters_by_ft = { - lua = { "stylua" }, - - -- Ruff LSP handles formatting for Python code - -- -- Multiple items in one table will be run sequentially - python = { "ruff_format" }, - - c = { "clang-format" }, - css = prettier, - html = prettier, - javascript = prettier, - json = prettier, - markdown = prettier, - typescript = prettier, - yaml = prettier, - - sql = { "sqlfluff" }, - }, - }, - config = function(_, opts) - local conform = require("conform") - require("conform").setup(opts) - - local function format() - conform.format({ async = true, lsp_fallback = true }) - end - - vim.keymap.set({ "n", "v" }, "<leader>rf", format, { desc = "Reformat" }) - vim.api.nvim_create_user_command("Format", format, {}) - end, -} |
