auto-save.nvim icon indicating copy to clipboard operation
auto-save.nvim copied to clipboard

Config not working?

Open superDuperCyberTechno opened this issue 2 years ago • 3 comments

I've tried multiple things so far, the config does not seem to be read.

Here's what I have in my init.lua:

require("auto-save").setup {
    enabled = false,
    trigger_events = {"FocusLost"}
}

It ignores both clauses (not only is it enabled, it also saves when exiting insert mode).

superDuperCyberTechno avatar Apr 12 '23 12:04 superDuperCyberTechno

Yes, this plugin doesn't read the configs correctly. You could try out the maintained fork (still WIP, the API could change): https://github.com/okuuva/auto-save.nvim

It also does already incorporate the FocusLost event.

primeapple avatar Apr 12 '23 13:04 primeapple

Thanks, I ended up just doing it manually:

vim.api.nvim_create_autocmd({'FocusLost'}, {
        command = 'silent! wa'
    })

superDuperCyberTechno avatar Apr 12 '23 16:04 superDuperCyberTechno

Apparently, this plugin is no longer maintained. The author should at least signal that's it's now archived.

@superDuperCyberTechno I think bufdo is more efficient

api.nvim_create_autocmd( "FocusLost" , { command = "silent bufdo update" })

kqvanity avatar Apr 20 '24 13:04 kqvanity