<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: repeat a same command-set in vi in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/repeat-a-same-command-set-in-vi/m-p/2634430#M42053</link>
    <description>Hello discoverer,&lt;BR /&gt;&lt;BR /&gt;what you want is called a "macro" in vi.&lt;BR /&gt;It works like this:&lt;BR /&gt;- you put the keys to be "executed" into a buffer&lt;BR /&gt;- you tell vi to execute that buffer with "@".&lt;BR /&gt;&lt;BR /&gt;E.g:&lt;BR /&gt;Insert a line like&lt;BR /&gt;cwbye&lt;CTRL-V&gt;&lt;ESC&gt;&lt;ESC&gt;"mdd&lt;BR /&gt;where the stuff in angle brackets is actually keys (your hold down "Ctrl", then press "V", release both of them, and then press the "Esc" key, twice, then the double quote, an "m" and twice a "d").&lt;BR /&gt;Now you have the characters "cwbye&lt;ESC&gt;" in buffer "m".&lt;BR /&gt;Move your cursor to some word you would like to change to "bye" and press "@m".&lt;BR /&gt;Te repeat the last macro use "@@".&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Wodisc&lt;/ESC&gt;&lt;/ESC&gt;&lt;/ESC&gt;&lt;/CTRL-V&gt;</description>
    <pubDate>Fri, 21 Dec 2001 12:44:03 GMT</pubDate>
    <dc:creator>Wodisch</dc:creator>
    <dc:date>2001-12-21T12:44:03Z</dc:date>
    <item>
      <title>repeat a same command-set in vi</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/repeat-a-same-command-set-in-vi/m-p/2634424#M42047</link>
      <description>Hi friends,&lt;BR /&gt;&lt;BR /&gt;For example,&lt;BR /&gt;In vi, I need to insert a same word before each word.&lt;BR /&gt;As we know, we can insert the word before the first word, then ESC -&amp;gt; w -&amp;gt; . -&amp;gt; w -&amp;gt; . -&amp;gt; .....&lt;BR /&gt;&lt;BR /&gt;Is there any simple ways to repeat these ' w -&amp;gt; . ' at one time?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance !&lt;BR /&gt;&lt;BR /&gt;/Listener&lt;BR /&gt;</description>
      <pubDate>Fri, 21 Dec 2001 02:55:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/repeat-a-same-command-set-in-vi/m-p/2634424#M42047</guid>
      <dc:creator>discoverer</dc:creator>
      <dc:date>2001-12-21T02:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: repeat a same command-set in vi</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/repeat-a-same-command-set-in-vi/m-p/2634425#M42048</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Once your do an insert of a word, or any string, you can repeat the function by going to the next place where you wish to do it again and press .  This is like the repeat key.&lt;BR /&gt;&lt;BR /&gt;-Michael</description>
      <pubDate>Fri, 21 Dec 2001 03:00:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/repeat-a-same-command-set-in-vi/m-p/2634425#M42048</guid>
      <dc:creator>Michael Tully</dc:creator>
      <dc:date>2001-12-21T03:00:44Z</dc:date>
    </item>
    <item>
      <title>Re: repeat a same command-set in vi</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/repeat-a-same-command-set-in-vi/m-p/2634426#M42049</link>
      <description>Hi Tully,&lt;BR /&gt;&lt;BR /&gt;What I mean is to repeat a 'command-set', not (use . to repeat) a insert/append/delete/... command.&lt;BR /&gt;&lt;BR /&gt;Such as, is there something like " 10(w.) " to finish my above requirement, just insert the same word before each following words for 10 times.&lt;BR /&gt;&lt;BR /&gt;Sorry to assign a low point which I didn't assign before , but you just repeat what I have mentioned.&lt;BR /&gt;:-(&lt;BR /&gt;&lt;BR /&gt;/Discoverer</description>
      <pubDate>Fri, 21 Dec 2001 03:47:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/repeat-a-same-command-set-in-vi/m-p/2634426#M42049</guid>
      <dc:creator>discoverer</dc:creator>
      <dc:date>2001-12-21T03:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: repeat a same command-set in vi</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/repeat-a-same-command-set-in-vi/m-p/2634427#M42050</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Sorry I didn't understand your question properly, must be as I'm going on holidays....&lt;BR /&gt;&lt;BR /&gt;Okay, if you have a string called word1 and wanted to replace each occurance of word1 with word23 try&lt;BR /&gt;this in 'vi' &lt;BR /&gt;&lt;BR /&gt;:1,$s/word1/word23/g (global all occurance)&lt;BR /&gt;:1,$s/word1/word23/ (one on each line)&lt;BR /&gt;&lt;BR /&gt;If you want to insert a string at the beginning&lt;BR /&gt;of each line:&lt;BR /&gt;:1,$s/^/string//&lt;BR /&gt;&lt;BR /&gt;If this is not what you after exactly have a look at the link, it provides some good working examples of 'vi'&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.epcc.ed.ac.uk/tracs/vi.html#intermed4" target="_blank"&gt;http://www.epcc.ed.ac.uk/tracs/vi.html#intermed4&lt;/A&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;A href="http://www.networkcomputing.com/unixworld/tutorial/009/009.html" target="_blank"&gt;http://www.networkcomputing.com/unixworld/tutorial/009/009.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;-Michael&lt;BR /&gt;</description>
      <pubDate>Fri, 21 Dec 2001 04:02:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/repeat-a-same-command-set-in-vi/m-p/2634427#M42050</guid>
      <dc:creator>Michael Tully</dc:creator>
      <dc:date>2001-12-21T04:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: repeat a same command-set in vi</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/repeat-a-same-command-set-in-vi/m-p/2634428#M42051</link>
      <description>I'm not quite sure if I understand what you're after, but does a "10." help?&lt;BR /&gt;This will repeat the last command 10 times.&lt;BR /&gt;</description>
      <pubDate>Fri, 21 Dec 2001 06:12:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/repeat-a-same-command-set-in-vi/m-p/2634428#M42051</guid>
      <dc:creator>Deepak Extross</dc:creator>
      <dc:date>2001-12-21T06:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: repeat a same command-set in vi</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/repeat-a-same-command-set-in-vi/m-p/2634429#M42052</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;You want the the same word to be repeated before every word.&lt;BR /&gt;&lt;BR /&gt;Does this satisfy your requirement:&lt;BR /&gt;&lt;BR /&gt;:1,$s/ / insertedword /g&lt;BR /&gt;:1,$s/^/^insertedword /g&lt;BR /&gt;&lt;BR /&gt;Example:&lt;BR /&gt;&lt;BR /&gt;Before inserting:&lt;BR /&gt;The quick brown fox jumps over the lazy dog.&lt;BR /&gt;The quick brown fox jumps over the lazy dog.&lt;BR /&gt;&lt;BR /&gt;After inserting:&lt;BR /&gt;insertedword The insertedword quick insertedword brown insertedword fox insertedword jumps insertedword over insertedword the insertedword lazy insertedword dog.&lt;BR /&gt;insertedword The insertedword quick insertedword brown insertedword fox insertedword jumps insertedword over insertedword the insertedword lazy insertedword dog.&lt;BR /&gt;&lt;BR /&gt;Hope this helps. Regards.&lt;BR /&gt;&lt;BR /&gt;Steven Sim Kok Leong&lt;BR /&gt;Brainbench MVP for Unix Admin&lt;BR /&gt;&lt;A href="http://www.brainbench.com" target="_blank"&gt;http://www.brainbench.com&lt;/A&gt;</description>
      <pubDate>Fri, 21 Dec 2001 06:57:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/repeat-a-same-command-set-in-vi/m-p/2634429#M42052</guid>
      <dc:creator>Steven Sim Kok Leong</dc:creator>
      <dc:date>2001-12-21T06:57:36Z</dc:date>
    </item>
    <item>
      <title>Re: repeat a same command-set in vi</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/repeat-a-same-command-set-in-vi/m-p/2634430#M42053</link>
      <description>Hello discoverer,&lt;BR /&gt;&lt;BR /&gt;what you want is called a "macro" in vi.&lt;BR /&gt;It works like this:&lt;BR /&gt;- you put the keys to be "executed" into a buffer&lt;BR /&gt;- you tell vi to execute that buffer with "@".&lt;BR /&gt;&lt;BR /&gt;E.g:&lt;BR /&gt;Insert a line like&lt;BR /&gt;cwbye&lt;CTRL-V&gt;&lt;ESC&gt;&lt;ESC&gt;"mdd&lt;BR /&gt;where the stuff in angle brackets is actually keys (your hold down "Ctrl", then press "V", release both of them, and then press the "Esc" key, twice, then the double quote, an "m" and twice a "d").&lt;BR /&gt;Now you have the characters "cwbye&lt;ESC&gt;" in buffer "m".&lt;BR /&gt;Move your cursor to some word you would like to change to "bye" and press "@m".&lt;BR /&gt;Te repeat the last macro use "@@".&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Wodisc&lt;/ESC&gt;&lt;/ESC&gt;&lt;/ESC&gt;&lt;/CTRL-V&gt;</description>
      <pubDate>Fri, 21 Dec 2001 12:44:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/repeat-a-same-command-set-in-vi/m-p/2634430#M42053</guid>
      <dc:creator>Wodisch</dc:creator>
      <dc:date>2001-12-21T12:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: repeat a same command-set in vi</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/repeat-a-same-command-set-in-vi/m-p/2634431#M42054</link>
      <description>you could always map a key.&lt;BR /&gt;&lt;BR /&gt;:map t wwcw&lt;BR /&gt;&lt;BR /&gt;this would map the character t to two word commands and a change word command.  This can be done with any command. &lt;BR /&gt;to get return do &lt;CNTRL-V&gt;, m. to get esc do &lt;CNTRL-V&gt;, esc&lt;/CNTRL-V&gt;&lt;/CNTRL-V&gt;</description>
      <pubDate>Fri, 21 Dec 2001 13:53:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/repeat-a-same-command-set-in-vi/m-p/2634431#M42054</guid>
      <dc:creator>Jeff Machols</dc:creator>
      <dc:date>2001-12-21T13:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: repeat a same command-set in vi</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/repeat-a-same-command-set-in-vi/m-p/2634432#M42055</link>
      <description>HeHe....&lt;BR /&gt;&lt;BR /&gt;I love this forum!&lt;BR /&gt;&lt;BR /&gt;Though Tully (&amp;amp; Steven)'s method is not so universal, but I'd like to assigned 10 pts for his total help.&lt;BR /&gt;&lt;BR /&gt;Jeff's is just as what I had though out.&lt;BR /&gt;Wodisc's is the same but more expert.&lt;BR /&gt;&lt;BR /&gt;And thanks for Deepak's attendant.&lt;BR /&gt;&lt;BR /&gt;/discoverer</description>
      <pubDate>Fri, 28 Dec 2001 08:22:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/repeat-a-same-command-set-in-vi/m-p/2634432#M42055</guid>
      <dc:creator>discoverer</dc:creator>
      <dc:date>2001-12-28T08:22:39Z</dc:date>
    </item>
  </channel>
</rss>

