0

I work like this in VIM :

  • First tab displays buffers that I'm modifying
  • Other tabs display buffers that I just read/consult

Sometimes I accidentally modify buffers in the other tabs but do not want to save the changes for those buffers.

How can I save only the buffers displayed in the first (current) tab?

Stun Brick
  • 1,124
  • 6
  • 17
floupinette
  • 150
  • 11
  • 1
    `:set readonly` Found in https://stackoverflow.com/a/5126472/7976758 , https://stackoverflow.com/search?q=%5Bvim%5D+prevent+writing – phd Jul 09 '22 at 09:38
  • 2
    And `:windo update` for writing to disk every modified buffer displayed in a window in the current tab page. – romainl Jul 09 '22 at 09:58

1 Answers1

2

As said @romainl, to save modifications of (only) the currently displayed buffers, do :

:windo update
floupinette
  • 150
  • 11