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" } { silent = true, desc = "colorize background" }
) )
map("n", "<leader>sa", "<cmd>FormatOnSave<cr>", { silent = true, desc = "toggle format on save" })
-- PLUGIN: undotree -- PLUGIN: undotree
if is_available("undotree") then if is_available("undotree") then
map("n", "<leader>su", function() map("n", "<leader>su", function()

View file

@ -84,7 +84,7 @@ local globals = {
maplocalleader = ",", maplocalleader = ",",
tex_flavor = "latex", 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 for o, v in pairs(globals) do