简体   繁体   English

如何让 PHPStorm 折叠打开文件中的所有方法/函数?

[英]How to make PHPStorm collapsing all methods/functions on file open?

How to make something like this?如何制作这样的东西? (all methods collapsed by default without any hotkeys) (所有方法默认折叠,没有任何热键)

折叠方法

This works for me: CTRL SHIFT numpad -这对我有用CTRL SHIFT 数字键盘 -

It also collapses the class... but then just manually re-open the class by clicking the + and the methods are folded.它还会折叠类...但只需通过单击 + 手动重新打开类,方法就会折叠起来。

And then you can re-open all methods with CTRL SHIFT numpad +然后您可以使用CTRL SHIFT 小键盘 +重新打开所有方法

https://www.jetbrains.com/help/phpstorm/code-folding-commands.html https://www.jetbrains.com/help/phpstorm/code-folding-commands.html

Solution found (File -> Settings -> Editor -> General -> Code Folding找到解决方案(文件 -> 设置 -> 编辑器 -> 常规 -> 代码折叠

在此处输入图片说明

You don't need to change anything in the settings like Dmitry suggested.您不需要像 Dmitry 建议的那样更改设置中的任何内容。

Simply do ⌥⌘⌨ * 1 -- That's OPTION+CMD+NumPad *, then 1.只需执行⌥⌘⌨ * 1 -- 即 OPTION+CMD+NumPad *,然后是 1。

If you're on Windows, it's CTRL+SHIFT+NumPad *, then 1.如果您使用的是 Windows,则是 CTRL+SHIFT+NumPad *,然后是 1。

I'm using ubuntu,我用的是ubuntu

the command is命令是

-> CTL, SHIFT and MINUS ( this will collapse the whole class including all methods ) -> CTL、SHIFT 和 MINUS (这将折叠整个类,包括所有方法

-> CTL, PLUS ( will expand the class but all methods should be collapsed ) -> CTL,PLUS (将扩展类,但所有方法都应折叠)

-> CTL, SHIFT and PLUS ( will expand the whole class including all methods ) -> CTL、SHIFT 和 PLUS (将扩展整个类,包括所有方法

for windows PhpStorm 2021.1适用于 Windows PhpStorm 2021.1

ctrl + expand method ctrl + 展开方法
ctrl - collapse method ctrl - 折叠方法
ctrl+shift - collapse all method ctrl+shift - 折叠所有方法
ctrl+shift + expand all method ctrl+shift + 展开全部方法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在没有 PhpStorm 的情况下打开 PhpStorm 项目 - How to open a PhpStorm project without PhpStorm 如何折叠/展开PhpStorm中文件中的所有注释块? - How to collapse/expand all comment blocks in a file in PhpStorm? 如何使PhpStorm显示由@method声明的方法抛出的异常(或从魔术方法docblock继承它们)? - How to make PhpStorm show exceptions thrown by a methods declared with @method (or inherit them from magic method docblock)? 如何在PhpStorm中搜索文件? - How to search a file in PhpStorm? PhpStorm:如何在自动完成(Zend2 ViewHelper)中从其他类获取所有方法? - PhpStorm: how to get all methods from other class in autocomplete (Zend2 ViewHelper)? 如何编写PHP函数以使它们可以在IDE中使用(PhpStorm) - How to write PHP functions to make them available to use across the IDE (PhpStorm) 如何在所有方法中使构造函数中的变量可用? - How to make a variable in constructor available in all methods? PhpStorm 中的 PHPUnit 测试:无法打开文件 - PHPUnit tests in PhpStorm: Cannot open file PhpStorm在项目中打开外部文件并进行检查和突出显示 - PhpStorm open external file in project with inspection and highlighting 使PhpStorm对所有项目使用相同的设置 - Make PhpStorm use same settings for all projects
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM