Sublime Forum

Feature request: Forward/Back through commits

#1

I have a branch with sparse commits, so I have to scroll and watch carefully to find the previous commit in the chain. It would be so cool if Control or Shift changed the function of the Forward/Back buttons to Next Commit/Previous Commit. (I actually thought they were already doing that, but it was just because I had manually paged through a bunch of commits.)

BTW, Sublime Merge is a fantastic new tool. Thanks!

1 Like

#2

I totally agree with you! I couldn’t find a way to do this too, in case there is no - it would be a very handy addition.

0 Likes

#3

You can add the request to the official repo for sublime merge: https://github.com/sublimehq/sublime_merge

0 Likes

#4

I detailed ways to get this type of functionality working here.

1 Like

#5

Hm, hiding all branches is not really a practicable way in many cases for me. I also helped myself with clicking through the parents, but hm.

“Navigate” → “Go to parent” in the menu is a help (just using the command palette, so I didn’t see this previously.
Is there a way to add a hotkey+cmd-palette(+maybe a context menu) entry for this? What is the command keyword to access this feature?
Thx in advance!

0 Likes

#6

The command associated with this command is navigate_to_parent (which I got by looking in Main.sublime-menu in the Packages/Default.sublime-package in the installation folder of Merge).

You can bind it to a key by creating (or adding to) a Default (<PLATFORM>).sublime-keymap file in your User package, where <PLATFORM> is one of Linux, Windows, or OSX).

An example of that would be the following, assuming you don’t already have any custom key bindings (if you do, just add the binding to the file instead):

[
    { "keys": ["ctrl+shift+left"], "command": "navigate_to_parent" },
]

You can add this to the context menus by creating a file named Commit.sublime-menu with the following content. This will make the command available in the commit context menu, which is visible when you right click on a commit in the graph or use the “three dots” menu in the commit information in the top-right of the window.

[
    { "caption": "-", "id": "end" },

    {
        "caption": "Navigate to Parent",
        "command": "navigate_to_parent"
    }
]

To add it to the command palette, you would create a sublime-commands file; for example you could create a Default.sublime-commands file with the following content:

[
    {
        "caption": "Navigate to Parent",
        "command": "navigate_to_parent"
    }
]

In all cases, the files should go in your User package, which is available by using Preferences > Browse Packages.

4 Likes

#7

Thank you so much for your detailed answer!! This is really great and veeery helpful. :pray:

Also thank you esp. for this! Now I have an idea how to get to those “magic commands” on my own, great. It really takes a bit of time to understand how Sublime T/M are constructed but I like it very much.

0 Likes

#8

Done. Thanks, Clams!

0 Likes