Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
gvim auto copy selected text to clipboard
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  21 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Sergey Vakulenko  
View profile  
 More options Apr 20 2012, 7:56 am
From: Sergey Vakulenko <svakulenk...@gmail.com>
Date: Fri, 20 Apr 2012 04:56:15 -0700 (PDT)
Local: Fri, Apr 20 2012 7:56 am
Subject: gvim auto copy selected text to clipboard
Hi

I wonder, how i can enable auto copy of selected text into '+'
register in Ubuntu (to share clipboard between apps)?
i have  set guioptions+=a        (in win32, this works perfectly )

Please do not offer hand-click solutions like vmap <C-Insert> "+y


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marcin Szamotulski  
View profile  
 More options Apr 20 2012, 1:26 pm
From: Marcin Szamotulski <msza...@gmail.com>
Date: Fri, 20 Apr 2012 18:26:11 +0100
Local: Fri, Apr 20 2012 1:26 pm
Subject: Re: gvim auto copy selected text to clipboard
On 04:56 Fri 20 Apr     , Sergey Vakulenko wrote:

> Hi

> I wonder, how i can enable auto copy of selected text into '+'
> register in Ubuntu (to share clipboard between apps)?
> i have  set guioptions+=a        (in win32, this works perfectly )

> Please do not offer hand-click solutions like vmap <C-Insert> "+y

> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php

You can add unnamedplus to your 'clipboard' setting. See ":help 'cb'".
For example I use:
set clipboard=unnamedplus,unnamed,autoselect,exclude:cons|linux

Best regards,
Marcin Szamotulski


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sergey Vakulenko  
View profile  
 More options Apr 20 2012, 4:38 pm
From: Sergey Vakulenko <ppdl...@gmail.com>
Date: Fri, 20 Apr 2012 13:38:22 -0700 (PDT)
Local: Fri, Apr 20 2012 4:38 pm
Subject: Re: gvim auto copy selected text to clipboard
Hi Marcin

I tried, but this not works for me :(

set clipboard=unnamedplus,unnamed,autoselect,exclude:cons\|linux

test case:
1) open gvim
2)shift-v, move cursor and Esc (select lines in visual mode)
3)go to firefox and click ctrl-v or ctrl-Insert

here is what my gvim version show (+X11 +xterm_clipboard are onboard):

VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Oct  6 2011 10:19:44)
Included patches: 1-154
Modified by pkg-vim-maintain...@lists.alioth.debian.org
Compiled by buildd@
Huge version with GTK2 GUI.  Features included (+) or not (-):
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset
+cindent +clientserver +clipboard +cmdline_compl +cmdline_hist
+cmdline_info +comments +conceal +cryptv +cscope
+cursorbind +cursorshape +dialog_con_gui +diff +digraphs +dnd -ebcdic
+emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path
+find_in_path +float +folding -footer +fork()
+gettext -hangul_input +iconv +insert_expand +jumplist +keymap
+langmap +libcall +linebreak +lispindent +listcmds +localmap +lua
+menu +mksession +modify_fname +mouse +mouseshape
+mouse_dec +mouse_gpm -mouse_jsbterm +mouse_netterm -mouse_sysmouse
+mouse_xterm +multi_byte +multi_lang -mzscheme +netbeans_intg -
osfiletype +path_extra +perl +persistent_undo
+postscript +printer +profile +python -python3 +quickfix +reltime
+rightleft +ruby +scrollbind +signs +smartindent -sniff +startuptime
+statusline -sun_workshop +syntax +tag_binary
+tag_old_static -tag_any_white +tcl +terminfo +termresponse
+textobjects +title +toolbar +user_commands +vertsplit +virtualedit
+visual +visualextra +viminfo +vreplace +wildignore
+wildmenu +windows +writebackup +X11 -xfontset +xim +xsmp_interact
+xterm_clipboard -xterm_save

On Apr 20, 7:26 pm, Marcin Szamotulski <msza...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Fritz  
View profile  
 More options Apr 20 2012, 4:50 pm
From: Ben Fritz <fritzophre...@gmail.com>
Date: Fri, 20 Apr 2012 13:50:15 -0700 (PDT)
Local: Fri, Apr 20 2012 4:50 pm
Subject: Re: gvim auto copy selected text to clipboard

On Friday, April 20, 2012 3:38:22 PM UTC-5, Sergey Vakulenko wrote:
> Hi Marcin

> I tried, but this not works for me :(

> set clipboard=unnamedplus,unnamed,autoselect,exclude:cons\|linux

> test case:
> 1) open gvim
> 2)shift-v, move cursor and Esc (select lines in visual mode)
> 3)go to firefox and click ctrl-v or ctrl-Insert

Normally the selection register is pasted with a middle-click of the mouse, not with CTRL-V. 'clipboard' containing autoselect should allow this. I have no idea whether it is possible to paste the selection with CTRL-V, but I don't think it is Vim which controls this.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
flebber  
View profile  
 More options Apr 21 2012, 3:30 am
From: flebber <flebber.c...@gmail.com>
Date: Sat, 21 Apr 2012 00:30:59 -0700 (PDT)
Local: Sat, Apr 21 2012 3:30 am
Subject: Re: gvim auto copy selected text to clipboard

On Apr 21, 6:50 am, Ben Fritz <fritzophre...@gmail.com> wrote:

> On Friday, April 20, 2012 3:38:22 PM UTC-5, Sergey Vakulenko wrote:
> > Hi Marcin

> > I tried, but this not works for me :(

> > set clipboard=unnamedplus,unnamed,autoselect,exclude:cons\|linux

> > test case:
> > 1) open gvim
> > 2)shift-v, move cursor and Esc (select lines in visual mode)
> > 3)go to firefox and click ctrl-v or ctrl-Insert

> Normally the selection register is pasted with a middle-click of the mouse, not with CTRL-V. 'clipboard' containing autoselect should allow this. I have no idea whether it is possible to paste the selection with CTRL-V, but I don't think it is Vim which controls this.

Well if you pasted it correctly you used a forward slash and not a
pipe.

> set clipboard=unnamedplus,unnamed,autoselect,exclude:cons\|linux

Should be |linux

and ubuntu should be CTRL+SHIFT+V  usually.

Sayth


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Christian Brabandt  
View profile  
 More options Apr 21 2012, 4:17 am
From: Christian Brabandt <cbli...@256bit.org>
Date: Sat, 21 Apr 2012 10:17:37 +0200
Local: Sat, Apr 21 2012 4:17 am
Subject: Re: gvim auto copy selected text to clipboard
Hi flebber!

On Sa, 21 Apr 2012, flebber wrote:

> > set clipboard=unnamedplus,unnamed,autoselect,exclude:cons\|linux

> Should be |linux

No it shouldn't, since this is used as a pattern.

> and ubuntu should be CTRL+SHIFT+V  usually.

depends on the desktop environment / window manager.

regards,
Christian
--


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sergey Vakulenko  
View profile  
 More options Apr 21 2012, 9:21 am
From: Sergey Vakulenko <svakulenk...@gmail.com>
Date: Sat, 21 Apr 2012 06:21:44 -0700 (PDT)
Local: Sat, Apr 21 2012 9:21 am
Subject: Re: gvim auto copy selected text to clipboard

>Normally the selection register is pasted with a middle-click of the mouse, not with CTRL-V. 'clipboard' containing autoselect should allow
>this. I have no idea whether it is possible to paste the selection with CTRL-V, but I don't think it is Vim which controls this.

Im not use mouse for copy paste. Also, i used this feature (copy on
select) on Win XP 4 years. I cant understand how i cant do the same in
Ubuntu.

Please, help me!

On Apr 21, 10:17 am, Christian Brabandt <cbli...@256bit.org> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Christian Brabandt  
View profile  
 More options Apr 21 2012, 9:36 am
From: Christian Brabandt <cbli...@256bit.org>
Date: Sat, 21 Apr 2012 15:36:51 +0200
Local: Sat, Apr 21 2012 9:36 am
Subject: Re: gvim auto copy selected text to clipboard
Hi Sergey!

On Sa, 21 Apr 2012, Sergey Vakulenko wrote:

> >Normally the selection register is pasted with a middle-click of the mouse, not with CTRL-V. 'clipboard' containing autoselect should allow
> >this. I have no idea whether it is possible to paste the selection with CTRL-V, but I don't think it is Vim which controls this.

> Im not use mouse for copy paste. Also, i used this feature (copy on
> select) on Win XP 4 years. I cant understand how i cant do the same in
> Ubuntu.

Either yank it using y and then Ctrl-V should simply work, or use a
clipboard manager like parcellite, that syncs primary selection and the
clipboard.

regards,
Christian

--
Wer lange genug gelebt hat, hat alles gesehen und auch das Gegenteil
von allem.
                -- Charles Maurice de Talleyrand


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gary Johnson  
View profile  
 More options Apr 21 2012, 6:26 pm
From: Gary Johnson <garyj...@spocom.com>
Date: Sat, 21 Apr 2012 15:26:27 -0700
Local: Sat, Apr 21 2012 6:26 pm
Subject: Re: gvim auto copy selected text to clipboard
On 2012-04-21, Sergey Vakulenko wrote:

> >Normally the selection register is pasted with a middle-click of the mouse, not with CTRL-V. 'clipboard' containing autoselect should allow
> >this. I have no idea whether it is possible to paste the selection with CTRL-V, but I don't think it is Vim which controls this.

> Im not use mouse for copy paste. Also, i used this feature (copy on
> select) on Win XP 4 years. I cant understand how i cant do the same in
> Ubuntu.

Windows and X use different models for sharing a "clipboard" between
applications.  There is only only Windows clipboard but there are
two X mechanisms: the selection and the clipboard.  See :help
x11-selection" for more on this.  This can be confusing because when
you "copy" in X, sometimes the copied text goes to the selection and
sometimes it goes to the clipboard.  Similarly, pasting may use
either of these as the source.  I'm sure it actually works very
consistently, but I've never completely understood it.

Here's what I have in my ~/.vimrc:

    if has("clipboard")
        set clipboard^=unnamed  " The "exclude:" entry, which is present by
                                " by default, must be last.  Therefore, put
                                " "unnamed" first.
    endif

With that, I am able to easily yank and paste between applications
including vim and gvim.  However, to paste into another X
application such as Firefox, I must use the mouse middle button.
Ctrl-V seems to use the other selection mechanism.

I tried changing "unnamed" to "unnamedplus" in the 'clipboard'
setting and was able to use Ctrl-V for pasting in Firefox, but then
was unable to use other mechanisms I was used to for copying and
pasting, so I went back to "unnamed".  I didn't investigate the
behaviors thoroughly.

So I think you _can_ get copying and pasting to work well for you in
Ubuntu, but it may not work the same as it did in Windows.

Regards,
Gary


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marcin Szamotulski  
View profile  
 More options Apr 22 2012, 8:09 am
From: Marcin Szamotulski <msza...@gmail.com>
Date: Sun, 22 Apr 2012 13:09:22 +0100
Local: Sun, Apr 22 2012 8:09 am
Subject: Re: gvim auto copy selected text to clipboard
On 15:26 Sat 21 Apr     , Gary Johnson wrote:

If you add both of them (i.e. unnamed and unnamedplus)  you will get what you
want as I already pointed.

Best regards,
Marcin


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gary Johnson  
View profile  
 More options Apr 22 2012, 2:11 pm
From: Gary Johnson <garyj...@spocom.com>
Date: Sun, 22 Apr 2012 11:11:47 -0700
Local: Sun, Apr 22 2012 2:11 pm
Subject: Re: gvim auto copy selected text to clipboard
On 2012-04-22, Marcin Szamotulski wrote:

> On 15:26 Sat 21 Apr     , Gary Johnson wrote:
> > I tried changing "unnamed" to "unnamedplus" in the 'clipboard'
> > setting and was able to use Ctrl-V for pasting in Firefox, but then
> > was unable to use other mechanisms I was used to for copying and
> > pasting, so I went back to "unnamed".  I didn't investigate the
> > behaviors thoroughly.

> If you add both of them (i.e. unnamed and unnamedplus)  you will get what you
> want as I already pointed.

I thought I also tried that when you first posted it.  I thought I
set both, yanked text from one vim instance with 'Y', then tried to
put it into another vim instance with ":put".  The ":put" text was
not what I had just yanked but was from the other selection.  I just
tried it again after reading your latest reply and it seems to work.
I was in a hurry and must have done something wrong the first time.
I'll try it this week at work where it will get more of a workout.

Thanks for the tip and for insisting that it worked.

Regards,
Gary


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
BPJ  
View profile  
 More options Apr 22 2012, 4:37 pm
From: BPJ <b...@melroch.se>
Date: Sun, 22 Apr 2012 22:37:22 +0200
Local: Sun, Apr 22 2012 4:37 pm
Subject: Re: gvim auto copy selected text to clipboard
On 2012-04-22 20:11, Gary Johnson wrote:

>> If you add both of them (i.e. unnamed and unnamedplus)  you will get what you
>> >  want as I already pointed.
> I thought I also tried that when you first posted it.  I thought I
> set both, yanked text from one vim instance with 'Y', then tried to
> put it into another vim instance with ":put".  The ":put" text was
> not what I had just yanked but was from the other selection.  I just
> tried it again after reading your latest reply and it seems to work.

  Perhaps the order in which you add them matters?

/bpj


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Jones  
View profile  
 More options Apr 22 2012, 11:17 pm
From: Chris Jones <cjns1...@gmail.com>
Date: Sun, 22 Apr 2012 23:17:23 -0400
Local: Sun, Apr 22 2012 11:17 pm
Subject: Re: gvim auto copy selected text to clipboard

On Sun, Apr 22, 2012 at 02:11:47PM EDT, Gary Johnson wrote:

[..

> > If you add both of them (i.e. unnamed and unnamedplus)  you will get
> > what you want as I already pointed.
> I thought I also tried that when you first posted it.  
> I thought I set both, yanked text from one vim instance with 'Y', then
> tried [..]

Hello Gary,

That's a lot of ‘thinking’, don't you think..: no offense meant.. :-)

The ‘:registers’ command is the healthier methodology when monitoring
cut's, copy's & paste's.

Whatever I do, mouse or nomouse, keyboard, joystick... -) .. the ‘:reg’
command lets me see exactly what is going on.. And if I'm not sure I get
to :reg a second time, even a third time for free..

I used to have problems with the different copypaste scenarios, but now
that I use ‘:reg’ on a regular basis, I always seem to end up with the
copied stuff available somewhere or other.

Seeing is believing.

CJ

--
WHAT YOU SAY??


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gary Johnson  
View profile  
 More options Apr 23 2012, 2:57 am
From: Gary Johnson <garyj...@spocom.com>
Date: Sun, 22 Apr 2012 23:57:58 -0700
Local: Mon, Apr 23 2012 2:57 am
Subject: Re: gvim auto copy selected text to clipboard
On 2012-04-22, Chris Jones wrote:

> On Sun, Apr 22, 2012 at 02:11:47PM EDT, Gary Johnson wrote:

> [..

> > > If you add both of them (i.e. unnamed and unnamedplus)  you will get
> > > what you want as I already pointed.

> > I thought I also tried that when you first posted it.  

> > I thought I set both, yanked text from one vim instance with 'Y', then
> > tried [..]

> Hello Gary,

> That's a lot of ‘thinking’, don't you think..: no offense meant.. :-)

Hi Chris,

What are you, my English teacher?  It's probably a defensive habit
to give myself wiggle room.  (Note the careful use of "probably"
instead of "think".)  You want to be my shrink, too?  No offense
taken.  And none intended, honestly.

> The ‘:registers’ command is the healthier methodology when monitoring
> cut's, copy's & paste's.

> Whatever I do, mouse or nomouse, keyboard, joystick... -) .. the ‘:reg’
> command lets me see exactly what is going on.. And if I'm not sure I get
> to :reg a second time, even a third time for free..

> I used to have problems with the different copypaste scenarios, but now
> that I use ‘:reg’ on a regular basis, I always seem to end up with the
> copied stuff available somewhere or other.

Good idea.  With that, I did some experimentation.

Case 1:
    clipboard=unnamedplus,unnamed,autoselect,exclude:cons\|linux

    Copy text from a GNOME Terminal by dragging the mouse over it
    with the left button held down.

    ":registers" shows selected text in the * register.  The
    contents of the + and " registers are unchanged from before the
    copy operation.

    ":put" pastes the contents of the + register, not what I wanted.

Case 2:
    clipboard=unnamed,unnamedplus,autoselect,exclude:cons\|linux

    Copy text from a GNOME Terminal as before.  ":registers" shows
    the same results as before, as expected.

    ":put" again pastes the contents of the + register.

Case 3:
    clipboard=unnamed,autoselect,exclude:cons\|linux

    Copy text from a GNOME Terminal as before.  ":registers" shows
    the same results as before, as expected.

    ":put" now pastes the contents of the * register.

So it appears that the only way to paste from the * register without
explicitly naming it is to exclude "unnamedplus" from the
'clipboard', and that means that unnamed yanks from Vim go only to
the * register and not the + register, which then means that Ctrl-V
in Firefox won't paste that yanked text.  That's really fine with me
since I paste into X applications other than Vim with the middle
mouse button, not Ctrl-V, but it's not what the OP wanted.

By naming registers, you can copy and paste any way you like in Vim,
but I don't see a way to copy from Vim to another X application, or
from another X application to Vim, without having to know about both
the + and * registers.  It would be nice if there was some way to
avoid all that thinking.

Regards,
Gary


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Jones  
View profile  
 More options Apr 23 2012, 7:26 am
From: Chris Jones <cjns1...@gmail.com>
Date: Mon, 23 Apr 2012 07:26:55 -0400
Local: Mon, Apr 23 2012 7:26 am
Subject: Re: gvim auto copy selected text to clipboard

On Mon, Apr 23, 2012 at 02:57:58AM EDT, Gary Johnson wrote:
> On 2012-04-22, Chris Jones wrote:
> > On Sun, Apr 22, 2012 at 02:11:47PM EDT, Gary Johnson wrote:

[..]

> What are you, my English teacher?  It's probably a defensive habit to
> give myself wiggle room.  (Note the careful use of "probably" instead
> of "think".)  You want to be my shrink, too?  No offense taken.  And
> none intended, honestly.

:-)

Forgive me... was in a ‘funny’ mood last night.. pixilated, perhaps..

> > The ‘:registers’ command is the healthier methodology when
> > monitoring cut's, copy's & paste's.
> Good idea.  With that, I did some experimentation.

That was supposed to be the useful part.

The idea being that part of the problem is often in the mind, rather
than actual facts. I'm not claiming that once I started using the :reg
command to check the contents of Vim's registers on a regular basis all
the problems just went away, but at least those problems that remained
were genuine, not something I was making up.

I'm still running Vim 7.2, so I have not had the opportunity to use
unnamedplus as yet. My experience is limited to Case 3.

> So it appears that the only way to paste from the * register without
> explicitly naming it is to exclude "unnamedplus" from the 'clipboard',
> and that means that unnamed yanks from Vim go only to the * register
> and not the + register, which then means that Ctrl-V in Firefox won't
> paste that yanked text.  That's really fine with me since I paste into
> X applications other than Vim with the middle mouse button, not
> Ctrl-V, but it's not what the OP wanted.

That's also what I am seeing (Case 3). But I run Vim under GNU/screen
which I have customized to write to what Vim sees as the + register,
X11's PRIMARY selection, IIRC.

From a more general perspective, the OP could use the ‘autocutsel’
program that keeps X11's clipboard & primary selection in sync'.

> By naming registers, you can copy and paste any way you like in Vim,
> but I don't see a way to copy from Vim to another X application, or
> from another X application to Vim, without having to know about both
> the + and * registers.  It would be nice if there was some way to
> avoid all that thinking.

Another approach would be to figure out if there's any way GTK apps can
be made to always use either the clipboard ("*) or X11's PRIMARY ("+)
rather than a mix of both depending on what copy/paste mechanisme you
are using.

Best,

CJ

--
SOMEBODY SET UP US THE BOMB


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Christian Brabandt  
View profile  
 More options Apr 23 2012, 5:12 pm
From: Christian Brabandt <cbli...@256bit.org>
Date: Mon, 23 Apr 2012 23:12:14 +0200
Local: Mon, Apr 23 2012 5:12 pm
Subject: Re: gvim auto copy selected text to clipboard
Hi Gary!

On So, 22 Apr 2012, Gary Johnson wrote:

That should probably be documented. Here is a doc patch:
diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt
--- a/runtime/doc/change.txt
+++ b/runtime/doc/change.txt
@@ -977,6 +977,11 @@
                        current line).  This always works |linewise|, thus
                        this command can be used to put a yanked block as new
                        lines.
+                       If no register is specified, it depends on the 'cb'
+                       option, if 'cb' contains "unnamed", paste from
+                       * register |quotestar|, if 'cb' also contains
+                       "unnamedplus", use + register |quoteplus|, else paste
+                       from the unnamed register |quote_quote|.
                        The cursor is left on the first non-blank in the last
                        new line.
                        The register can also be '=' followed by an optional

regards,
Christian
--
Sind wohl solche Zahlzeichen m glich, die wenn ich das Blatt
herumkehre und alsdann ausspreche z.E. so viel bedeuten als die H lfte
der vorhergehenden..
                -- Georg Christoph Lichtenberg


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gary Johnson  
View profile  
 More options Apr 23 2012, 5:49 pm
From: Gary Johnson <garyj...@spocom.com>
Date: Mon, 23 Apr 2012 14:49:30 -0700
Local: Mon, Apr 23 2012 5:49 pm
Subject: Re: gvim auto copy selected text to clipboard
On 2012-04-23, Christian Brabandt wrote:

Hi Christian,

Because the presence of "unnamedplus" trumps "unnamed", I think it
would be more clear if the options were described in this order.

    if 'cb' contains "unnamedplus"
        paste from "+
    else if 'cb' contain "unnamed"
        paste from "*
    else
        paste from ""

In English, something like this.

    If no register is specified, it depends on the 'cb'
    option.  If 'cb' contains "unnamedplus", paste from
    the + register |quoteplus|.  Otherwise, if 'cb'
    contains "unnamed", paste from the * register
    |quote_star|.  Otherwise, paste from the unnamed
    register |quote_quote|.

Regards,
Gary


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gary Johnson  
View profile  
 More options Apr 23 2012, 6:07 pm
From: Gary Johnson <garyj...@spocom.com>
Date: Mon, 23 Apr 2012 15:07:24 -0700
Local: Mon, Apr 23 2012 6:07 pm
Subject: Re: gvim auto copy selected text to clipboard
On 2012-04-23, Chris Jones wrote:

> On Mon, Apr 23, 2012 at 02:57:58AM EDT, Gary Johnson wrote:
> > On 2012-04-22, Chris Jones wrote:
> > > On Sun, Apr 22, 2012 at 02:11:47PM EDT, Gary Johnson wrote:

> [..]

> > What are you, my English teacher?  It's probably a defensive habit to
> > give myself wiggle room.  (Note the careful use of "probably" instead
> > of "think".)  You want to be my shrink, too?  No offense taken.  And
> > none intended, honestly.

> :-)

> Forgive me... was in a ‘funny’ mood last night.. pixilated, perhaps..

No problem.  As long as we're taking each other in good spirit.  Or
spirits.

> From a more general perspective, the OP could use the ‘autocutsel’
> program that keeps X11's clipboard & primary selection in sync'.

Inspired by this discussion, I decided to install autocutsel and see
how that works out.

At work I have a Windows XP machine at my desk on which I run True
X-Mouse to get something approximating X behavior on Windows.  For
development, I use NoMachine to display an X desktop (KDE) running
on a Linux machine in the back room.  With all those windowing
systems and clipboard workarounds (True X-Mouse and autocutsel), it
will be interesting to see if it all actually works together.

Regards,
Gary


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bee  
View profile  
 More options Apr 24 2012, 12:41 am
From: Bee <beeyaw...@gmail.com>
Date: Mon, 23 Apr 2012 21:41:40 -0700 (PDT)
Local: Tues, Apr 24 2012 12:41 am
Subject: Re: gvim auto copy selected text to clipboard
When I read this thread I used the published line:

set clipboard=unnamedplus,unnamed,autoselect,exclude:cons\|linux

I use Mac, Win, Linux and each has different a version of [g]vim.
This "set" failed differently on each.

I read more and found if vim is compiled with "xterm_clipboard"
then the default for clipboard is: "autoselect,exclude:cons\|linux"
Otherwise it is: ""

What could be causing a failure?
The only two other options, unnamed or unnamedplus.

It turned out to be unnamedplus, and as I recently learned...
rather than test for has() or exists() I could simply use "silent!".

Now, in the Linux I am using, anytime I select and yank, or just yank,
both "* and *+ are filled. Going to any other app and paste with C-v
or middle mouse button click works.
--AND--
To my surprise, if I copy with C-c from another app like a web
browser, then go back to [g]vim, p or P or :put or :put! work!

I have the following in .vimrc
it is used on Mac, Win, and Linux
works for all gvim, MacVim and terminal vim,
depending on the compiled options.

The vmap and nmap remain for vim versions that are not gui or do not
have xterm_clipboard compiled.

if has("clipboard")
  vmap ,y "+y
  nmap ,p "+gP
  " exclude:{pattern} must be last ^= prepend += append
  if has("gui_running") || has("xterm_clipboard")
    silent! set clipboard^=unnamedplus
    set clipboard^=unnamed
  endif
endif

Bill


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Jones  
View profile  
 More options Apr 24 2012, 2:33 am
From: Chris Jones <cjns1...@gmail.com>
Date: Tue, 24 Apr 2012 02:33:50 -0400
Local: Tues, Apr 24 2012 2:33 am
Subject: Re: gvim auto copy selected text to clipboard

On Mon, Apr 23, 2012 at 06:07:24PM EDT, Gary Johnson wrote:
> On 2012-04-23, Chris Jones wrote:

[..]

> > From a more general perspective, the OP could use the ‘autocutsel’
> > program that keeps X11's clipboard & primary selection in sync'.

> Inspired by this discussion, I decided to install autocutsel and see
> how that works out.

Did the same but haven't looked into setting it up. Provided the tool
works as I think it does, namely that from the user's perspective it
makes the X clipboard and the PRIMARY selection behave as one, the
question is, do I really want that..? IOW, what are the implications?

It looks as if all the OP wants is X11 to work like Microsoft Windows
with just one single mechanism & clipboard..?

I rather dread revisiting these issues and fiddling with my environment
at this point.. I have about ten pages of notes on the subject that
would likely need to be updated.. I think I'll wait till I upgrade to
7.3 so I'm able to see for myself whether the new clipboard=unnamedplus
option makes any difference.

X was designed by computer scientists.. maybe that's the problem.

CJ

--
Hi! My name is bobby...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sergey Vakulenko  
View profile  
 More options Apr 27 2012, 5:25 pm
From: Sergey Vakulenko <svakulenk...@gmail.com>
Date: Fri, 27 Apr 2012 14:25:55 -0700 (PDT)
Local: Fri, Apr 27 2012 5:25 pm
Subject: Re: gvim auto copy selected text to clipboard
The problem is solved !
In this thread you can take a patch from Christian Brabandt which make
possible behavior described in Subject and test case.

http://groups.google.com/group/vim_dev/browse_thread/thread/1b50de7f4...

On Apr 24, 8:33 am, Chris Jones <cjns1...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »