From 446d2716e7bb83e58fb516ec27e5c7750069e98c Mon Sep 17 00:00:00 2001 From: Alexander Neonxp Kiryukhin Date: Fri, 2 May 2025 16:05:47 +0300 Subject: =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D1=88=D0=B5=D0=BB=20=D0=BD?= =?UTF-8?q?=D0=B0=20lazy=20nvim,=20=D0=BD=D0=B0=D0=B2=D0=B5=D0=BB=20=D0=BF?= =?UTF-8?q?=D0=BE=D1=80=D1=8F=D0=B4=D0=BE=D0=BA=20=D0=B2=20=D0=BF=D0=BB?= =?UTF-8?q?=D0=B0=D0=B3=D0=B8=D0=BD=D0=B0=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nvim/lua/plugins/conform.lua | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 nvim/lua/plugins/conform.lua (limited to 'nvim/lua/plugins/conform.lua') diff --git a/nvim/lua/plugins/conform.lua b/nvim/lua/plugins/conform.lua new file mode 100644 index 0000000..ea0fcf0 --- /dev/null +++ b/nvim/lua/plugins/conform.lua @@ -0,0 +1,34 @@ +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" }, + }, + format_on_save = { + lsp_fallback = true, + async = false, + timeout_ms = 500, + }, + }, + keys = { + { + "mp", + function() + require("conform").format({ lsp_fallback = true, async = false, timeout_ms = 500 }) + end, + desc = "Format file or range (in visual mode)", + }, + }, +} -- cgit v1.2.3