- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: using vi editor
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
Forums
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
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
тАО10-18-2005 09:05 AM
тАО10-18-2005 09:05 AM
I am using vi editor. Just want to copy 2 or 3 words from a line and want to paste it over some other line or new line in the vi editor.
How to do that ?
Thanks,
Shiv
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-18-2005 09:11 AM
тАО10-18-2005 09:11 AM
Re: using vi editor
just go to the first letter of the string and hit (let's say it's 11 letters):
11x
then go to where you want to paste it, and type:
p
If it's 3 words you want to delete, go to the first letter of the first word and hit:
3dw
then go to where you want to paste it, and type:
p
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-18-2005 09:28 AM
тАО10-18-2005 09:28 AM
Re: using vi editor
Thanks,
Shiv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-18-2005 09:31 AM
тАО10-18-2005 09:31 AM
Re: using vi editor
place your cursor at the beginning of the 3 words you want to copy
type 3dw (you will see the 3 words disappearing - now three words are in your clip buffer) if you want to keep them there hit "p" (lower case p) immediately.
now move to the beginning of the location you want to 'paste' them to
hit lower case p again
repeat as necessary
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-18-2005 09:44 AM
тАО10-18-2005 09:44 AM
Re: using vi editor
Place ther cursor on the 1st character of the 3 words you want to yank.
For 3 words, do '3yw' then move the cursor to where you want the words placed and 'p' to place the words there.
If you are yanking 2 words, '2yw'
The 'p' keystroke is necessary to 'place'.
If you make a mistake, quit the file without saving and try again. To quit without saving.
:q!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-18-2005 09:46 AM
тАО10-18-2005 09:46 AM
Re: using vi editor
Jeff Traigle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-18-2005 09:55 AM
тАО10-18-2005 09:55 AM
Re: using vi editor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-18-2005 10:00 AM
тАО10-18-2005 10:00 AM
Re: using vi editor
Jeff Traigle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-18-2005 04:01 PM
тАО10-18-2005 04:01 PM
Re: using vi editor
maybe a search/replace would work perfectly!
:1,$s/new_word/word_to_replaced/g
hope this helps too!
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-18-2005 05:59 PM
тАО10-18-2005 05:59 PM
Re: using vi editor
Select two words
Come to new line and press i
Right click mouse. It will paste it.
To update in other two words with new one then, Press R to change with new words.
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-18-2005 06:10 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-18-2005 06:14 PM
тАО10-18-2005 06:14 PM
Re: using vi editor
A good guide on VI atatched.
-Arun