Monday, May 13, 2019

Re: triggering macro on navigation to new line

Gary,

thanks for this tip, yes it looks like I could use it to do what I
want but my concern is speed. I don't want to trigger a potentially
expensive macro each time the cursor moves anytime, just when the line
number changes.

So perhaps there is a need for CursorLineMoved? I see in vim where I
might be added, but I haven't contributed patches to vim before, so
i'm not sure on how to go about it.

Ed

On Mon, May 13, 2019 at 11:11 AM Gary Johnson <garyjohn@spocom.com> wrote:
>
> On 2019-05-13, Ed Peschko wrote:
> > All,
> >
> > I just found :set nolazyredraw, which is *very* nice in speeding up
> > user interaction time, and which helps immensely with my goal of a
> > quickfix-like editing mode (see the post that I made earlier), so the
> > only thing left is if there is a way to trigger an action when you go
> > to a new line, whether you:
> >
> > 1. search for a pattern
> > 2. do :<lineno>
> > 3. hit j or k, up-arrow, down-arrow
> >
> > I suppose I could re-map each of these actions but IMO it would be a
> > lot cleaner if something universal existed. Does vim have something
> > like this?
>
> The CursorMoved autocommand event may do what you want. See:
>
> :help CursorMoved
>
> Regards,
> Gary
>
> --
> --
> 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.
> To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20190513181120.GA12153%40phoenix.
> For more options, visit https://groups.google.com/d/optout.

--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CACQ%2BYcv%3D3VbQ8vV3hqJ9F_S1XFpift%3Dh7QAiiXkjbT_GTa1O8A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments: