From 5498a05bf782977453f11608f5ad905c9119790f Mon Sep 17 00:00:00 2001 From: jdhao Date: Mon, 1 Aug 2022 01:14:09 +0800 Subject: [PATCH] revert to vim-auto-save auto-save.nvim is erroring out --- core/plugins.vim | 5 +++++ lua/config/autosave.lua | 15 --------------- lua/plugins.lua | 8 +------- 3 files changed, 6 insertions(+), 22 deletions(-) delete mode 100644 lua/config/autosave.lua diff --git a/core/plugins.vim b/core/plugins.vim index 910c4ab..a044b76 100644 --- a/core/plugins.vim +++ b/core/plugins.vim @@ -425,3 +425,8 @@ function! s:wilder_init() abort echohl Error |echomsg "Wilder.nvim missing: run :PackerSync to fix."|echohl None endtry endfunction + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" auto-save " +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +let g:auto_save = 1 " enable AutoSave on Vim startup diff --git a/lua/config/autosave.lua b/lua/config/autosave.lua deleted file mode 100644 index d290e7f..0000000 --- a/lua/config/autosave.lua +++ /dev/null @@ -1,15 +0,0 @@ -require("autosave").setup({ - enabled = true, - execution_message = "Autosaved at " .. vim.fn.strftime("%H:%M:%S"), - events = { "InsertLeave", "TextChanged" }, - conditions = { - exists = true, - filename_is_not = {"plugins.lua"}, - filetype_is_not = {}, - modifiable = true, - }, - write_all_buffers = false, - on_off_commands = true, - clean_command_line_interval = 1000, - debounce_delay = 135, -}) diff --git a/lua/plugins.lua b/lua/plugins.lua index da47601..a12b655 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -186,13 +186,7 @@ packer.startup({ -- use 'mg979/vim-visual-multi' -- Autosave files on certain events - use({ - "Pocco81/AutoSave.nvim", - event = "VimEnter", - config = function() - vim.defer_fn(function() require('config.autosave') end, 1500) - end - }) + use({"907th/vim-auto-save", event = "InsertEnter"}) -- Show undo history visually use({"simnalamburt/vim-mundo", cmd = {"MundoToggle", "MundoShow"}})