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

Is there a way save a file after n number of milliseconds even if the file is modified.

Open PiyushDuggal-source opened this issue 3 years ago • 5 comments

PiyushDuggal-source avatar Nov 03 '22 23:11 PiyushDuggal-source

I second this. I think there should be a little wait time before auto saving.

wildwestrom avatar Dec 12 '22 12:12 wildwestrom

Maybe a duplicate of #61?

okuuva avatar Feb 12 '23 14:02 okuuva

Upvote from me

jayboss222 avatar Apr 18 '24 05:04 jayboss222

Unsure, what this is about. Could you better describe what you want? It may be fixed within the maintained fork https://github.com/okuuva/auto-save.nvim Please open issue there

Disclaimer: I'm the co-author there.

primeapple avatar Apr 18 '24 07:04 primeapple

_The auto-save plugin should feature a debounce mechanism when saving files upon exiting insert mode (or any given trigger events). Currently, it saves after each change, which can be excessive during rapid edits. This debounce would delay saving for a brief period, such as one second, after the last exit from insert mode.

This feature would be particularly valuable in situations where hot reloading is utilized, or when file updates trigger browser page refreshes. By introducing a debounce for file saving, it would reduce unnecessary disk writes and potentially improve performance, especially in environments with frequent file modifications._

@primeapple, Nice! Looks like your forked implemented of auto-save has implemented the above feature request as defer_save. Implementing the defaults automatically does indeed defer the file save, great work. I'll leave my comment here for posterity, in case others come across this requirement

chintzyy avatar Apr 18 '24 08:04 chintzyy