diff options
| author | 2025-06-09 13:43:45 +0300 | |
|---|---|---|
| committer | 2025-06-09 13:55:38 +0300 | |
| commit | 97af93b2a8ebc89364852e3f63e9fd8cfedaeedf (patch) | |
| tree | 27e2added74ee6c0ff91c9e7927491c661a8bb36 /config/nvim/lua/plugins/conform.lua | |
| parent | 04.06.2025 (diff) | |
| download | dotfiles-97af93b2a8ebc89364852e3f63e9fd8cfedaeedf.tar.gz dotfiles-97af93b2a8ebc89364852e3f63e9fd8cfedaeedf.tar.bz2 dotfiles-97af93b2a8ebc89364852e3f63e9fd8cfedaeedf.tar.xz dotfiles-97af93b2a8ebc89364852e3f63e9fd8cfedaeedf.zip | |
Перевёл dotfiles на stow
Diffstat (limited to 'config/nvim/lua/plugins/conform.lua')
| -rw-r--r-- | config/nvim/lua/plugins/conform.lua | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/config/nvim/lua/plugins/conform.lua b/config/nvim/lua/plugins/conform.lua new file mode 100644 index 0000000..3204d2d --- /dev/null +++ b/config/nvim/lua/plugins/conform.lua @@ -0,0 +1,35 @@ +return { + "stevearc/conform.nvim", + opts = { + formatters_by_ft = { + javascript = { "prettier" }, + typescript = { "prettier" }, + javascriptreact = { "prettier" }, + typescriptreact = { "prettier" }, + css = { "prettier" }, + html = { "prettier" }, + json = { "prettier" }, + yaml = { "prettier" }, + markdown = { "prettier" }, + graphql = { "prettier" }, + lua = { "stylua" }, + python = { "isort", "black" }, + go = { "gofmt" }, + templ = { "templ" }, + }, + format_on_save = { + lsp_fallback = true, + async = false, + timeout_ms = 500, + }, + }, + keys = { + { + "<leader>mp", + function() + require("conform").format({ lsp_fallback = true, async = false, timeout_ms = 500 }) + end, + desc = "Format file or range (in visual mode)", + }, + }, +} |
