Sublime Forum

Navigate to Commit command

#1

Hi,

I am trying to create a shortcut for the Navigate to Commit command but I don’t know how that command is called. Does anyone know? Also how can I find out? It looks that Ctrl + ` does not bring a console.

Cheers

0 Likes

#2

Hi @bempelise,

The command you’re looking for is called navigate_to_commit.
Which takes a commit ID (partial or full) using the commit parameter.

Kind regards,
- Dylan

2 Likes

#3

Thanks that’s the one I was looking for

0 Likes

#4

I see that this immediately runs the command with any argument that is given to it. I would like it to get me to the point where I am about to give the hash. Is this possible?

A Ctrl+G (to go to the navigate to commit prompt) and Ctrl+V to paste the hash would be great.

Now I have to do
Ctrl+P
type ‘navigate commit’
Ctrl+V

0 Likes

#5

Hi @bempelise,

What’s the exact definition you’ve made for the keybinding?

Thanks,
- Dylan

0 Likes

#6

Hi @djohnston it’s

[
    {
        "keys": ["ctrl+g"],
        "command": "navigate_to_commit"
    }
]
0 Likes

#7

Hi @bempelise,

It should pop up with a dialog to enter the commit ID if none has been provided. This sounds like a potential bug. I’ll be investigating this further, and will get back to you.

Thanks,
- Dylan

1 Like

#8

Hi @bempelise,

Just following up on my previous comment. As it’s an interactive command (we’re relying on the command palette), you’ll want to use the following instead:

	{
		"keys": ["ctrl+g"],
		"command": "show_command_palette",
		"args": { "command": "navigate_to_commit" }
	},

Let me know if this works for you :slight_smile:

Thanks,
- Dylan

3 Likes

#9

Perfect that’s exactly what I wanted thank you @djohnston!

2 Likes