![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Adding Multiple Lines to Multiple Files | dayinthelife | Shell Programming and Scripting | 2 | 06-04-2008 08:50 AM |
| Edit and compare giant binary files with lfhex | iBot | UNIX and Linux RSS News | 0 | 05-27-2008 01:20 AM |
| Locking a file when using VI to prevent multiple-edit sessions by diff users | Browser_ice | AIX | 14 | 11-23-2006 07:43 AM |
| Searching multiple files with multiple expressions | Anahka | Shell Programming and Scripting | 6 | 01-07-2004 03:24 PM |
| how to edit large files using vi | nazri | UNIX for Dummies Questions & Answers | 3 | 06-15-2001 06:18 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Edit Multiple Files in VI
Here's what I have...
$ vi foo1 - open foo1 and work around for a while. I yank a few lines into a buffer and then :w to save. Next I :e foo2 to open foo2 and paste my buffer. I :w to save, but I would like to then be able to go directly back into foo1 where I was before I opened foo2. Is that possible? |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
When yanking, put the lines you want to copy into a named buffer, then edit the other file. E.g.,
Code:
$ vi foo1 "a3yy :e foo2 3G "ap :wq |
|
#3
|
|||
|
|||
|
Correct, but that still exits all the way out of VI. I would like to save and close the second file (foo2) and then be directly back into the first file (foo1).
|
|
#4
|
||||
|
||||
|
Quote:
Code:
:wq Code:
:w :e# |
|
#5
|
|||
|
|||
|
Beauty. Thanks, criglerj.
|
|||
| Google The UNIX and Linux Forums |