vim-auto-save icon indicating copy to clipboard operation
vim-auto-save copied to clipboard

Use `:wall` instead of `:bufdo update`

Open sol opened this issue 6 months ago • 1 comments

@907th I know that you don't maintain this plug-in anymore, but do you still remember, by any chance, if there's an important reason to use :bufdo update instead of simply :wall?

sol avatar Jun 06 '25 03:06 sol

:wall

  • Writes all files that have been changed.
  • Includes hidden buffers, non-listed buffers, and even those not currently visible in a window, as long as they are loaded and modified.
  • Can trigger error messages or prompts for things like:
    • Read-only files.
    • Buffers with unsaved changes that can't be written due to permissions.
    • Might be too aggressive in an auto-save context.

:bufdo update

  • Runs :update on each listed buffer (those shown in :ls) one by one.
  • :update only writes the file if it has been modified.
  • Skips unmodified buffers silently (avoids unnecessary writes).
  • Respects hidden and buftype options more gently.
  • Less likely to interfere with buffers that are:
    • Open from netrw or plugins.
    • Read-only or non-file buffers.

kopsha avatar Jun 07 '25 04:06 kopsha