Thursday, August 8, 2013

Re: How to append lines when iterating over a range.

On Wednesday, August 7, 2013 8:58:55 PM UTC-5, Eric Siegel wrote:
> My coworker said that in emacs he's able to get the current cursor position. In vim we can get the current line '.', but if we could get the cursor position as the range iterates, we wouldn't have to worry about the number of lines appended.
>

I'm not sure whether you still need the answer to this question, but:

:help getpos()

Also:

:help line()
:help col()
:help virtcol()

Any of these functions can return information about the cursor position.

Maybe you already know about these and I misunderstand your question? You mentioned using '.' to get the current line, by which you might mean line('.'), but if that's the case I'm not sure what your problem is because that will give you the cursor line.

--
--
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.

No comments: