Lurker News
`:x` leaves the modification time of files untouched if nothing was changed.

    :help :x
        Like ":wq", but write only when changes have been made.

Comments (270) 59 threads

Show all comments

Showing thread 26 of 59

kens1 reply#
Is there a good way to manage saved-but-not-exited vim windows so I don't open the same file twice? I keep running into a problem where I'm editing a dozen files, and then I try to re-open a file I already have opened. Vim gives me a warning about this but my choices are a) tab through all my open windows until I find the right one, or b) open a new editing window and hope that I didn't have unsaved changes in the first one.

Is there a way to have vim just go to the open window? Or is there a better way to manage my windows?
(I'm using MacVim if it makes a difference.)

aidenn01 reply#
setting "nohid" will cause vim to close non-active buffers, so at least then you only need to tab through active buffers. If I run into this situation, I just close all of my open vim windows, saving as needed, but you might have a good use case for many open vim windows.
kens#
Thanks for the suggestion! I also found that MacVim has tabs, which may be better than having a bunch of open windows.