On Feb 16, 2:06 pm, Benct Philip Jonsson b...@melroch.se wrote:
What would be the vim-speak equivalent of
the following Perl-speak?
!perl -ple 's/^\*/++$n.)/e'
Perhaps something like this?
let n = 1|g/^\*/s/\*/\=n . ')'/|let n = n + 1
Brett Stahlman
I had a 'bulleted' list in a
On 17/02/10 7:06 AM, Benct Philip Jonsson wrote:
What would be the vim-speak equivalent of
the following Perl-speak?
!perl -ple 's/^\*/++$n.)/e'
I had a 'bulleted' list in a plaintext document
and needed to convert it to a numbered list.
The perl method works fine, of course, so I'm
basically
On Tuesday 16 February 2010 06:33:28 pm Ben Schmidt wrote:
Then I can do
:let g:a=0|%s/^\*/\=Inc(g:a).)
don't you need an ending forward slash for the substitute?
sc
--
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
sc wrote:
On Tuesday 16 February 2010 06:33:28 pm Ben Schmidt wrote:
:let g:a=0|%s/^\*/\=Inc(g:a).)
don't you need an ending forward slash for the substitute?
Nope. You don't even need the 2nd slash if you want to replace
with nothing. The following 3 are the same:
:%s/foo
:%s/foo/
On 17/02/10 11:47 AM, sc wrote:
On Tuesday 16 February 2010 06:33:28 pm Ben Schmidt wrote:
Then I can do
:let g:a=0|%s/^\*/\=Inc(g:a).)
don't you need an ending forward slash for the substitute?
No.
But I do need quotes around the variable name passed to Inc...
:let