after vim 8 installation, yanking (yy) doesn't work in global command and macros

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

after vim 8 installation, yanking (yy) doesn't work in global command and macros

Bryce Orgill
After I installed the Vim 8 version, I noticed that the following command doesn't yank the current line for every line it's supposed to run on.

%g/^/normal yyp

When I run it, it pastes whatever was previously copied.  When I run "normal yyp", this works fine, it just doesn't seem to work in global commands and in macros.  Here is my example:

Example:
-----------
string currently stored in clipboard: 7777
command given: %g/^/normal yyp
original text:
1234
5678

new text (actual output):
1234
7777
5678
7777

new text (expected output):
1234
1234
5678
5678

This seems like a real bug as I never experienced this in earlier versions.

Bryce

--
--
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 received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: after vim 8 installation, yanking (yy) doesn't work in global command and macros

Christian Brabandt
Hi Bryce!

On Do, 03 Nov 2016, Bryce Orgill wrote:

> After I installed the Vim 8 version, I noticed that the following command doesn't yank the current line for every line it's supposed to run on.
>
> %g/^/normal yyp
>
> When I run it, it pastes whatever was previously copied.  When I run "normal yyp", this works fine, it just doesn't seem to work in global commands and in macros.  Here is my example:
>
> Example:
> -----------
> string currently stored in clipboard: 7777
> command given: %g/^/normal yyp
> original text:
> 1234
> 5678
>
> new text (actual output):
> 1234
> 7777
> 5678
> 7777
>
> new text (expected output):
> 1234
> 1234
> 5678
> 5678
>
> This seems like a real bug as I never experienced this in earlier versions.

Cannot reproduce. What is your clipboard setting? Can you please narrow
down the problem when starting vim like this vim -u NONE -N --noplugins


Best,
Christian
--
Eine Gesellschaft, die sich mehr leistet, als sie sich leisten kann,
nennt man Leistungsgesellschaft.
                -- Werner Mitsch

--
--
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 received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: after vim 8 installation, yanking (yy) doesn't work in global command and macros

h_east
Hi ChrisBra and All,

2016-11-4(Fri) 16:03:31 UTC+9 Christian Brabandt:

> Hi Bryce!
>
> On Do, 03 Nov 2016, Bryce Orgill wrote:
>
> > After I installed the Vim 8 version, I noticed that the following command doesn't yank the current line for every line it's supposed to run on.
> >
> > %g/^/normal yyp
> >
> > When I run it, it pastes whatever was previously copied.  When I run "normal yyp", this works fine, it just doesn't seem to work in global commands and in macros.  Here is my example:
> >
> > Example:
> > -----------
> > string currently stored in clipboard: 7777
> > command given: %g/^/normal yyp
> > original text:
> > 1234
> > 5678
> >
> > new text (actual output):
> > 1234
> > 7777
> > 5678
> > 7777
> >
> > new text (expected output):
> > 1234
> > 1234
> > 5678
> > 5678
> >
> > This seems like a real bug as I never experienced this in earlier versions.
>
> Cannot reproduce. What is your clipboard setting? Can you please narrow
> down the problem when starting vim like this vim -u NONE -N --noplugins
A little supplement:
s/--noplugins/--noplugin/
When you specify the `-u NONE`, it will treat you also specify `--noplugin` and `-U NONE`.

Please see `:h -u` and `:h --noplugin`
> When {vimrc} is equal to "NONE" (all uppercase), all
> initializations from files and environment variables are
> skipped, including reading the |gvimrc| file when the GUI
> starts.  Loading plugins is also skipped.

--
Best regards,
Hirohito Higashi (a.k.a. h_east)

--
--
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 received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: after vim 8 installation, yanking (yy) doesn't work in global command and macros

Bryce Orgill
I found the issue is present on both my work computer (Windows 7) and home computer (Windows 10) for version 8.0.  I don't see the issue on my Android phone (also version 8.0) but this runs in a unix emulator called Termux.  So I think the issue may only reside on the windows side.  I do find in windows that it affects both the GVIM and VIM applications.

I did do some more investigating and when I run with no plugins, the issue is gone, so the yanking in the global command works.  I narrowed down the issue to the clipboard setting (set clipboard).  By default, this is blank but in my vimrc file, I set it to "unnamed".  I need this setting because it allows me to copy something in VIM and it will be available in apps external to VIM (placed on windows clipboard).  So when I run VIM without plugins, the yanking works, but right when I set that clipboard setting to unnamed, the yanking doesn't work anymore.

This was working on previous versions like 7.4, 7.3, 7.2.  So I'm not sure why it would stop working now.

Bryce

--
--
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 received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: after vim 8 installation, yanking (yy) doesn't work in global command and macros

Christian Brabandt
Hi Bryce!

On Fr, 04 Nov 2016, Bryce Orgill wrote:

> I found the issue is present on both my work computer (Windows 7) and home computer (Windows 10) for version 8.0.  I don't see the issue on my Android phone (also version 8.0) but this runs in a unix emulator called Termux.  So I think the issue may only reside on the windows side.  I do find in windows that it affects both the GVIM and VIM applications.
>
> I did do some more investigating and when I run with no plugins, the issue is gone, so the yanking in the global command works.  I narrowed down the issue to the clipboard setting (set clipboard).  By default, this is blank but in my vimrc file, I set it to "unnamed".  I need this setting because it allows me to copy something in VIM and it will be available in apps external to VIM (placed on windows clipboard).  So when I run VIM without plugins, the yanking works, but right when I set that clipboard setting to unnamed, the yanking doesn't work anymore.
>
> This was working on previous versions like 7.4, 7.3, 7.2.  So I'm not sure why it would stop working now.

The clipboard setting is explicitly disabled for :g commands.


Best,
Christian
--
Wer die Zukunft als Gegenwind empfindet, geht in die falsche Richtung.
                -- Martin Held

--
--
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 received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: after vim 8 installation, yanking (yy) doesn't work in global command and macros

Bryce Orgill
Was that a change that was put in version 8?  In my opinion that is a big change.  It now means I can't yank in the global command or in macros.  I have macros and scripts that use this.  It means it won't work there.  I have to also use the 'set clipboard=unnamed' command to be able to copy/paste from/to vim to/from other apps.  I'm not sure why this change was taken out of version 7.4.  It was working fine there and in previous versions.  Why does this work in Unix but not Windows?

In my opinion this needs to be fixed.  I don't see a work around in my current status, which means I'd have to revert back to 7.4 to keep my scripts working.

Bryce

--
--
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 received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: after vim 8 installation, yanking (yy) doesn't work in global command and macros

Christian Brabandt
Hi Bryce!

On Fr, 04 Nov 2016, Bryce Orgill wrote:

> Was that a change that was put in version 8?  In my opinion that is a big change.  It now means I can't yank in the global command or in macros.  I have macros and scripts that use this.  It means it won't work there.  I have to also use the 'set clipboard=unnamed' command to be able to copy/paste from/to vim to/from other apps.  I'm not sure why this change was taken out of version 7.4.  It was working fine there and in previous versions.  Why does this work in Unix but not Windows?
>
> In my opinion this needs to be fixed.  I don't see a work around in my current status, which means I'd have to revert back to 7.4 to keep my scripts working.

This was changed in 7.4.396 for performance reasons. It should be
possible to explicitly paste from the clipboard using "+p

Best,
Christian
--
"Ich fühle mich richtig schlapp und schwach", meint der Elefant
traurig. Daraufhin meint ein anderer Elefant:
"Man spürt es eben doch, daß man aus einer Mücke gemacht wird."

--
--
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 received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: after vim 8 installation, yanking (yy) doesn't work in global command and macros

'Jürgen Krämer' via vim_use
In reply to this post by Bryce Orgill
Am 04.11.2016 um 21:35 schrieb Bryce Orgill:

> Was that a change that was put in version 8?  In my opinion that is a
> big change.  It now means I can't yank in the global command or in
> macros.  I have macros and scripts that use this.  It means it won't
> work there.  I have to also use the 'set clipboard=unnamed' command
> to be able to copy/paste from/to vim to/from other apps.  I'm not
> sure why this change was taken out of version 7.4.  It was working
> fine there and in previous versions.  Why does this work in Unix but
> not Windows?
>
> In my opinion this needs to be fixed.  I don't see a work around in
> my current status, which means I'd have to revert back to 7.4 to keep
> my scripts working.

Then:
:set cb=unnamed
Within :global, `yy' yanks into the clipboard and `p' puts from the clipboard.

Now:
:set cb=unnamed
Within :global, `yy' does not yank into the clipboard, but `p' still puts from the clipboard.
Looks like `yy' fails to set the last used register (`0').

Workaround:
:g/^/normal! yy"0p

(register `0' contains the yanked text even with cb=unnamed).

--
Andy

--
--
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 received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: after vim 8 installation, yanking (yy) doesn't work in global command and macros

Bryce Orgill
This is a bug in my opinion.  Maybe not a bug on accident but bad design.  The whole point of Vim is less key strokes.  This means, I'm going to have to get use to the idea of typing yy"0p or something equivalent everytime I use the global.  The "yy" and "p" go together like peanut butter and jelly.  It just doesn't make sense to disconnect these in a global command.  What if I forget and I go on manipulating my file and don't see that I mistakenly typed (but ideally should be) yyp.  Others will likely run into this error as well.

--
--
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 received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: after vim 8 installation, yanking (yy) doesn't work in global command and macros

Bryce Orgill
Here's another idea.  I don't mind the disabling of the clipboard when using the yanking in the global command.  But is there a way that yyp can pick up on the same register during this command so the paste picks up what was yanked?  I don't know, something to think about.  Or is there an additional setting that would allow you to use the clipboard setting during global that could be set up?

--
--
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 received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: after vim 8 installation, yanking (yy) doesn't work in global command and macros

Bryce Orgill
Can someone tell me why this macro (:g/-/normal @q) doesn't work now on version 8, when it worked on 7.4?  I'm guessing it's related to the yanking thing.  Even when I replace the @+ to @0 it still doesn't work.

€kh/-^M€klviw^C:let y1=@+^Mn€krviw^C:let y2=@+^M:let y3=y2-y1^M:let @a=y3^M:let @b=line(".")^M€kh/-^M€*7€kbmayy:normal ^Rap^M:normal ^Raj^M€kumb:'a,'bs/:\zs\d\+/\=y1+line(".")-^Rb/^M

--
--
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 received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: after vim 8 installation, yanking (yy) doesn't work in global command and macros

Bram Moolenaar
In reply to this post by 'Jürgen Krämer' via vim_use

Andy Wokula wrote:

> Am 04.11.2016 um 21:35 schrieb Bryce Orgill:
> > Was that a change that was put in version 8?  In my opinion that is a
> > big change.  It now means I can't yank in the global command or in
> > macros.  I have macros and scripts that use this.  It means it won't
> > work there.  I have to also use the 'set clipboard=unnamed' command
> > to be able to copy/paste from/to vim to/from other apps.  I'm not
> > sure why this change was taken out of version 7.4.  It was working
> > fine there and in previous versions.  Why does this work in Unix but
> > not Windows?
> >
> > In my opinion this needs to be fixed.  I don't see a work around in
> > my current status, which means I'd have to revert back to 7.4 to keep
> > my scripts working.
>
> Then:
> :set cb=unnamed
> Within :global, `yy' yanks into the clipboard and `p' puts from the clipboard.
>
> Now:
> :set cb=unnamed
> Within :global, `yy' does not yank into the clipboard, but `p' still puts from the clipboard.
> Looks like `yy' fails to set the last used register (`0').
>
> Workaround:
> :g/^/normal! yy"0p
>
> (register `0' contains the yanked text even with cb=unnamed).

Should be easy to fix: when Vim does "yy" and the clipboard isn't updated
because it's in a global command, then the next "p" should use what
would have been put on the clipboard.

Unfortunately I can't reproduce the problem...  Does this only happen on
MS-Windows?

--
Female engineers become irresistible at the age of consent and remain that
way until about thirty minutes after their clinical death.  Longer if it's a
warm day.
                                (Scott Adams - The Dilbert principle)

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--
--
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 received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: after vim 8 installation, yanking (yy) doesn't work in global command and macros

Bryce Orgill
Yes, I've only seen this issue on MS-Windows (both Windows 7 and Windows 10).  I don't see the issue on Unix, but I'm testing that with a Unix emulator on my Android phone called Termux, which was tested with version 8.

BrycW

--
--
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 received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.