Diffs - Next Change Remap

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

Diffs - Next Change Remap

Dominic Evans
Hi,

I currently type ']czz' to get to the next change and redraw it in the
center of the window whilst in diff mode.

Is there anyway to remap ]c to automatically do this?

Cheers,
Dom
Reply | Threaded
Open this post in threaded view
|

Re: Diffs - Next Change Remap

A.J.Mechelynck
----- Original Message -----
From: "Dominic Evans" <[hidden email]>
To: "VIM" <[hidden email]>
Sent: Tuesday, September 06, 2005 3:44 PM
Subject: Diffs - Next Change Remap


> Hi,
>
> I currently type ']czz' to get to the next change and redraw it in the
> center of the window whilst in diff mode.
>
> Is there anyway to remap ]c to automatically do this?
>
> Cheers,
> Dom

What about

    :noremap    ]c    ]czz

?


Best regards,
Tony.

Reply | Threaded
Open this post in threaded view
|

Re: Diffs - Next Change Remap

Tim Chase-2
In reply to this post by Dominic Evans
> I currently type ']czz' to get to the next change and redraw
> it in the center of the window whilst in diff mode.
>
> Is there anyway to remap ]c to automatically do this?

Well, you can go for the straightforward

        :nnoremap ]c ]czz

The "noremap" portion tells Vim not to go recursive on you.

Alternatively, you can set the 'scrolloff' option to some high
number as described in

        :help 'scrolloff'

which will simply always keep the cursor in the middle of the screen.

Just a few thoughts,

-tim




Reply | Threaded
Open this post in threaded view
|

Re: Diffs - Next Change Remap

Dominic Evans
Ahhhh. I always wondered what noremap was for :)

Cheers
Dom

On 06/09/05, Tim Chase <[hidden email]> wrote:

> > I currently type ']czz' to get to the next change and redraw
> > it in the center of the window whilst in diff mode.
> >
> > Is there anyway to remap ]c to automatically do this?
>
> Well, you can go for the straightforward
>
>         :nnoremap ]c ]czz
>
> The "noremap" portion tells Vim not to go recursive on you.
>
> Alternatively, you can set the 'scrolloff' option to some high
> number as described in
>
>         :help 'scrolloff'
>
> which will simply always keep the cursor in the middle of the screen.
>
> Just a few thoughts,
>
> -tim
>
>
>
>
>
On 06/09/05, Tony Mechelynck <[hidden email]> wrote:

> ----- Original Message -----
> From: "Dominic Evans" <[hidden email]>
> To: "VIM" <[hidden email]>
> Sent: Tuesday, September 06, 2005 3:44 PM
> Subject: Diffs - Next Change Remap
>
>
> > Hi,
> >
> > I currently type ']czz' to get to the next change and redraw it in the
> > center of the window whilst in diff mode.
> >
> > Is there anyway to remap ]c to automatically do this?
> >
> > Cheers,
> > Dom
>
> What about
>
>     :noremap    ]c    ]czz
>
> ?
>
>
> Best regards,
> Tony.
>
>