Sublime Forum

Peek Definition

#1

This functionality is in visual studio code. It is very handy functionality. it would be nice to have it in ST3

1 Like

#2

maybe you could explain the feature for people that have never used VS Code :wink:

0 Likes

#3

This functionality is described in this link:
https://msdn.microsoft.com/en-us/library/dn160178.aspx

0 Likes

#4

Yes, you can use the “Goto Definition” functionality and then hit escape to return to where you were. In fact, this method is technically more powerful since you can browse around the file before escaping back to the original context.

Edit: I did just realize if there is only a single definition of an identifier found in your project, it will open the file, so you would need to close the file. With multiple files, it shows a quick panel to select from the different definitions, which allows you to use the escape key. Alternatively if it is in the same file you are in right now, you could use cmd/ctrl+u to return to the previous location in the file.

1 Like

#5

Unfortunately the escape key method to return to where you were doesn’t work. Nothing is additionally bound to that key in my setup either.

0 Likes

#7

@lukalazov I ended up doing something just like that. I bound the super key with the , and the . to travel back and forth through my cursor’s history.

0 Likes

#8

I found something that looks promising. It’s on GitHub if someone wants to fork it and push requests to the owner, or create a new more robust feature set package for sublime:

0 Likes