Search code examples
pycharm

Shortcut to Jump to definition in current file/tab in pycharm


Brand new pycharm user, but couldn't find an answer anywhere.

I come form subline text 3 which had a super convienient short cut ^R which you would then type a few characters and options for the class/method/function definitions in the currently opened file.

It's s complicated project with lots of files, so doing SHIFT SHIFT (search everywhere) and typing brings up a ton of stuff, so I basically have to type the entire definition name exactly right before it shows up much less gets to the top of the list.

Is there a way of doing similar to SHIFT SHIFT, but limited to just the current file? Either out of the box of some customization to make it work?


Solution

  • Update:

    While maybe not exactly what you're looking for, maybe PyCharm's view structure of source file feature may be useful. Use Alt+7 to get a window, or Ctrl+F12 to get a pop-up. In the pop-up, you can begin typing to narrow results. Selecting an item and hitting Enter will teleport you to the definition.

    Original Answer Below:

    Pressing Ctrl+Shift+I will give you a preview of the definition in a pop up. If you hit Enter while the pop up is open, you'll be teleported to the source of the definition.

    If you just want the docstring, you can hit Ctrl+Q for "quick documentation."

    Sources:

    Code reference information

    Editor basics