Next: , Up: Sections   [Contents][Index]


4.2.1 Section Movement

To move within a section use the usual keys (C-p, C-n, C-b, C-f etc), whose global bindings are not shadowed. To move to another section use the following commands.

p     (magit-section-backward)

When not at the beginning of a section, then move to the beginning of the current section. At the beginning of a section, instead move to the beginning of the previous visible section.

n     (magit-section-forward)

Move to the beginning of the next visible section.

M-p     (magit-section-backward-siblings)

Move to the beginning of the previous sibling section. If there is no previous sibling section, then move to the parent section instead.

M-n     (magit-section-forward-siblings)

Move to the beginning of the next sibling section. If there is no next sibling section, then move to the parent section instead.

^     (magit-section-up)

Move to the beginning of the parent of the current section.

The above commands all call the hook magit-section-movement-hook. Any of the functions listed below can be used as members of this hook.

Variable: magit-section-movement-hook

This hook is run by all of the above movement commands, after arriving at the destination.

Function: magit-hunk-set-window-start

This hook function ensures that the beginning of the current section is visible, provided it is a hunk section. Otherwise, it does nothing. This function is a member of the hook’s default value.

Function: magit-section-set-window-start

This hook function ensures that the beginning of the current section is visible, regardless of the section’s type. If you add this to magit-section-movement-hook, then you must remove the hunk-only variant in turn.

Function: magit-log-maybe-show-more-commits

This hook function only has an effect in log buffers, and point is on the "show more" section. If that is the case, then it doubles the number of commits that are being shown. This function is a member of the hook’s default value.

Function: magit-log-maybe-update-revision-buffer

When moving inside a log buffer, then this function updates the revision buffer, provided it is already being displayed in another window of the same frame. This function is a member of the hook’s default value.

Function: magit-log-maybe-update-blob-buffer

When moving inside a log buffer and another window of the same frame displays a blob buffer, then this function instead displays the blob buffer for the commit at point in that window.

Function: magit-status-maybe-update-revision-buffer

When moving inside a status buffer, then this function updates the revision buffer, provided it is already being displayed in another window of the same frame.

Function: magit-status-maybe-update-blob-buffer

When moving inside a status buffer and another window of the same frame displays a blob buffer, then this function instead displays the blob buffer for the commit at point in that window.

User Option: magit-update-other-window-delay

Delay before automatically updating the other window.

When moving around in certain buffers, then certain other buffers, which are being displayed in another window, may optionally be updated to display information about the section at point.

When holding down a key to move by more than just one section, then that would update that buffer for each section on the way. To prevent that, updating the revision buffer is delayed, and this option controls for how long. For optimal experience you might have to adjust this delay and/or the keyboard repeat rate and delay of your graphical environment or operating system.


Next: , Up: Sections   [Contents][Index]