Quantcast

"E353: Nothing in register *" after yanking in a mapping

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

"E353: Nothing in register *" after yanking in a mapping

Gary Johnson

Background:

Yesterday there was a discussion about how to create a mapping to
yank visually selected text into two registers.  ("can u map a key
to do two things?")  A couple of people including myself proposed
the following mapping:

   vmap zy "*ygv"y+

When I tested this before posting I noticed that it worked in some
vim instances but not in others.  I assumed it was a problem with
one of my configurations, so I let it go.  Now I'm looking into it
further and it fails consistently.


Experiment:

I start vim as follows,

   vim -N -u NONE -i NONE sometextfile

and execute the following mapping:

   :vmap zy "*ygv"y+

Then I move the cursor over some word, type

   viw
   zy

to yank the selected word into the * and + registers, then execute

   :put +
   :put *

The ":put +" works fine, inserting the selected word on a new line
below the cursor.  The ":put *", however, fails with this error
message:

   E353: Nothing in register *

If I reverse those two :puts, it is still the ":put *" that fails.

If I redefine the mapping like this,

   :vmap zy "+ygv"y*

with the + and * exchanged, both :puts succeed.  Also, if I execute
the following sequence of commands without using any mapping,

   viw
   "*y
   gv
   "+y
   :put +
   :put *

both :puts work fine.

Am I missing something or is this a bug?


Version:

Built on a Red Hat Enterprise Linux WS release 4 system.

:version
VIM - Vi IMproved 7.2a BETA (2008 Jun 24, compiled Jun 24 2008 16:32:57)
Compiled by [hidden email]
Normal 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 +cryptv +cscope +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 +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 +postscript
+printer -profile -python +quickfix +reltime -rightleft -ruby +scrollbind +signs +smartindent -sniff +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
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/home/garyjohn/src/Linux/vim-7.2a/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -DXTHREADS -D_REENTRANT -DXUSE_MTSAFE_API -I/usr/include/gtk-2.0 -I/usr/lib/
gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/freetype2/confi
g -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include     -g -O2  -I/usr/X11R6/include
Linking: gcc  -L/usr/X11R6/lib   -L/usr/local/lib -o vim   -Wl,--export-dynamic -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpan
goxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0   -lXt -lm -lncurses -lselinux -lacl -lgpm


Regards,
Gary


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "E353: Nothing in register *" after yanking in a mapping

Gary Johnson

I'm sorry, I found two typos after I posted that.  The mappings I
actually used were correct.

On 2008-06-26, Gary Johnson <[hidden email]> wrote:

> Background:
>
> Yesterday there was a discussion about how to create a mapping to
> yank visually selected text into two registers.  ("can u map a key
> to do two things?")  A couple of people including myself proposed
> the following mapping:
>
>    vmap zy "*ygv"y+
>
> When I tested this before posting I noticed that it worked in some
> vim instances but not in others.  I assumed it was a problem with
> one of my configurations, so I let it go.  Now I'm looking into it
> further and it fails consistently.
>
>
> Experiment:
>
> I start vim as follows,
>
>    vim -N -u NONE -i NONE sometextfile
>
> and execute the following mapping:
>
>    :vmap zy "*ygv"y+
     :vmap zy "*ygv"+y

>
> Then I move the cursor over some word, type
>
>    viw
>    zy
>
> to yank the selected word into the * and + registers, then execute
>
>    :put +
>    :put *
>
> The ":put +" works fine, inserting the selected word on a new line
> below the cursor.  The ":put *", however, fails with this error
> message:
>
>    E353: Nothing in register *
>
> If I reverse those two :puts, it is still the ":put *" that fails.
>
> If I redefine the mapping like this,
>
>    :vmap zy "+ygv"y*
     :vmap zy "+ygv"*y

>
> with the + and * exchanged, both :puts succeed.  Also, if I execute
> the following sequence of commands without using any mapping,
>
>    viw
>    "*y
>    gv
>    "+y
>    :put +
>    :put *
>
> both :puts work fine.
>
> Am I missing something or is this a bug?

Regards,
Gary


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "E353: Nothing in register *" after yanking in a mapping

Gary Johnson

On 2008-06-26, Gary Johnson <[hidden email]> wrote:
> I'm sorry, I found two typos after I posted that.  The mappings I
> actually used were correct.

D***!  Make that three.

> On 2008-06-26, Gary Johnson <[hidden email]> wrote:
> > Background:
> >
> > Yesterday there was a discussion about how to create a mapping to
> > yank visually selected text into two registers.  ("can u map a key
> > to do two things?")  A couple of people including myself proposed
> > the following mapping:
> >
> >    vmap zy "*ygv"y+
       vmap zy "*ygv"+y

> >
> > When I tested this before posting I noticed that it worked in some
> > vim instances but not in others.  I assumed it was a problem with
> > one of my configurations, so I let it go.  Now I'm looking into it
> > further and it fails consistently.
> >
> >
> > Experiment:
> >
> > I start vim as follows,
> >
> >    vim -N -u NONE -i NONE sometextfile
> >
> > and execute the following mapping:
> >
> >    :vmap zy "*ygv"y+
>      :vmap zy "*ygv"+y
>
> >
> > Then I move the cursor over some word, type
> >
> >    viw
> >    zy
> >
> > to yank the selected word into the * and + registers, then execute
> >
> >    :put +
> >    :put *
> >
> > The ":put +" works fine, inserting the selected word on a new line
> > below the cursor.  The ":put *", however, fails with this error
> > message:
> >
> >    E353: Nothing in register *
> >
> > If I reverse those two :puts, it is still the ":put *" that fails.
> >
> > If I redefine the mapping like this,
> >
> >    :vmap zy "+ygv"y*
>      :vmap zy "+ygv"*y
>
> >
> > with the + and * exchanged, both :puts succeed.  Also, if I execute
> > the following sequence of commands without using any mapping,
> >
> >    viw
> >    "*y
> >    gv
> >    "+y
> >    :put +
> >    :put *
> >
> > both :puts work fine.
> >
> > Am I missing something or is this a bug?

Regards,
Gary


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re: "E353: Nothing in register *" after yanking in a mapping

Agathoklis D. Hatzimanikas

On Thu, Jun 26, at 12:02 Gary Johnson wrote:

>
> On 2008-06-26, Gary Johnson <[hidden email]> wrote:
> > I'm sorry, I found two typos after I posted that.  The mappings I
> > actually used were correct.
>
> D***!  Make that three.
>
> > On 2008-06-26, Gary Johnson <[hidden email]> wrote:
> > > Background:
> > >
> > > Yesterday there was a discussion about how to create a mapping to
> > > yank visually selected text into two registers.  ("can u map a key
> > > to do two things?")  A couple of people including myself proposed
> > > the following mapping:
> > >
> > >    vmap zy "*ygv"y+
>        vmap zy "*ygv"+y
>
> > >
> > > When I tested this before posting I noticed that it worked in some
> > > vim instances but not in others.  I assumed it was a problem with
> > > one of my configurations, so I let it go.  Now I'm looking into it
> > > further and it fails consistently.
> > >
> > >
> > > Experiment:
> > >
> > > I start vim as follows,
> > >
> > >    vim -N -u NONE -i NONE sometextfile
> > >
> > > and execute the following mapping:
> > >
> > >    :vmap zy "*ygv"y+
> >      :vmap zy "*ygv"+y
> >
> > >
> > > Then I move the cursor over some word, type
> > >
> > >    viw
> > >    zy
> > >
> > > to yank the selected word into the * and + registers, then execute
> > >
> > >    :put +
> > >    :put *
> > >
> > > The ":put +" works fine, inserting the selected word on a new line
> > > below the cursor.  The ":put *", however, fails with this error
> > > message:
> > >
> > >    E353: Nothing in register *
> > >
> > > If I reverse those two :puts, it is still the ":put *" that fails.
> > >
> > > If I redefine the mapping like this,
> > >
> > >    :vmap zy "+ygv"y*
> >      :vmap zy "+ygv"*y
> >
> > >
> > > with the + and * exchanged, both :puts succeed.

I can reproduce it until here.

> > > Also, if I execute
> > > the following sequence of commands without using any mapping,
> > >
> > >    viw
> > >    "*y
> > >    gv
> > >    "+y
> > >    :put +
> > >    :put *
> > >
> > > both :puts work fine.
> >

But still fails in that point with the same message (nothing in register *).

This is in a self compiled vim7.2a, in a self compiled system, running
xorg-server-1.2.0.

However, ssh'ing in an old system, with vim in 145 patch level, running
xorg-server-1.1.0, the whole test is not reproducible ....

... I updated vim in 7.2a beta, still the test is not reproducible in that
system, so quite possible is a bug in X.

>
> Regards,
> Gary
>

Regards,

Ag.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "E353: Nothing in register *" after yanking in a mapping

David Lam
In reply to this post by Gary Johnson
hmm wait i think im getting the same weird behvaior too

and im on RHEL WS release 4 too... hmm hmmm

On Thu, Jun 26, 2008 at 11:49 AM, Gary Johnson <[hidden email]> wrote:

Background:

Yesterday there was a discussion about how to create a mapping to
yank visually selected text into two registers.  ("can u map a key
to do two things?")  A couple of people including myself proposed
the following mapping:

  vmap zy "*ygv"y+

When I tested this before posting I noticed that it worked in some
vim instances but not in others.  I assumed it was a problem with
one of my configurations, so I let it go.  Now I'm looking into it
further and it fails consistently.


Experiment:

I start vim as follows,

  vim -N -u NONE -i NONE sometextfile

and execute the following mapping:

  :vmap zy "*ygv"y+

Then I move the cursor over some word, type

  viw
  zy

to yank the selected word into the * and + registers, then execute

  :put +
  :put *

The ":put +" works fine, inserting the selected word on a new line
below the cursor.  The ":put *", however, fails with this error
message:

  E353: Nothing in register *

If I reverse those two :puts, it is still the ":put *" that fails.

If I redefine the mapping like this,

  :vmap zy "+ygv"y*

with the + and * exchanged, both :puts succeed.  Also, if I execute
the following sequence of commands without using any mapping,

  viw
  "*y
  gv
  "+y
  :put +
  :put *

both :puts work fine.

Am I missing something or is this a bug?


Version:

Built on a Red Hat Enterprise Linux WS release 4 system.

:version
VIM - Vi IMproved 7.2a BETA (2008 Jun 24, compiled Jun 24 2008 16:32:57)
Compiled by [hidden email]
Normal 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 +cryptv +cscope +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 +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 +postscript
+printer -profile -python +quickfix +reltime -rightleft -ruby +scrollbind +signs +smartindent -sniff +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
  system vimrc file: "$VIM/vimrc"
    user vimrc file: "$HOME/.vimrc"
     user exrc file: "$HOME/.exrc"
 system gvimrc file: "$VIM/gvimrc"
   user gvimrc file: "$HOME/.gvimrc"
   system menu file: "$VIMRUNTIME/menu.vim"
 fall-back for $VIM: "/home/garyjohn/src/Linux/vim-7.2a/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -DXTHREADS -D_REENTRANT -DXUSE_MTSAFE_API -I/usr/include/gtk-2.0 -I/usr/lib/
gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/freetype2/confi
g -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include     -g -O2  -I/usr/X11R6/include
Linking: gcc  -L/usr/X11R6/lib   -L/usr/local/lib -o vim   -Wl,--export-dynamic -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpan
goxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0   -lXt -lm -lncurses -lselinux -lacl -lgpm


Regards,
Gary





--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "E353: Nothing in register *" after yanking in a mapping

Ben Fritz

On 6/27/08, David Lam <[hidden email]> wrote:

> hmm wait i think im getting the same weird behvaior too
>
> and im on RHEL WS release 4 too... hmm hmmm
>
>
> On Thu, Jun 26, 2008 at 11:49 AM, Gary Johnson <[hidden email]>
> wrote:
>
> >
> > Background:
> >
> > Yesterday there was a discussion about how to create a mapping to
> > yank visually selected text into two registers.  ("can u map a key
> > to do two things?")  A couple of people including myself proposed
> > the following mapping:
> >
> >   vmap zy "*ygv"y+
> >
> > When I tested this before posting I noticed that it worked in some
> > vim instances but not in others.  I assumed it was a problem with
> > one of my configurations, so I let it go.  Now I'm looking into it
> > further and it fails consistently.
> >
> >
> > Experiment:
> >
> > I start vim as follows,
> >
> >   vim -N -u NONE -i NONE sometextfile
> >
> > and execute the following mapping:
> >
> >   :vmap zy "*ygv"y+
> >
> > Then I move the cursor over some word, type
> >
> >   viw
> >   zy
> >
> > to yank the selected word into the * and + registers, then execute
> >
> >   :put +
> >   :put *
> >
> > The ":put +" works fine, inserting the selected word on a new line
> > below the cursor.  The ":put *", however, fails with this error
> > message:
> >
> >   E353: Nothing in register *
> >
> > If I reverse those two :puts, it is still the ":put *" that fails.
> >
> > If I redefine the mapping like this,
> >
> >   :vmap zy "+ygv"y*
> >
> > with the + and * exchanged, both :puts succeed.  Also, if I execute
> > the following sequence of commands without using any mapping,
> >
> >   viw
> >   "*y
> >   gv
> >   "+y
> >   :put +
> >   :put *
> >
> > both :puts work fine.
> >
> > Am I missing something or is this a bug?
> >
> >
> > Version:
> >
> > Built on a Red Hat Enterprise Linux WS release 4 system.
> >
> > :version
> > VIM - Vi IMproved 7.2a BETA (2008 Jun 24, compiled Jun 24 2008 16:32:57)
> > Compiled by [hidden email]
> > Normal 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 +cryptv +cscope +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 +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 +postscript
> > +printer -profile -python +quickfix +reltime -rightleft -ruby +scrollbind
> +signs +smartindent -sniff +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
> >   system vimrc file: "$VIM/vimrc"
> >     user vimrc file: "$HOME/.vimrc"
> >      user exrc file: "$HOME/.exrc"
> >  system gvimrc file: "$VIM/gvimrc"
> >    user gvimrc file: "$HOME/.gvimrc"
> >    system menu file: "$VIMRUNTIME/menu.vim"
> >  fall-back for $VIM:
> "/home/garyjohn/src/Linux/vim-7.2a/share/vim"
> > Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -DXTHREADS
> -D_REENTRANT -DXUSE_MTSAFE_API -I/usr/include/gtk-2.0 -I/usr/lib/
> > gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0
> -I/usr/include/pango-1.0 -I/usr/include/freetype2
> -I/usr/include/freetype2/confi
> > g -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include     -g -O2
> -I/usr/X11R6/include
> > Linking: gcc  -L/usr/X11R6/lib   -L/usr/local/lib -o vim
> -Wl,--export-dynamic -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0
> -lpan
> > goxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0
>  -lXt -lm -lncurses -lselinux -lacl -lgpm
> >
> >
> > Regards,
> > Gary
> >
> >
> >
> >
>
>

I'm running on Windows XP and don't see this behavior.

I also tried mapping zy to "aygv"by instead, because the + and *
registers are apparently the same in Windows.

Something to do with X maybe?

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "E353: Nothing in register *" after yanking in a mapping

David Lam
yeah its an X thingy those registers are the same on windows

which is why like i wanted to figure out how to yank to both so me mappings would work the same on linux as it does on windows

On Fri, Jun 27, 2008 at 2:34 PM, Benjamin Fritz <[hidden email]> wrote:

On 6/27/08, David Lam <[hidden email]> wrote:
> hmm wait i think im getting the same weird behvaior too
>
> and im on RHEL WS release 4 too... hmm hmmm
>
>
> On Thu, Jun 26, 2008 at 11:49 AM, Gary Johnson <[hidden email]>
> wrote:
>
> >
> > Background:
> >
> > Yesterday there was a discussion about how to create a mapping to
> > yank visually selected text into two registers.  ("can u map a key
> > to do two things?")  A couple of people including myself proposed
> > the following mapping:
> >
> >   vmap zy "*ygv"y+
> >
> > When I tested this before posting I noticed that it worked in some
> > vim instances but not in others.  I assumed it was a problem with
> > one of my configurations, so I let it go.  Now I'm looking into it
> > further and it fails consistently.
> >
> >
> > Experiment:
> >
> > I start vim as follows,
> >
> >   vim -N -u NONE -i NONE sometextfile
> >
> > and execute the following mapping:
> >
> >   :vmap zy "*ygv"y+
> >
> > Then I move the cursor over some word, type
> >
> >   viw
> >   zy
> >
> > to yank the selected word into the * and + registers, then execute
> >
> >   :put +
> >   :put *
> >
> > The ":put +" works fine, inserting the selected word on a new line
> > below the cursor.  The ":put *", however, fails with this error
> > message:
> >
> >   E353: Nothing in register *
> >
> > If I reverse those two :puts, it is still the ":put *" that fails.
> >
> > If I redefine the mapping like this,
> >
> >   :vmap zy "+ygv"y*
> >
> > with the + and * exchanged, both :puts succeed.  Also, if I execute
> > the following sequence of commands without using any mapping,
> >
> >   viw
> >   "*y
> >   gv
> >   "+y
> >   :put +
> >   :put *
> >
> > both :puts work fine.
> >
> > Am I missing something or is this a bug?
> >
> >
> > Version:
> >
> > Built on a Red Hat Enterprise Linux WS release 4 system.
> >
> > :version
> > VIM - Vi IMproved 7.2a BETA (2008 Jun 24, compiled Jun 24 2008 16:32:57)
> > Compiled by [hidden email]
> > Normal 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 +cryptv +cscope +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 +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 +postscript
> > +printer -profile -python +quickfix +reltime -rightleft -ruby +scrollbind
> +signs +smartindent -sniff +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
> >   system vimrc file: "$VIM/vimrc"
> >     user vimrc file: "$HOME/.vimrc"
> >      user exrc file: "$HOME/.exrc"
> >  system gvimrc file: "$VIM/gvimrc"
> >    user gvimrc file: "$HOME/.gvimrc"
> >    system menu file: "$VIMRUNTIME/menu.vim"
> >  fall-back for $VIM:
> "/home/garyjohn/src/Linux/vim-7.2a/share/vim"
> > Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -DXTHREADS
> -D_REENTRANT -DXUSE_MTSAFE_API -I/usr/include/gtk-2.0 -I/usr/lib/
> > gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0
> -I/usr/include/pango-1.0 -I/usr/include/freetype2
> -I/usr/include/freetype2/confi
> > g -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include     -g -O2
> -I/usr/X11R6/include
> > Linking: gcc  -L/usr/X11R6/lib   -L/usr/local/lib -o vim
> -Wl,--export-dynamic -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0
> -lpan
> > goxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0
>  -lXt -lm -lncurses -lselinux -lacl -lgpm
> >
> >
> > Regards,
> > Gary
> >
> >
> >
> >
>
>

I'm running on Windows XP and don't see this behavior.

I also tried mapping zy to "aygv"by instead, because the + and *
registers are apparently the same in Windows.

Something to do with X maybe?




--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "E353: Nothing in register *" after yanking in a mapping

Tony Mechelynck
In reply to this post by Ben Fritz

On 27/06/08 23:34, Benjamin Fritz wrote:

> On 6/27/08, David Lam<[hidden email]>  wrote:
>> hmm wait i think im getting the same weird behvaior too
>>
>> and im on RHEL WS release 4 too... hmm hmmm
>>
>>
>> On Thu, Jun 26, 2008 at 11:49 AM, Gary Johnson<[hidden email]>
>> wrote:
>>
>>> Background:
>>>
>>> Yesterday there was a discussion about how to create a mapping to
>>> yank visually selected text into two registers.  ("can u map a key
>>> to do two things?")  A couple of people including myself proposed
>>> the following mapping:
>>>
>>>    vmap zy "*ygv"y+
>>>
>>> When I tested this before posting I noticed that it worked in some
>>> vim instances but not in others.  I assumed it was a problem with
>>> one of my configurations, so I let it go.  Now I'm looking into it
>>> further and it fails consistently.
>>>
>>>
>>> Experiment:
>>>
>>> I start vim as follows,
>>>
>>>    vim -N -u NONE -i NONE sometextfile
>>>
>>> and execute the following mapping:
>>>
>>>    :vmap zy "*ygv"y+
>>>
>>> Then I move the cursor over some word, type
>>>
>>>    viw
>>>    zy
>>>
>>> to yank the selected word into the * and + registers, then execute
>>>
>>>    :put +
>>>    :put *
>>>
>>> The ":put +" works fine, inserting the selected word on a new line
>>> below the cursor.  The ":put *", however, fails with this error
>>> message:
>>>
>>>    E353: Nothing in register *
>>>
>>> If I reverse those two :puts, it is still the ":put *" that fails.
>>>
>>> If I redefine the mapping like this,
>>>
>>>    :vmap zy "+ygv"y*
>>>
>>> with the + and * exchanged, both :puts succeed.  Also, if I execute
>>> the following sequence of commands without using any mapping,
>>>
>>>    viw
>>>    "*y
>>>    gv
>>>    "+y
>>>    :put +
>>>    :put *
>>>
>>> both :puts work fine.
>>>
>>> Am I missing something or is this a bug?
>>>
>>>
>>> Version:
>>>
>>> Built on a Red Hat Enterprise Linux WS release 4 system.
>>>
>>> :version
>>> VIM - Vi IMproved 7.2a BETA (2008 Jun 24, compiled Jun 24 2008 16:32:57)
>>> Compiled by [hidden email]
>>> Normal 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 +cryptv +cscope +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 +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 +postscript
>>> +printer -profile -python +quickfix +reltime -rightleft -ruby +scrollbind
>> +signs +smartindent -sniff +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
>>>    system vimrc file: "$VIM/vimrc"
>>>      user vimrc file: "$HOME/.vimrc"
>>>       user exrc file: "$HOME/.exrc"
>>>   system gvimrc file: "$VIM/gvimrc"
>>>     user gvimrc file: "$HOME/.gvimrc"
>>>     system menu file: "$VIMRUNTIME/menu.vim"
>>>   fall-back for $VIM:
>> "/home/garyjohn/src/Linux/vim-7.2a/share/vim"
>>> Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -DXTHREADS
>> -D_REENTRANT -DXUSE_MTSAFE_API -I/usr/include/gtk-2.0 -I/usr/lib/
>>> gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0
>> -I/usr/include/pango-1.0 -I/usr/include/freetype2
>> -I/usr/include/freetype2/confi
>>> g -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include     -g -O2
>> -I/usr/X11R6/include
>>> Linking: gcc  -L/usr/X11R6/lib   -L/usr/local/lib -o vim
>> -Wl,--export-dynamic -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0
>> -lpan
>>> goxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0
>>   -lXt -lm -lncurses -lselinux -lacl -lgpm
>>>
>>> Regards,
>>> Gary
>>>
>>>
>>>
>>>
>>
>
> I'm running on Windows XP and don't see this behavior.
>
> I also tried mapping zy to "aygv"by instead, because the + and *
> registers are apparently the same in Windows.
>
> Something to do with X maybe?

Yes, on all non-X11 versions of Vim (if compiled with +clipboard of
course), "+ and "* are the same; hence the ":if has('x11')" in the
snipped I proposed.

What is 'clipboard' set to? If "autoselect", register * (but not
register +) will try to follow your Visual selection. In that case you
should never yank into "* but just set the Visual selection then click
the middle mouse button in some other program. (I never use this: I
understand "+ better, and I have 'clipboard' set to the empty string. To
copy from/to another app, I use Vim's register + and whatever the other
app uses, usually Edit=>Cut/Copy/Paste or Ctrl-X/Ctrl-C/Ctrl-V)


Best regards,
Tony.
--
Be prepared... that's the Boy Scout's solemn creed.
Be prepared... to be clean in word and deed.
Don't solicit for your sister, that's not nice,
Unless you get a good percentage of her price ...
                -- Tom Lehrer

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "E353: Nothing in register *" after yanking in a mapping

Tony Mechelynck
In reply to this post by David Lam

On 27/06/08 23:43, David Lam wrote:
> yeah its an X thingy those registers are the same on windows
>
> which is why like i wanted to figure out how to yank to both so me
> mappings would work the same on linux as it does on windows

Method I (recommended):

Teach your fingers to use register-plus rather than register-star, and
update your mappings accordingly (i.e., to use only register-plus). When
going back on Windows, register-star is still the clipboard so you won't
have anything to unlearn.

Method II (untested)

        :map "* "+
        :cmap @* @+
        :map! <C-R>* <C-R>+


This won't apply to any use of "* in "noremap"-style mappings, of
course. It also doesn't apply to the use of * instead of + as the
operand of ":pu[t]", ":y[ank]", ":d[elete]", or any user-command defined
with the -register option.


Best regards,
Tony.
--
"I can't decide whether to commit suicide or go bowling."
                -- Florence Henderson

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: "E353: Nothing in register *" after yanking in a mapping

John Beckett-2

Tony Mechelynck wrote:

>> which is why like i wanted to figure out how to yank to both
>> so me mappings would work the same on linux as it does on
>> windows
>
> Method I (recommended):
>
> Teach your fingers to use register-plus rather than
> register-star, and update your mappings accordingly
> (i.e., to use only register-plus). When going back on
> Windows, register-star is still the clipboard so you
> won't have anything to unlearn.

Did you mean:
    When going back on Windows, register-PLUS
    is still the clipboard so you won't have
    anything to unlearn.

Register-plus is the clipboard register and it makes sense to use that on all
systems (indeed the Edit menu on gvim shows "+y and "+gP as the mappings for Copy
and Paste).

John


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "E353: Nothing in register *" after yanking in a mapping

Tony Mechelynck

On 28/06/08 02:05, John Beckett wrote:

> Tony Mechelynck wrote:
>>> which is why like i wanted to figure out how to yank to both
>>> so me mappings would work the same on linux as it does on
>>> windows
>> Method I (recommended):
>>
>> Teach your fingers to use register-plus rather than
>> register-star, and update your mappings accordingly
>> (i.e., to use only register-plus). When going back on
>> Windows, register-star is still the clipboard so you
>> won't have anything to unlearn.
>
> Did you mean:
>      When going back on Windows, register-PLUS
>      is still the clipboard so you won't have
>      anything to unlearn.

oops, yes I did.

>
> Register-plus is the clipboard register and it makes sense to use that on all
> systems (indeed the Edit menu on gvim shows "+y and "+gP as the mappings for Copy
> and Paste).
>
> John

Best regards,
Tony.
--
Es brillig war.  Die schlichte Toven
        Wirrten und wimmelten in Waben;
Und aller-mümsige Burggoven
        Dir mohmen Räth ausgraben.
                -- Lewis Carrol, "Through the Looking Glass"

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Loading...