Hello,
This mail is very very late, so my sincerest apologies to V Suresh. What
had happened was that i started a reply then had to save it my Drafts
folder where it skipped my mind. Suresh, you probably must have figured
out the answer to your query already, but i am still posting my reply in
case you haven't or if any out there wants to know the same thing.


Regards,
mario


V Suresh wrote:
> 
> How do I select, cut paste copy text, in VI?
> 
> Regards,
> 
> V Suresh.
> 
> *****************************************************************
> 
> Powered by Linux!!!
> 
> Support Free Software -- www.gnu.org <http://www.gnu.org>
> 
> *****************************************************************
> 
> 
> 
> ----------------------------------------------
> The mailing list archives are available at
> http://lists.linux-india.org/cgi-bin/wilma/linux-india-help

If you use gvim, i.e the gui version of vim (requires X-Windows) then
you can use the mouse to select text and the menu to choose what to do
with the selection i.e cut, copy, paste.

If you are using plain vim or vi, then you can try the following in
command mode:
move the cursor to the line you want to copy press "y" to yank i.e copy
it. or "dd" to delete i.e cut it
move the cursor to the place where you want to insert the text and then
press "p"

if you want to do this across different files, then you must specify a
buffer to store the text. A bit tricky but fun once you start to use it.
follow the same steps above for copying the text but only this time
start the sequence by pressing '"a"

to copy more than one line of text, move the cursor to the first line,
then count the lines below that line you want copied then simply type '
"[a - z][number][y]<enter> '
Foe example I want to copy 6 lines of text to a buffer. this buffer will
be called "a" you can use any other alphabet you want. move the cursor
to the first line i want to copy, now there will be 5 lines below it in
addition to the first line i want to copy so i type in command mode:
"a5y<enter>

you can now open another file in the same vim session, and to paste the
text there, move the cursor to the line where the text should be pasted,
specify the buffer by using the "a then press p to paste.
eg.

"ap will paste the text you stored in buffer "a" 
it's as simple as that.

_______________________________________________
linux-india-help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/linux-india-help

Reply via email to