Skip to content

Commit

Permalink
auto save cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
viperML committed Aug 21, 2024
1 parent 72c4dc7 commit 5624878
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,13 @@ vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI", "InsertLeave" }, {
end
end,
})

vim.api.nvim_create_user_command("ToggleAutoSave", function(args)
if vim.g.autosave == true then
vim.g.autosave = false
vim.notify("Disabled auto save")
else
vim.g.autosave = true
vim.notify("Enabled auto save")
end
end, {})

0 comments on commit 5624878

Please sign in to comment.