- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- copy and paste from one file to another opened in ...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2006 09:08 AM
тАО11-14-2006 09:08 AM
I need to open 2 files and edit them simultaniously in vi.
What are the sequence of commands i need to perform to copy/cut and paste from one file to another ?
Thanks,
Shi
Solved! Go to Solution.
- Tags:
- vi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2006 09:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2006 09:26 AM
тАО11-14-2006 09:26 AM
Re: copy and paste from one file to another opened in vi simultaneously
For the former, I just copy then paste. The buttons depend on which terminal emulator you are using.
For vi, you must have both files on the command line, yank into a named buffer, "a then a yank command. ("a5Y will yank 5 lines into buffer a.) Then you use :n or :rew to go to the other file and use "ap to do a put.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2006 11:48 AM
тАО11-14-2006 11:48 AM
Re: copy and paste from one file to another opened in vi simultaneously
stty erase "^H" kill "^U" intr "^C" eof "^D" -parity ixoff
The ixoff tells the connection to pause when data is arriving too fast. Without ixoff, slow machines (especially less than 100 Mhz) will drop lines of text when you are pasting a lot of data.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2006 01:34 PM
тАО11-14-2006 01:34 PM
Re: copy and paste from one file to another opened in vi simultaneously
I appreciate the settings advice, but best I can tell is has nothing to do witht he question on hand. The cut & paste discussed is the desirable one, within the same program. Terminal/network IO is only used to display the result, not to perform the atual copying.
Just an observation,
Cheers,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2006 02:22 PM - edited тАО10-23-2011 07:29 PM
тАО11-14-2006 02:22 PM - edited тАО10-23-2011 07:29 PM
Re: copy and paste from one file to another opened in vi simultaneously
>Hein: but best I can tell is has nothing to do with the question on hand.
I don't see why not. That's why I gave two answers. If I do "opened in vi simultaneously", I would have two windows and use the mouse.
>Terminal/network I/O is only used to display the result, not to perform the actual copying.
(I assume you meant pasting not copying?) Not true. I've have seen users that have problems pasting mass quantities. While I use hpterm and don't seem to have any problems. I also have ixoff set.
So Bill's comments may be useful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2006 02:53 PM
тАО11-14-2006 02:53 PM
Re: copy and paste from one file to another opened in vi simultaneously
I read the question as :
"copy and paste from one file to another opened in vi simultaneously ... in the same vi session"
That's the only proper way to do it, but it is not too often used
Shi may have referring to two seperate windows, each with a vi session. In that case the terminal settings can become important. However, the 'sequence of [vi] commands' suggest to me that intend is nto to use a terminal emulator / windows-system buffer but either a vi internal buffer or a temporary file.
Cheers,
Hein
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2006 04:00 PM
тАО11-14-2006 04:00 PM
Re: copy and paste from one file to another opened in vi simultaneously
Just on quick observation.
As per Dennis post, since if we want to do a CUT and PASTE, the strokes would be:
"a5dd : will cut 5 lines and put into buffer a
:w : save current file
:e
"ap : Paste the lines at the current cursor position
hope this helps too!
kind regards
yogeeraj