multiple vi editor

Hi Friends,

Can some1 pls tell me how to do multiple vi editor(files) in a single screen and how to switch from file to another in that.

Thanks

With plain old vi, you don't (unless you mean GNU screen, and not just a terminal window). With VIm, you have the choice between buffers and tabs.

  • vi file1 file2 file3
  • :n Edit next file (file2)
  • :n Edit next file (file3)
  • :rew Rewind to the first file (file1)

You can open a file in vi, and then within this session, you can open multiple files using :e filename.
you can switch to other currently opened files using ctrl+6.
Do remember it will allow you to switch to other files only when your current file is in saved mode.

hi all,
many thnks for the response. :slight_smile:

Hi chindu.anu,

I am able to switch to with ":n" and ":rew".
but I not able to save both file. when i did ":wq" only one is saved.

any idea how to save all the files in multiple editor?

---------- Post updated at 05:15 AM ---------- Previous update was at 05:06 AM ----------

Hi,

I got my answer,
we can achive this by ":w" to save first what we have written before going to another file.

:slight_smile: