Copy pasting in VI withjout a mouse.

Copy pasting in VI withjout a mouse.

Post by Prasad Ajink » Fri, 29 Nov 2002 22:24:19



Hey all!!
I have just started programming in linux and have to do most of my
coding in VI or VIM

Now some of the pcs in my office do not have a mouse, so my question
is...
How can i copy paste in VI without a mouse??
(ya i know yanking and pasting can work)....but heres where things get
tricky....my pc has windows as the default operatiing system, and i
connect to the unix based server through a putty session, so all the
coding is done on the unix machine via a putty session....now when i
have to copy some stuff from my machine to the vi window, what i
normally do is press Ctrl + V and then right click in the VI
window....
herein lies the main problem...How can i right click if i dont have a
mouse? :-)

Please do reply cos i m really stumped with this situation

Many Thanx in Advance,
Regards,
Prasad A.

 
 
 

Copy pasting in VI withjout a mouse.

Post by dav.. » Sat, 30 Nov 2002 00:51:04



> herein lies the main problem...How can i right click if i dont have a
> mouse? :-)

Well, you don't. If you just enter in "insert" mode and press
CTRL+INS it will do.

Davide

 
 
 

Copy pasting in VI withjout a mouse.

Post by tom » Sat, 30 Nov 2002 08:43:49


http://dcfonline.sfu.ca/ying/linux/vi/

Print this up.  It is a 1 page short cut pdf document
on the most basic vi movement skills...

yy  - yank line ( copy to buffer )
p   - paste from buffer


> Hey all!!
> I have just started programming in linux and have to do most of my
> coding in VI or VIM

> Now some of the pcs in my office do not have a mouse, so my question
> is...
> How can i copy paste in VI without a mouse??
> (ya i know yanking and pasting can work)....but heres where things get
> tricky....my pc has windows as the default operatiing system, and i
> connect to the unix based server through a putty session, so all the
> coding is done on the unix machine via a putty session....now when i
> have to copy some stuff from my machine to the vi window, what i
> normally do is press Ctrl + V and then right click in the VI
> window....
> herein lies the main problem...How can i right click if i dont have a
> mouse? :-)

> Please do reply cos i m really stumped with this situation

> Many Thanx in Advance,
> Regards,
> Prasad A.

 
 
 

Copy pasting in VI withjout a mouse.

Post by Bruce Burhan » Sat, 30 Nov 2002 09:06:51



Quote:> Hey all!!
> I have just started programming in linux and have to do most of my
> coding in VI or VIM

> Now some of the pcs in my office do not have a mouse, so my question
> is...
> How can i copy paste in VI without a mouse??
> (ya i know yanking and pasting can work)....but heres where things get
> tricky....my pc has windows as the default operatiing system, and i
> connect to the unix based server through a putty session, so all the
> coding is done on the unix machine via a putty session....now when i
> have to copy some stuff from my machine to the vi window, what i
> normally do is press Ctrl + V and then right click in the VI
> window....
> herein lies the main problem...How can i right click if i dont have a
> mouse? :-)

> Please do reply cos i m really stumped with this situation

> Many Thanx in Advance,
> Regards,
> Prasad A.

In the command mode,    type ma  (a-z,A-Z)  at
the place where you want to begin copying.  The
m  means  'mark' .  We'll  assume  you chose
buffer  a.

Then run the cursor down to the last  line you want to copy and do
y`a

That's a backtick.

Now  get the :  prompt and type
:  edit  name-of-file-you-want-to-paste-to

(be sure to :w  the file before all this, if you have
edited it in any way.)

In the new file,  run the cursor where  to where you want to paste to begin
and hit   p  in command-mode.

If you open the first  file in less, first,  and hit v to go to
vi  ($EDITOR should be set to vi )  then when you
finish the pasting operation and close the file, you
will find the first file is still open in less.   Handy.

HTH

Bruce
--
     Bellingham   Washington   USA
     bburhan1  [ AT]   earthlink  [ DOT]  net

 
 
 

Copy pasting in VI withjout a mouse.

Post by Andrew B Rye I » Tue, 04 Mar 2003 00:10:44


Buy a three button mouse. Their cheap! Without one
do this to read the contents of a file into the current
file at the curser position;

:!r cat <filename of the file to insert>

"dd" any lines you don't need! something like

"100dd" would delete the next 100 lines.


> Hey all!!
> I have just started programming in linux and have to do most of my
> coding in VI or VIM

> Now some of the pcs in my office do not have a mouse, so my question
> is...
> How can i copy paste in VI without a mouse??
> (ya i know yanking and pasting can work)....but heres where things get
> tricky....my pc has windows as the default operatiing system, and i
> connect to the unix based server through a putty session, so all the
> coding is done on the unix machine via a putty session....now when i
> have to copy some stuff from my machine to the vi window, what i
> normally do is press Ctrl + V and then right click in the VI
> window....
> herein lies the main problem...How can i right click if i dont have a
> mouse? :-)

> Please do reply cos i m really stumped with this situation

> Many Thanx in Advance,
> Regards,
> Prasad A.

--
----------------------------
Skip Rye
----------------------------

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----

 
 
 

Copy pasting in VI withjout a mouse.

Post by Dances With Crow » Tue, 04 Mar 2003 00:43:43


On Sun, 02 Mar 2003 10:10:44 -0500, Andrew B Rye II staggered into the
Black Sun and said:

Don't top-post.  Message rearranged to comply with Usenet conventions.


>> How can i copy paste in VI without a mouse??  (ya i know yanking and
>> pasting can work)....but heres where things get tricky....my pc has
>> windows as the default operatiing system, and i connect to the unix
>> based server through a putty session, so all the coding is done on
>> the unix machine via a putty session....now when i have to copy some
>> stuff from my machine to the vi window, what i normally do is press
>> Ctrl + V and then right click in the VI window....  herein lies the
>> main problem...How can i right click if i dont have a mouse? :-)

'Doze machines without mice?  Totally weird.  You'd think the users
would complain vociferously.

Quote:> Buy a three button mouse. Their cheap!

Their cheap *what*?  (their != they're != there.)

Quote:> Without one do this to read the contents of a file into the current
> file at the curser position;
>:!r cat <filename of the file to insert>

True, but this won't directly help Prasad.  If you read what he wrote
again, he is using a 'Doze machine, without a mouse, to ssh into a Linux
box.  He wants to know how to copy a bit of text from his 'Doze session
into his Linux ssh session, without using a mouse.  This may be somewhat
tricky, depending on which other 'Doze programs Prasad is using, but the
thing I'd do is Alt-Tab over to the window where the text is, hold down
Shift+Ctrl, and use the arrow keys to maneuver over the text that needs
to be copied.  Then press Ctrl-C or whatever.  Then Alt-Tab back into
PuTTY, and press PuTTY's "paste" shortcut keys, which are *not* Ctrl-V
or Ctrl-Insert, but Shift-Insert.  This was in the PuTTY documentation,
http://the.earth.li/~sgtatham/putty/0.53b/puttydoc.txt , which I suggest
Prasad read if he's going to be using PuTTY extensively.

--
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
Brainbench MVP for Linux Admin /
http://www.brainbench.com     /  "He is a rhythmic movement of the
-----------------------------/    penguins, is Tux." --MegaHAL

 
 
 

Copy pasting in VI withjout a mouse.

Post by Bill Unr » Tue, 04 Mar 2003 02:27:45



]Buy a three button mouse. Their cheap! Without one

You can get a two button mouse to imitate a three button by pressing the
two buttons at the same time instead of the third middle button.

Youneed to put a line into /etc/X11/XF86Config (or -4) telling X to
emulate a three button mouse.
Option "Emulate3Timeout" "50"
is I think the phrase. (As I recall the 50 is the max number of milliseconds
between the two presses  to be regarded as "together")
This is under the Mouse section.

]do this to read the contents of a file into the current
]file at the curser position;

]:!r cat <filename of the file to insert>
  ^ Why this? Youdo not want the exclamation point, it requests an
  external shell.
  But he wants to copy and paste from a Windows window into vi without a
  mouse. I do not know of any way of doing that.

  Buy a mouse.

]"dd" any lines you don't need! something like

]"100dd" would delete the next 100 lines.

]> Hey all!!
]> I have just started programming in linux and have to do most of my
]> coding in VI or VIM
]>
]> Now some of the pcs in my office do not have a mouse, so my question
]> is...
]> How can i copy paste in VI without a mouse??
]> (ya i know yanking and pasting can work)....but heres where things get
]> tricky....my pc has windows as the default operatiing system, and i
]> connect to the unix based server through a putty session, so all the
]> coding is done on the unix machine via a putty session....now when i
]> have to copy some stuff from my machine to the vi window, what i
]> normally do is press Ctrl + V and then right click in the VI
]> window....
]> herein lies the main problem...How can i right click if i dont have a
]> mouse? :-)
]>
]> Please do reply cos i m really stumped with this situation
]>
]> Many Thanx in Advance,
]> Regards,
]> Prasad A.

]--
]----------------------------
]Skip Rye
]----------------------------

]-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
]http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
]-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----