Repeat last jump in a single keystroke

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Repeat last jump in a single keystroke

Ethan Mallove

Hello,

How do I repeat my last jump operation with a single-keystroke? E.g., "]c" or "[c" in diff mode. The "repmo.vim" plugin (http://vim.sourceforge.net/scripts/script.php?script_id=2174) does something similar to what I need, but I'm not sure how to tweak it to map ";" to my last jump command.

Thanks,
Ethan

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Repeat last jump in a single keystroke

Andy Wokula

Ethan Mallove schrieb:

> Hello,
>
> How do I repeat my last jump operation with a single-keystroke? E.g.,
> "]c" or "[c" in diff mode. The "repmo.vim" plugin
> (http://vim.sourceforge.net/scripts/script.php?script_id=2174) does
> something similar to what I need, but I'm not sure how to tweak it to
> map ";" to my last jump command.
>
> Thanks,
> Ethan

After installing repmo.vim, you can add "[c" and "]c" in your vimrc with
    func! AfterPlugin()
        RepmoMap [c ]c
        RepmoMap ]c [c
    endfunc
    au VimEnter * call AfterPlugin()

but you have to type "1]c" instead of "]c" to update the repetition keys
";" and ",".

I think it's not worth the effort.  What I use is:
    :nn <expr> ( &diff ? "[c" : "("
    :nn <expr> ) &diff ? "]c" : ")"

I.e. in diff-mode, jump between diffs instead of sentences.

--
Andy



--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Repeat last jump in a single keystroke

Ethan Mallove



On Jul 15, 5:37 pm, Andy Wokula <[hidden email]> wrote:

> Ethan Mallove schrieb:
>
> > Hello,
>
> > How do I repeat my last jump operation with a single-keystroke? E.g.,
> > "]c" or "[c" in diff mode. The "repmo.vim" plugin
> > (http://vim.sourceforge.net/scripts/script.php?script_id=2174) does
> > something similar to what I need, but I'm not sure how to tweak it to
> > map ";" to my last jump command.
>
> > Thanks,
> > Ethan
>
> After installing repmo.vim, you can add "[c" and "]c" in your vimrc with
>     func! AfterPlugin()
>         RepmoMap [c ]c
>         RepmoMap ]c [c
>     endfunc
>     au VimEnter * call AfterPlugin()
>
> but you have to type "1]c" instead of "]c" to update the repetition keys
> ";" and ",".
>
> I think it's not worth the effort.  What I use is:
>     :nn <expr> ( &diff ? "[c" : "("
>     :nn <expr> ) &diff ? "]c" : ")"
>
> I.e. in diff-mode, jump between diffs instead of sentences.

Perfect. Thanks!

-Ethan

>
> --
> Andy
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---