vi editor 
Author Message
 vi editor

Is there a way with vi to mark a block of text for copying.
The only way I know is with the yank command?

Thanx, LVF



Sat, 29 May 1999 03:00:00 GMT  
 vi editor

Quote:

>Is there a way with vi to mark a block of text for copying.
>The only way I know is with the yank command?

While we are at it, is there a way to add a footnote to a
section heading in LaTeX2e? Or to invert a 3x3 matrix in
Maple without using the linalg package?

comp.lang.c is _not_ the only newsgroup on usenet.

Kurt

--
| Kurt Watzka                             Phone : +49-89-2180-6254



Sat, 29 May 1999 03:00:00 GMT  
 vi editor

Quote:

> Is there a way with vi to mark a block of text for copying.
> The only way I know is with the yank command?

> Thanx, LVF

Yea... use emacs!


Sat, 29 May 1999 03:00:00 GMT  
 vi editor

Quote:


> > Is there a way with vi to mark a block of text for copying.
> > The only way I know is with the yank command?

> > Thanx, LVF

Try :kc where c is any character. Mark the beginning with a block with
:ka and the end of the block with :kb and then use something like
:'a,'bm<line#> (These are ed commands which most vi supports).


Sat, 29 May 1999 03:00:00 GMT  
 vi editor

Quote:

>Is there a way with vi to mark a block of text for copying.
>The only way I know is with the yank command?

>Thanx, LVF

The POSIX.2 vi standard defines a method for marking positions in text. Marks
are named using lower case letters and digits.

You go to the beginning of the block of text and set a mark, for example,
by typing   ma   (``set mark a here''). Some letter other than 'a' could have
been choise, of course. You then go to the end of the text you want to pull out
and type    y'a   (``move to mark a and yank''). This will do a line-precision
yank, which will include the whole line containing mark a. If you want a
character-precision move/yank, use `a instead of 'a to do the move (that is,
use a backtick rather than forward tick).  Of course, you can use other
prefixes, like 'd' to delete, 'c' to change, etc.

If that doesn't appeal to you, get Vim, a vi-compatible freeware replacement,
which has a (non standard) method for visual text selection (and also has an
optional X11/Motif or Athena GUI).



Sat, 29 May 1999 03:00:00 GMT  
 vi editor

Quote:

> Is there a way with vi to mark a block of text for copying.
> The only way I know is with the yank command?

You might do better asking your question in one of the Unix forums
comp.unix.questions might be a good place to start.

comp.unix.programmer might also be helpful.

Note: Asking questions unrelated to the ANSI/ISO C Standard (what
comp.lang.c is all about) will very likely get you some rather
unpleasant responses.  To forestall this I have posted this response, as
well as, e:mailed it to you.

Alicia Carla Longstreet
E Pluribus Modem

P.S. I believe that if you use a lower case y for the yank command that
this will do what you want i.e. make a copy of the selected text.



Sun, 30 May 1999 03:00:00 GMT  
 vi editor


:  
: > Is there a way with vi to mark a block of text for copying.
: > The only way I know is with the yank command?

: You might do better asking your question in one of the Unix forums
: comp.unix.questions might be a good place to start.

: comp.unix.programmer might also be helpful.

Actually, comp.editors is the best forum on editor questions.

: Note: Asking questions unrelated to the ANSI/ISO C Standard (what
: comp.lang.c is all about) will very likely get you some rather
: unpleasant responses.  To forestall this I have posted this response, as
: well as, e:mailed it to you.

Posting asinine answers also results in unpleasant responses. I guess
you should know that by now. :-)

: Alicia Carla Longstreet
: E Pluribus Modem

: P.S. I believe that if you use a lower case y for the yank command that
: this will do what you want i.e. make a copy of the selected text.

Your beliefs are as wrong about vi as they are about C. "m" is the
character that makes a mark followed by a lowercase letter that
represents the mark, "ma". Then you can yank to the mark with "y'a" to
do line based yanking and "y`a" to do character based.

--

If it doesn't work, you're doing it wrong,
If it does, you just got lucky.



Mon, 31 May 1999 03:00:00 GMT  
 vi editor


:
: > Is there a way with vi to mark a block of text for copying.
: > The only way I know is with the yank command?

: You might do better asking your question in one of the Unix forums
: comp.unix.questions might be a good place to start.

Come off it! Where would C be today without vi?

C owes its very existence to things like vi....



Mon, 31 May 1999 03:00:00 GMT  
 vi editor



Quote:

>> Is there a way with vi to mark a block of text for copying.
>> The only way I know is with the yank command?
>P.S. I believe that if you use a lower case y for the yank command that
>this will do what you want i.e. make a copy of the selected text.

Hmm. You don't know vi, yet claim that Brief is more powerful than it (and
Emacs). Have you been secretly{*filter*} out with Scott Nudds?


Mon, 31 May 1999 03:00:00 GMT  
 vi editor



Quote:


>:
>: > Is there a way with vi to mark a block of text for copying.
>: > The only way I know is with the yank command?

>: You might do better asking your question in one of the Unix forums
>: comp.unix.questions might be a good place to start.

>Come off it! Where would C be today without vi?

>C owes its very existence to things like vi....

Where would C be without troff? The ANSI standard is typeset using troff.
(It's not stated that it is, but I can plainly recognize the familiar
output).

Given that it's typeset in troff, it's very likely that it had been edited
with vi.



Mon, 31 May 1999 03:00:00 GMT  
 vi editor



Quote:


> :
> : > Is there a way with vi to mark a block of text for copying.
> : > The only way I know is with the yank command?

> : You might do better asking your question in one of the Unix forums
> : comp.unix.questions might be a good place to start.

> Come off it! Where would C be today without vi?
> C owes its very existence to things like vi....

Fortunately, we're past all that now.  And she's right.  The question was
not topical.  Even UNIX folks have switched to EMACS or other superior
alternatives by now anyway.


Mon, 31 May 1999 03:00:00 GMT  
 vi editor


Quote:
>Fortunately, we're past all that now.  And she's right.  The question was
>not topical.  Even UNIX folks have switched to EMACS or other superior
>alternatives by now anyway.

don't tell that to the Unix folks who switched from GNUmacs to vi.
like me.
--
        "...Everybody got this broken feeling
         like their father or their dog just died..."
                                                        - Leonard Cohen


Tue, 01 Jun 1999 03:00:00 GMT  
 vi editor

|> Is there a way with vi to mark a block of text for copying.
|> The only way I know is with the yank command?

Aside from the fact that 'vi' is probably written in C (just a guess),
you'd probably want to ask on a newsgroup like comp.editors.
--
"If it wasn't for C, we would be using BASI, PASAL, and OBOL."




Wed, 02 Jun 1999 03:00:00 GMT  
 vi editor

Lies!  The true programmer could just do:

cat > file.c
foo() { return 3; }
^D

--




----------------------------------------------------------------------



Sat, 05 Jun 1999 03:00:00 GMT  
 
 [ 14 post ] 

 Relevant Pages 

1. Plug-in VI editor for Borlands IDE ? ? ?

2. vi keybindings in VC++ Editor?

3. VC++ 6.0 Editor Emulates VI?

4. Borland Editor like vi?

5. X Window vi-like editor for C/C++?

6. vi or emacs key binding in visual c++

7. The Vi Lovers Home Page

8. The Vi Lovers Home Page

9. Vi Lovers Home Page renewed

10. summary followup: Vi macros for C programming

11. Vi macros for C programming

12. question re: vi within curses

 

 
Powered by phpBB® Forum Software