- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- vi: repeating colon commands
Operating System - HP-UX
1760485
Members
3845
Online
108894
Solutions
Forums
Categories
Company
Local Language
юдл
back
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
юдл
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
тАО05-28-2003 10:13 AM
тАО05-28-2003 10:13 AM
I'm still a bit of a newbie to vi and have a question regarding colon commands.
Let's say I want to replace any instances of "1-a" that appear on the next ten lines with "1-h." As I understand things, I would type:
:.,+10s/1-a/1-h/g
and my replace would work just fine.
Now let's say I want to repeat the above replace commandbut only for the following five lines. Is there any way for me to call up the previous text (:.,+10s/1-a/1-h/g) and change the +10 to +5, or do I have to manually retype the whole thing?
Let's say I want to replace any instances of "1-a" that appear on the next ten lines with "1-h." As I understand things, I would type:
:.,+10s/1-a/1-h/g
and my replace would work just fine.
Now let's say I want to repeat the above replace commandbut only for the following five lines. Is there any way for me to call up the previous text (:.,+10s/1-a/1-h/g) and change the +10 to +5, or do I have to manually retype the whole thing?
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-28-2003 11:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-28-2003 11:01 AM
тАО05-28-2003 11:01 AM
Re: vi: repeating colon commands
Hi Jon,
I don't believe there's a buffer of commands that you can edit. You can repeat some commands, but not change them as far as I know.
Perhaps macros might help you out? If these are commands you are going to use frequently then you could have them under 2 separate keys...
regards,
Darren.
I don't believe there's a buffer of commands that you can edit. You can repeat some commands, but not change them as far as I know.
Perhaps macros might help you out? If these are commands you are going to use frequently then you could have them under 2 separate keys...
regards,
Darren.
Calm down. It's only ones and zeros...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-29-2003 12:54 AM
тАО05-29-2003 12:54 AM
Re: vi: repeating colon commands
Some editors *do* have a buffer. In elvis and vim, you can type the colon and then the up-arrow key.
Enjoy, have FUN! H.Merijn
Enjoy, have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP