To edit multiple files within a single vi session, you either list the files on the command line, or use the buildin command next: ":next next_file.txt"
To list all current buffers use the :ls command. Switching to a given
buffer is done via ":buffer #" or for short ":b #", with # representing the
buffer number.
see this link for
more information about multiple buffers/windows in vim.
Often the buffer that you want to edit is the buffer that you have just
left. Vim provides a couple of convenient commands to switch back to the
previous buffer. These are
Both of these technically edit the alternate file, although this is usually
the previously edited buffer.
copyright © 1997-2025
Oliver Schroeder
(remove XYZ)