From 509f3bf1dd074be3a796e8d87ee846017645b421 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rolf=20Schr=C3=B6der?= Date: Mon, 8 Sep 2025 12:57:22 +0200 Subject: [PATCH 1/2] refactor: s/Format(Enable|Disable|Toggle)/ConformFormat(Enable|Disable|Toggle)/ --- config/plugins/lsp/conform.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/plugins/lsp/conform.nix b/config/plugins/lsp/conform.nix index 1e5ecba6..072d75b9 100644 --- a/config/plugins/lsp/conform.nix +++ b/config/plugins/lsp/conform.nix @@ -10,7 +10,7 @@ '' local slow_format_filetypes = {} - vim.api.nvim_create_user_command("FormatDisable", function(args) + vim.api.nvim_create_user_command("ConformFormatDisable", function(args) if args.bang then -- FormatDisable! will disable formatting just for this buffer vim.b.disable_autoformat = true @@ -21,13 +21,13 @@ desc = "Disable autoformat-on-save", bang = true, }) - vim.api.nvim_create_user_command("FormatEnable", function() + vim.api.nvim_create_user_command("ConformFormatEnable", function() vim.b.disable_autoformat = false vim.g.disable_autoformat = false end, { desc = "Re-enable autoformat-on-save", }) - vim.api.nvim_create_user_command("FormatToggle", function(args) + vim.api.nvim_create_user_command("ConformFormatToggle", function(args) if args.bang then -- Toggle formatting for current buffer vim.b.disable_autoformat = not vim.b.disable_autoformat From c103643eb541637c6a9f48bd9d4a024906796e58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rolf=20Schr=C3=B6der?= Date: Mon, 8 Sep 2025 12:58:17 +0200 Subject: [PATCH 2/2] add AllFormat(Enable|Disable|Toggle) commands --- config/plugins/lsp/conform.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/config/plugins/lsp/conform.nix b/config/plugins/lsp/conform.nix index 072d75b9..d4e0cc4d 100644 --- a/config/plugins/lsp/conform.nix +++ b/config/plugins/lsp/conform.nix @@ -39,6 +39,25 @@ desc = "Toggle autoformat-on-save", bang = true, }) + + vim.api.nvim_create_user_command("AllFormatDisable", function() + vim.cmd([[ConformFormatDisable]]) -- conform-nvim + vim.cmd([[FormatDisable]]) -- lsp-conform + end, { + desc = "Disable formatting for all plugins", + }) + vim.api.nvim_create_user_command("AllFormatEnable", function() + vim.cmd([[ConformFormatEnable]]) -- conform-nvim + vim.cmd([[FormatEnable]]) -- lsp-conform + end, { + desc = "Re-enable formatting for all plugins", + }) + vim.api.nvim_create_user_command("AllFormatToggle", function() + vim.cmd([[ConformFormatToggle]]) -- conform-nvim + vim.cmd([[FormatToggle]]) -- lsp-conform + end, { + desc = "Toggle formatting for all plugins", + }) ''; plugins.conform-nvim = { enable = true;