copy-paste

copy-paste

Post by Jean-Michel LEON-FOUN-LI » Fri, 18 Jun 1999 04:00:00



Hello,

I would like to know if it is possible to copy and paste in the vi
editor. I am learning C++ programming (an absolute beginner), but the R
4.1 on my iMac does not have the backslash character. So, until my R5
CD-ROM arrives, maybe I could use this hack someone suggested to me.
Could someone tell me how to use the copy-paste?

Thanks in advance.

Jean-Michel

 
 
 

copy-paste

Post by Justin Trembla » Fri, 18 Jun 1999 04:00:00



> Hello,

> I would like to know if it is possible to copy and paste in the vi
> editor. I am learning C++ programming (an absolute beginner), but the R
> 4.1 on my iMac does not have the backslash character. So, until my R5
> CD-ROM arrives, maybe I could use this hack someone suggested to me.
> Could someone tell me how to use the copy-paste?

> Thanks in advance.

> Jean-Michel

You can get help with vi by typing "man vi". You can also access the
online help by typing :help (you'll see a menu if you start vi by itself,
i.e., no document name.) I'm pretty new to vi myself, and the only way I
know of to cut and paste is to use the delete command (esc d) and then
paste (esc p). Once you are in one of the "esc" modes, just hitting the
letter again repeats it.

-- Justin Tremblay

 
 
 

copy-paste

Post by Jason » Fri, 18 Jun 1999 04:00:00


Jean-Michel LEON-FOUN-LIN posted the following to comp.os.linux.powerpc:

Quote:>I would like to know if it is possible to copy and paste in the vi
>editor. I am learning C++ programming (an absolute beginner), but the R
>4.1 on my iMac does not have the backslash character. So, until my R5
>CD-ROM arrives, maybe I could use this hack someone suggested to me.
>Could someone tell me how to use the copy-paste?

vi has a "visual mode" -- type v in non-insert mode and use the various
cursor keys (hjkl or the arrow keys or various Ctrl- sequences) to
highlight the section you want to cut, then hit d to "cut" it or y to
"copy" it. You can "paste" with P or p (P pastes before the cursor,
p pastes after it).

--
Check out the comp.sys.mac.advocacy FAQ
http://www.pobox.com/~ericb/csmafaq/

muahahahahahahaha!!!snap!snap!!snap!!photoshop!!
  -- Ho You Kong

 
 
 

copy-paste

Post by Rich Hal » Fri, 18 Jun 1999 04:00:00



> Hello,

> I would like to know if it is possible to copy and paste in the vi
> editor. I am learning C++ programming (an absolute beginner), but the R
> 4.1 on my iMac does not have the backslash character. So, until my R5
> CD-ROM arrives, maybe I could use this hack someone suggested to me.
> Could someone tell me how to use the copy-paste?

> Thanks in advance.

> Jean-Michel

If you're running vi in an Xwindow, you can also do Xcopy and paste.
Select the text like on a Mac or PC, use vi commands to move to where
you want to paste, make sure you are in insert mode and use the middle
mouse button paste. Be careful if a section of text your copying is more
than one line long, you may not get the effect you desire, especially
wrt to the CR/LF at the end of lines. It's far safer to use vi yank and
paste, but takes some getting used to. I would stronly recommend the
Nutshell book on vi, or at least one of the many quick reference cheat
sheets available (there are several out on the net, I printed one and
laminated it to have it handy). Vi is a strange beast. At first glance
it seems like it doesn't do much and is counter intuitive, but the more
you use it the more powerful it becomes!

Also remember that most vi commands can be modified to alter their
scope. Thus d (delete, like cut) or y (yank, like copy) will cut/copy
the character the cursor is on 2d 2y will take the next character as
well. 2dw will yank 2 words and so on.

Re your missing backslash, vi also has the ability to map special
functions and create small macros. You could for example look up the
ascii character number for \ and create a map in vi so that you could
generate it quickly from the keyboard. Hope this helps.

-Rich

 
 
 

1. Help required to fix copy-paste problem

Dear Linux users,

I used to access X-applications on FreeBSD and Sun Solaris machines
through a MS-Windows'98 using X-WIN32 4.1.1 (StarNet Comp.).
However, since all our systems are changed into Linux, I found I
cannot do copy-paste between an application in MS-Windows and an
X-application in Linux with X-WIN32. For example, if I copy text
into Windows clipboard, I cannot paste it into an xterm of a Linux
system and it is the same vice versa. For xterm, I can temporarily
fix the problem by using the freeware putty.exe instead of X-WIN32
+xterm. But putty.exe does not allow other x-applications.

So I wonder whether any of you encounters this problem or not.
If yes, is it caused by a poor setup of the Linux or X-WIN32?
If yes, how can I fix it. If not, which x-servers for MS-Windows
will work with Linux for this regard? The latest version of X-WIN32,
XFree86 or something else? Thanks a lot.

Sincerely,
Paul.

2. Solaris 2.5.1 on Tyan Tomcat 3 1563D M/B

3. Copy-Paste between KWrite and Netscape

4. Solution for unavailable printer driver?

5. Using 'Copy-Paste' in GUI help

6. CD-RW drive via PCMCIA SCSI drivers?

7. GPL and copy-paste

8. Changing sending ports in the middle of a job

9. Copy-paste operations in X

10. copy-paste on PowerBook

11. Copy-paste operations in X

12. COPY-PASTE == `head -c 1k oldfile > newfile` !?