28

A rather simple question that I'm sure there's an answer to, I just can't seem to find it by searching

Sometimes I'm looking at or writing some code I want to double check or find out which class I'm in, is there an easier way I can find out without scrolling up to the class line?

4 Answers 4

26

Try ALT+Q, or Mac: Ctrl + Shift + Q for Mac as described in the PyCharm docs

5
  • 7
    Mac: Ctrl + Shift + Q Jul 25, 2016 at 8:05
  • If you're in a method and a method header is out of the viewport, it displays just the method header, not class. Oct 21, 2016 at 20:17
  • But can you navigate to that point as well? Ideally with next / previous class shortcut, much like Alt + Up / Down for functions. Dec 22, 2016 at 9:31
  • 2
    Is it possible to show this information permanently in the upper part of the editor window?
    – JustAC0der
    Mar 10, 2017 at 9:23
  • 2
    @JustAC0der now it shows by default always under the editor: stackoverflow.com/a/45708386/895245 Aug 16, 2017 at 8:24
13

Breadcrumb bar just under editor

As of Pycharm 2017.02, there is a breadcrumb navigation under every editor window that shows information like:

ClassName > FunctionName > for i in range(): > if True:

You can also click to go to any of those points in the code.

0
12

Navigate | Select In... | Project View or File Structure, or you can keep Project or Structure view visible with the Autoscroll from Source option enabled.

It's also possible to use Navigate | File Structure for a pop-up showing your current position.

4
  • Thanks, I can't seem to find the Autoscroll from source option though?
    – GP89
    Jul 23, 2012 at 8:29
  • Ah thank you, I found it but its got its own button under Structure. Does exactly what I wanted as I usually have the structure pane open all the time.
    – GP89
    Jul 23, 2012 at 9:36
  • 1
    The File Structure view is quite clunky; is there no way to obtain a breadcrumb view in python, like one has when editing XML/HTML (ie jetbrains.com/pycharm/webhelp/navigating-with-breadcrumbs.html) ? I can't find any information about this, which is a bit baffling; surely it's possible to implement, otherwise the File Structure view would also be impossible to implement.
    – gamen
    Jul 30, 2014 at 8:39
  • I think it is now called "Always select opened element" (instead of Autoscroll from source) under Structure that highlights the current method in the Structure pane.
    – omsrisagar
    Mar 9 at 22:16
1

For mac it is: Ctrl + Shift + q.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.