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:
parent
112d6d8fa9
commit
9934c2e8f0
2 changed files with 3 additions and 1 deletions
|
@ -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()
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue