vi question??

vi question??

Post by Suresh Narayan » Fri, 26 Nov 1993 15:24:10



I need to know how I could get say three words in vi ..like
abcd efgh ijkl in separate lines using the substitute string search
at the command line .. at the :
Is there any command syntax which would replace all spaces between the
words to new lines...
All help appreciated
Thanks
Suresh

--
______________________________________________________________________

SURESH NARAYANAN
3402 Pearl Street, #4                           School:S.S. Box 8246
Hattiesburg, MS 39401                           Hattiesburg, MS 39406
Phone: (601) 261-3396                           PHONE : (601) 266-4240



_________________________________________________________________________
Quotable Quotes:

" The more you know, the harder it is to take decisive action. "
" Once you become informed, you start seeing complexities and shades
  of gray. "
" You realize that nothing is as clear and simple as it first appears.
  Ultimately, knowledge is paralyzing. "
" Being a man of action, I can't afford to take that risk. "
" Don't approach a goat from the front, a horse from the back, or a fool
  from any side. "
________________________________________________________________________

 
 
 

vi question??

Post by Scott A Yano » Fri, 26 Nov 1993 15:57:35



Quote:

> I need to know how I could get say three words in vi ..like
> abcd efgh ijkl in separate lines using the substitute string search
> at the command line .. at the :
> Is there any command syntax which would replace all spaces between the
> words to new lines...
> All help appreciated

yeah, once in vi, type:

:%s/abcd /abdc /g

This will perform a global substitution of "abcd " with "abcd "

The , or control-M, is the newline you will want.
In order to get that to appear as seen above, where you see above I have
, you would want to hit: Control-v control-m

-Scott
--


! ! ! !! ! ! !~~__=||_~ ~~~ Computing Services Division - MAINFRAME CONSULTING


 
 
 

vi question??

Post by Alexander Ha » Fri, 26 Nov 1993 20:13:13


|> I need to know how I could get say three words in vi ..like
|> abcd efgh ijkl in separate lines using the substitute string search
|> at the command line .. at the :
|> Is there any command syntax which would replace all spaces between the
|> words to new lines...

Try something like

:%s/abcd efgh ijkl/abcd efgh ijkl/g

You get the by typing a <Ctrl v> followed by <RETURN>

Hope this helps.

Alex

+--------------------------------------------------------------------+
|  _|||_  |          Es kommt immer anders, wenn man denkt.          |
|  <*,*>  |                                                          |
|  [`-']  |       Software is a place where dreams are planted       |
|  -"-"-  |               and nightmares harvested...                |
|--------------------------------------------------------------------|


| GMD Research Group at the | phone: +49-721/6622-34       |  [`-']  |
| University of Karlsruhe   | fax:   +49-721/6622-968      |  -"-"-  |
+--------------------------------------------------------------------+

 
 
 

vi question??

Post by Des Herrio » Fri, 26 Nov 1993 20:51:09



>I need to know how I could get say three words in vi ..like
>abcd efgh ijkl in separate lines using the substitute string search
>at the command line .. at the :
>Is there any command syntax which would replace all spaces between the
>words to new lines...

 :s/ /^M/g

You can get ^M (or any control character) by pressing CTRL-v, followed
by the control character you want.

If you want to run this substitution on all lines in the file, simply
place a '%' sign before the 's' in the above command.

--
Des Herriott,           /     "Hey, now that I've got all this
Micro Focus, Newbury.  /       virtual memory, I'm gonna build
+44 (0635) 565354     /           me a real big RAM disk!"

 
 
 

1. vi question - unknown terminal type

Recently, I added some new termcap entries to the end of our /etc/termcap
file.  Everything seems to work O.K. with these terminals, EXCEPT vi.  
When vi is started, we get an 'Unknown terminal type' message.  The terminal
name IS in /etc/termcap.  Where else does vi look?  What might be the problem?

--

Microelectronics Reliability Division          |            COMPMAIL:  e.ratazzi
Rome Laboratory                                |                  (315) 330-2946
"Exploring the Invisible Frontier"             |                    DSN 587-2946

2. X-Windows: doesn't like Trident 9400CXi?

3. One vi question

4. Mustek Parallel Port Scanners??

5. a vi question!!

6. Unerase Tape ?

7. vi question

8. redirection to socket.

9. VI Question - so answer it!

10. vi questions

11. vi question - mapping a function key in .exrc file that uses a yanked word

12. vi question (I already read the FAQ)

13. vi question