On 2013-08-08 10:42, Eric Siegel wrote:
> Ben,
>
> Hopefully this doesn't get sent twice, but it seems that my last
> response was lost in the ether.
>
> I don't think that those functions help. Here is a simplified
> version of my problem.
>
> Say we want to convert these lines:
>
> line1
> line2
> line3
>
> Into this:
>
> line1
> some
> appended
> lines
> line2
> some
> appended
> lines
> line3
> some
> appended
> lines
>
> My first attempt at the function looks like this:
>
> function! Example()
> call append(line('.'), ["some", "appended", "lines"])
> endfunction
>
> The problem is that this won't work for ranges.
>
> If you try this command:
>
> 1,3call Example()
>
> You get this output:
>
> line1
> some
> some
> some
> appended
> lines
> appended
> lines
> appended
> lines
> line2
> line3
Which can take advantage of the aforementioned line-marking that :g
does by then doing
:1,3g/^/call Example()
-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 vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Thursday, August 8, 2013
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment