copying from vi to clipboard does not over writes clip board buffer

Tapas Mishra mightydreams at gmail.com
Wed Feb 16 12:34:54 UTC 2011


On Wed, Feb 16, 2011 at 5:45 PM, Tapas Mishra <mightydreams at gmail.com> wrote:
> On Wed, Feb 16, 2011 at 4:37 PM, Alan Pope <popey at ubuntu.com> wrote:
>> On 16 February 2011 09:59, Tapas Mishra <mightydreams at gmail.com> wrote:
>>> On Wed, Feb 16, 2011 at 1:55 PM, Mark Widdicombe
>>> <mwiddicombe at shoprite.co.za> wrote:
>>>>>From: ubuntu-users-bounces at lists.ubuntu.com [ubuntu-users-bounces at lists.ubuntu.com] On Behalf Of Tapas Mishra [mightydreams at gmail.com]
>>>>>Sent: 16 February 2011 10:10
>>>>>Here is a situation
>>>>>Situation A
>>>> ---------------------------------------
>>>>>I open a text file in vi
>>>>>and scroll to some line
>>>>>now press Esc
>>>>>and :"+yy
>>>>>the line gets yanked
>>>>>I open gedit and Ctrl+V
>>>>>and then I see the line is pasted.
>>>>
>>>>>Situation B
>>>>>------------------------------------------------
>>>>>But the same does not work for a different situation.
>>>>>Suppose I opened some link in Firefox and do a Ctrl+C and in gedit I do Ctrl+V
>>>>>then I can see the link getting pasted but if now I repeat the steps I
>>>>>described above in Situation A
>>>>>then each time on gedit I do not see the text from vi copied but the
>>>>>link repeated which I do not expect
>>>>>because it should have been over written by the yanked line and the
>>>>>previous link of firefox should not be copied.
>>>> The yy command in vi does not place the lines you yanked into the clipboard,
>>>> it places them in vi's undo buffer.  You should not be able to paste yanked lines
>>>> into another application; for that you should highlight and *copy* the
>>>> lines to the clipboard.
>>>>
>>> Please read the message before you answer.
>>>
>>
>> Tapas,
>>
>> With respect. People have read your message and have explained to you
>> that what you _expect_ to happen is not what is _designed_ to happen.
>>
>> Situation A: vi does _not_ yank to the clipboard used by your desktop
>> environment, so pasting will not have the effect you desire
>
> Excerpts
> From the vim help
> 4. Making Gui Selections
>  *clipboard*
> There is a special register for storing this selection, it is the "*
> register.  Nothing is put in here unless the information about what text is
> selected is about to change (e.g. with a left mouse click somewhere), or when
> another application wants to paste the selected text.  Then the text is put
> in the "* register.  For example, to cut a line and make it the current
> selection/put it on the clipboard: >
>
>
I forgot to mention check this thread how to use yank of vi to put the
copied line to system clip boards buffer
http://ubuntuforums.org/showthread.php?t=1686955
I have a feeling what I asked here on this list seems a bug to me.
It is a lesser known feature of vi and it works in one case it should
work in other case also.
--




More information about the ubuntu-users mailing list