vimgolf E20

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

vimgolf E20

Neil Earnshaw
This command works fine in vim on my chromebook:

:*s/)/);/

It appends a ';' to each line that ends with a ')'.

But when I try it in vimgolf I get E20 Mark not set.

Can anyone clue me in to what's going on, please?

-Neil (noob)

--
--
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].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/7c20ffde-4eab-4fab-8e1c-25656876d409%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: vimgolf E20

Niels Kobschaetzki

On 6. May 2020, at 20:13, Neil Earnshaw <[hidden email]> wrote:


This command works fine in vim on my chromebook:

:*s/)/);/


What is *s?

Cheers,

Niels

--
--
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].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/A5939E6B-D427-41C1-BEF2-7844676071CB%40kobschaetzki.net.
Reply | Threaded
Open this post in threaded view
|

Re: vimgolf E20

Neil Earnshaw
's' is substitute and the '*' applies it to all matching lines in the file

On Wed, May 6, 2020 at 7:38 PM Niels Kobschätzki <[hidden email]> wrote:

On 6. May 2020, at 20:13, Neil Earnshaw <[hidden email]> wrote:


This command works fine in vim on my chromebook:

:*s/)/);/


What is *s?

Cheers,

Niels

--
--
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].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/A5939E6B-D427-41C1-BEF2-7844676071CB%40kobschaetzki.net.

--
--
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].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CA%2Bz-5tgEm%2Bj9xyiAQc-qt9aUCC0k4BtX%2B4An7wGMuqOi2isK_A%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: vimgolf E20

Chris Willis
 
 
Sent: Wednesday, May 06, 2020 7:44 PM
Subject: Re: vimgolf E20
 
's' is substitute and the '*' applies it to all matching lines in the file
 
On Wed, May 6, 2020 at 7:38 PM Niels Kobschätzki <[hidden email]> wrote:
 
On 6. May 2020, at 20:13, Neil Earnshaw <[hidden email]> wrote:


This command works fine in vim on my chromebook:
 
:*s/)/);/
 
 
What is *s?
 
Cheers,
 
Niels
--
--
really? I’ve always used :%s
 
Chris

--
--
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].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/27CBE16339B04D6FB6A103EE8F6DA5DA%40ChrisPCW7.
Reply | Threaded
Open this post in threaded view
|

Re: vimgolf E20

Niels Kobschaetzki

On 6. May 2020, at 21:05, 'Chris Willis' via vim_use <[hidden email]> wrote:


 
 
Sent: Wednesday, May 06, 2020 7:44 PM
Subject: Re: vimgolf E20
 
's' is substitute and the '*' applies it to all matching lines in the file

So the same as :%s/foo/bar/g but saving one char?

 
On Wed, May 6, 2020 at 7:38 PM Niels Kobschätzki <[hidden email]> wrote:
 
On 6. May 2020, at 20:13, Neil Earnshaw <[hidden email]> wrote:


This command works fine in vim on my chromebook:
 
:*s/)/);/
 
 
What is *s?
 
Cheers,
 
Niels
--
--
really? I’ve always used :%s

Niels

--
--
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].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/DC0E59F5-25F0-4A0C-B962-9E86C891EF34%40kobschaetzki.net.
Reply | Threaded
Open this post in threaded view
|

Re: vimgolf E20

Tim Chase
In reply to this post by Neil Earnshaw
On 2020-05-06 11:12, Neil Earnshaw wrote:
> :*s/)/);/
>
> It appends a ';' to each line that ends with a ')'.
>
> But when I try it in vimgolf I get E20 Mark not set.

Assuming you haven't changed your 'cpo' to include "*"

  :help cpo-star

the "*" is the same as the range

  '<,'>

so

  :*s/)/);

appends a semicolon after parens in the previously selected range.

The error suggests that you haven't yet visually-selected anything to
set those marks.

Hope this helps,

-tim

--
--
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].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20200506142658.71ae4314%40bigbox.attlocal.net.
Reply | Threaded
Open this post in threaded view
|

Re: vimgolf E20

Neil Earnshaw
In reply to this post by Neil Earnshaw
Ah ha,

So * on my machine is doing the same % in the standard install.  I got my config from somewhere in internet space, hence the difference.

:%s/)/);

...does the job and doesn't complain about marks.

The idea with vimgolf is to achieve the required edit in a few keystrokes as possible. I've got this down to 11 (including ESC, CR and ZZ to save), but the best in the rankings is 10 keystrokes, and I just can't figure out how to get rid of that last keypress.  : P

Thanks for the help with '%',
-N

--
--
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].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/bfa14f67-63a4-463a-aad7-b7081d538513%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: vimgolf E20

Christian Brabandt

On Mi, 06 Mai 2020, Neil Earnshaw wrote:

> Ah ha,
>
> So * on my machine is doing the same % in the standard install.  I got
> my config from somewhere in internet space, hence the difference.
>
> :%s/)/);
>
> ...does the job and doesn't complain about marks.
>
> The idea with vimgolf is to achieve the required edit in a few
> keystrokes as possible. I've got this down to 11 (including ESC, CR
> and ZZ to save), but the best in the rankings is 10 keystrokes, and I
> just can't figure out how to get rid of that last keypress.  : P
>
> Thanks for the help with '%',

Check your compatibility options, :h cpo-*


Best,
Christian
--
Man darf das Schiff nicht an einen einzigen Anker und das Leben nicht
an eine einzige Hoffnung binden.
                -- Epiktet (griechischer Stoiker, 50-138 n.Chr.)

--
--
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].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20200507060320.GD23589%40256bit.org.
Reply | Threaded
Open this post in threaded view
|

Re: vimgolf E20

Neil Earnshaw
My basic.vim config file has the following:

    "Make search act like search in modern browsers
    set incsearch

Might this be why '*' is applying the s// expression to all lines?

Or is it this:

    "For regular expressions turn magic on
    set magic

???

On Thu, May 7, 2020 at 7:03 AM Christian Brabandt <[hidden email]> wrote:

On Mi, 06 Mai 2020, Neil Earnshaw wrote:

> Ah ha,
>
> So * on my machine is doing the same % in the standard install.  I got
> my config from somewhere in internet space, hence the difference.
>
> :%s/)/);
>
> ...does the job and doesn't complain about marks.
>
> The idea with vimgolf is to achieve the required edit in a few
> keystrokes as possible. I've got this down to 11 (including ESC, CR
> and ZZ to save), but the best in the rankings is 10 keystrokes, and I
> just can't figure out how to get rid of that last keypress.  : P
>
> Thanks for the help with '%',

Check your compatibility options, :h cpo-*


Best,
Christian
--
Man darf das Schiff nicht an einen einzigen Anker und das Leben nicht
an eine einzige Hoffnung binden.
                -- Epiktet (griechischer Stoiker, 50-138 n.Chr.)

--
--
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].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20200507060320.GD23589%40256bit.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].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CA%2Bz-5tjk-Y%3DrK5cFDX7mNi_ujdyOb%3DeN1SpR9W8LuzM72HjXgA%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: vimgolf E20

Christian Brabandt

On Do, 07 Mai 2020, Neil Earnshaw wrote:

> My basic.vim config file has the following:
>
>     "Make search act like search in modern browsers
>     set incsearch

See the help what this does: :h 'incsearch'

> Might this be why '*' is applying the s// expression to all lines?

Are you sure, that your :*s is the same as :%s?

>     "For regular expressions turn magic on
>     set magic

That is the default and should not be set to a different value. See
:h 'magic'

Best,
Christian
--
Chuck Norris hat bis Unendlich gezählt – zwei Mal.

--
--
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].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20200507180620.GG23589%40256bit.org.