nvim: Disable automatic formatting on save

Default the option to disable on formatting on save, but add new
key mapping to toggle it on (`<leader>sa`) and off. Still
the remaining issue of files always being 'unsaved' state when
using formatting on save, but this allows quicker toggling for
now.
This commit is contained in:
Marty Oehme 2023-08-07 11:26:17 +02:00
parent 112d6d8fa9
commit 9934c2e8f0
Signed by: Marty
GPG Key ID: EDBF2ED917B2EF6A
2 changed files with 3 additions and 1 deletions

View File

@ -290,6 +290,8 @@ map(
{ silent = true, desc = "colorize background" }
)
map("n", "<leader>sa", "<cmd>FormatOnSave<cr>", { silent = true, desc = "toggle format on save" })
-- PLUGIN: undotree
if is_available("undotree") then
map("n", "<leader>su", function()

View File

@ -84,7 +84,7 @@ local globals = {
maplocalleader = ",",
tex_flavor = "latex",
format_on_save = true, -- from personal toggle function
format_on_save = false, -- from personal toggle function
}
for o, v in pairs(globals) do