PhpStorm - Highlight active file in project navigator

前端 未结 4 637
时光说笑
时光说笑 2020-12-12 16:43

Does anyone know how to highlight the current file in the project navigator, or a hotkey to expand folders to the active file?

I have looked around and couldn\'t find

相关标签:
4条回答
  • 2020-12-12 17:15

    On Demand

    Should be used if you do not like when your Project View panel gets changed/moves without your consent.

    Navigate | Select in... | Project View

    Alt+F1, 1 for Windows/Linux

    +F1, 1 (or fn+⌥ Opt+F1, 1) for Mac OS


    You may also click on "target like" icon on actual Project View panel with your mouse (see screenshot below -- the first icon there).


    If you wish to use shorter/single shortcut instead of standard 2-step shortcut:

    • install "Extra Actions" plugin
    • assign custom shortcut to newly provided "Select in Project" action

    NOTE: as of some 2017.x or maybe even 2016.x version the IDE has own dedicated Select in Project View action (so no need for additional plugin). You can find it in Keymap under the Other branch (hint: use search box to narrow the list).


    Automatically

    Can be used if you do not mind (or even want) to have Project View panel keep focused on currently edited file (so it scrolls/moves up and down/expands when needed).

    NOTE: with frequently switching between the files (e.g. CSS & HTML) when you have a lot of files in your project such "scrolling" may become quite annoying pretty fast (if such files are located in invisible right now part of the project tree).

    Activate Autoscroll from Source option in Project View panel (right click on tool window header bar/title or menu under "gear" icon)

    0 讨论(0)
  • 2020-12-12 17:27

    Just click the circular icon (with tooltip Scroll from Source) to navigate in the project directory tree and highlight the corresponding active file in the PhpStorm editor.

    0 讨论(0)
  • 2020-12-12 17:29

    Here is a nice feature: Autoscroll to Source and Autoscroll from Source.

    It is available in all IntelliJ products .

    Autoscroll to Source, Autoscroll from Source

    0 讨论(0)
  • 2020-12-12 17:36

    The above answers are all valid but unfortunately you'll have to enable them for each project.

    There's a plugin from Jetbrains that will enable this behaviour by default for all new projects.

    http://plugins.jetbrains.com/plugin/7575?pr=

    0 讨论(0)
提交回复
热议问题