> >Well, this works:
> >
> >def Fix_beginfigs()
> > g:index = 1
> > g/^beginfig(\d*);$/s//\='beginfig(' .. g:index .. ');'/ | g:index =
> > g:index + 1 unlet g:index
> >enddef
> >
> >However, using a legacy function would not be worse. The global
> >command does most of the work, what
Bram Moolenaar said on Sun, 04 Jul 2021 23:30:01 +0200
>Well, this works:
>
>def Fix_beginfigs()
> g:index = 1
> g/^beginfig(\d*);$/s//\='beginfig(' .. g:index .. ');'/ | g:index =
> g:index + 1 unlet g:index
>enddef
>
>However, using a legacy function would not be worse. The global
>command
> The MetaPost plugin in Vim contains the following definition to replace
> the n-th occurrence of `beginfig(...)` with `beginfig(n)`:
>
> function! s:fix_beginfigs()
> let i = 1
> g/^beginfig(\d*);$/s//\='beginfig('.i.');'/ | let i = i + 1
> endfunction
>
> command
On 7/4/2021 1:08 PM, Julius Hamilton wrote:
I would like to print the output of a shell command - a webpage dump -
into a Vim buffer, and have those lines immediately folded, rather than
a second step of selecting and folding them.
The command would look something like:
:r! w3m -dump url.com
I would like to print the output of a shell command - a webpage dump - into
a Vim buffer, and have those lines immediately folded, rather than a second
step of selecting and folding them.
The command would look something like:
:r! w3m -dump url.com FOLD
How would this be possible?
I would like
The MetaPost plugin in Vim contains the following definition to replace
the n-th occurrence of `beginfig(...)` with `beginfig(n)`:
function! s:fix_beginfigs()
let i = 1
g/^beginfig(\d*);$/s//\='beginfig('.i.');'/ | let i = i + 1
endfunction
command -nargs=0 FixBeginfigs