14.06.2014 Views

vim 101 hacks

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Buyer: xiujuan lu (luxiujuan@gmail.com)<br />

Transaction ID: 85W16630AD8515549<br />

Vim <strong>101</strong> Hacks<br />

www.thegeekstuff.com<br />

Hack 74. Edit Multiple Files Using the Traditional<br />

Method<br />

Using this hack you can edit multiple files in a single Vim session.<br />

Open multiple files from command line.<br />

$ <strong>vim</strong> file1 file2 file2<br />

Open another file when you are already in a Vim session.<br />

:e another_file<br />

List all open files in the current Vim session.<br />

:ls<br />

1 %a "helloworld.cc" line 1<br />

2 "employee.txt" line 0<br />

3 "/etc/passwd" line 0<br />

Go to the Nth file from the above :ls output.<br />

:e #N<br />

Toggle between two files.<br />

CTRL-^<br />

112

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!