Skip to content

Commit

Permalink
fix(plugins): auto-save
Browse files Browse the repository at this point in the history
  • Loading branch information
XXiaoA committed Jul 31, 2022
1 parent d0b7556 commit 70bb27e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
22 changes: 3 additions & 19 deletions lua/config/plugins/auto-save.lua
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@
local autosave = require("utils").requirePlugin("autosave")

if not autosave then
local auto_save = require("utils").requirePlugin("auto-save")
if not auto_save then
return
end

autosave.setup({
enabled = true,
-- execution_message = "AutoSave: 于 " .. vim.fn.strftime("%H:%M:%S") .. ' 自动保存',
execution_message = "AutoSave: saved at " .. vim.fn.strftime("%H:%M:%S"),
events = { "InsertLeave", "TextChanged" },
conditions = {
exists = true, -- don't save the file if it doesn't exist
filename_is_not = {},
filetype_is_not = {},
modifiable = true,
},
write_all_buffers = false,
on_off_commands = true,
clean_command_line_interval = 0,
debounce_delay = 135,
})
auto_save.setup({})
2 changes: 1 addition & 1 deletion lua/config/plugins/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ use({ "junegunn/vim-easy-align", event = "VimEnter" })
use({ "machakann/vim-sandwich", event = "VimEnter" })
-- 自动保存
use({
"Pocco81/AutoSave.nvim",
"Pocco81/auto-save.nvim",
event = "VimEnter",
config = function()
vim.defer_fn(function()
Expand Down

0 comments on commit 70bb27e

Please sign in to comment.