Reputation: 163
Vim newbie here. I use :find command to open a file and make some changes. Suppose I want to open another file without saving the current changes, then how should I do it. What is the best way to list all open files and quickly open them again for editing. Thanks in advance.
Upvotes: 0
Views: 1649
Reputation: 272237
:e! filename
will allow you to open a named file in a new buffer (note the exclamation mark overrides the warning re. an unsaved file).
CTRL-W + cursor
will move between visible buffers and does not enforce the saving of your file as you navigate.
:buffers
will list your open buffers and allow you to navigate to each one (albeit with some cryptic flags indicating which buffers are visible/hidden/amended etc.)
:help buffers
will tell you about all the buffer-related features.
:help :wincmd
will tell you all about windows navigations
See also the VIM buffer FAQ
Upvotes: 1