Edit Multiple Files in Vim

vi one.txt two.txt three.txt
open Vim with one.txt, two.txt and three.txt queued

see files. current file will be in brackets ([ ])

advance to next file in the queue

rewind queue back to the first file

:e filename.php
edit filename.php in a new buffer

1 comment

manolism wrote 2 years 19 weeks ago

More tips :)

save and advance to the next file

and if you are using vim :

vim -o file1 file2
Open files in multiple windows - horizontal split

vim -O file1 file2
Open files in multiple windows - vertical split

move between open windows

cheers :)

Add your comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

Find Me Around

User login