Path: utzoo!attcan!uunet!seismo!dimacs.rutgers.edu!rutgers!cmcl2!yale!cs.utexas.edu!usc!apple!snorkelwacker!bloom-beacon!eru!hagbard!sunic!mcsun!cernvax!chx400!ethz!neptune!inf.ethz.ch!wyle From: wyle@inf.ethz.ch (Mitchell Wyle) Newsgroups: comp.editors Subject: Re: edit multiple files in vi? Message-ID: <8652@neptune.inf.ethz.ch> Date: 19 Sep 90 10:16:14 GMT References: <1990Sep13.030424.27298@hybrid.UUCP> <630@mlacus.oz> Sender: news@neptune.inf.ethz.ch Reply-To: wyle@inf.ethz.ch (Mitchell Wyle) Organization: Departement Informatik, ETH, Zurich Lines: 62 In <630@mlacus.oz> david@mlacus.oz (David Letcher) explains: >javey@hybrid.UUCP (Shahram Javey) asked: > >>Is there a way to edit multiple files in vi so that one could move >>from one file to next and back again? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ He wants to jump around between files, cutting, pasting, viewiing, etc. as emacs users do with their several windows. >specify all required files on command line But he may not know which files are required when he starts! >use > >:e# > >to return to the LAST file edited. That's the ticket! I have never seen any good, clear, motivating examples of the "alternate file" editing feature(s) in vi. Me? I use csh job control when I do text editing and ctags, ^] :tag when I edit program code. I must admit I leave vi a lot and use csh with a bunch of vi's hanging around stopped in the background... % vi file1 ^Z % vi file2 ^Z % vi file3 ^Z % %2 ^Z % %3 etc. I often cut pieces out of files, write them to temporary files, then read them into other files. I KNOW it is possible to perform these operations without leaving vi, as in: % vi file1 :e file2 [yank stuff into some buffer, e.g. "a9yy (yank 9 lines into buffer a)] :e# [put stuff where I want it. e.g. "ap (put buffer a here)] but I have not yet become so adept at vi that I use this way to yank, cut, and paste between different files without leaving vi. I suppose that most of us receive poor training at the outset and fall into bad habits. The vi books all suck in how they teach you to use these features which is one reason I am writing a better one. >use > >:e filename > > >to edit any file. Yeah!