SublimeText3 折叠/展开所有方法 [英] SublimeText3 Fold/Unfold all methods

查看:140
本文介绍了SublimeText3 折叠/展开所有方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 C++ 和 Java 中使用 SublimeText3.我想知道是否有办法折叠文件/类中的所有方法,然后将它们全部展开,而不管插入符号在哪里.或者有没有办法列出所有的功能/方法.

I am using SublimeText3 for C++ and Java. I am wondering if there is a way to fold all of the methods in a file / class, and then unfold them all, regardless of where the caret is. Or is there a way to list all the functions / methods.

基本上,我希望能够输入一个文件并快速浏览所有方法.

Basically I would like to be able to enter a file and see all the methods at one quick glance.

谢谢

推荐答案

使用 Sublime Text 3 菜单,可以找到 EDIT -> Code Folding ->折叠方法,并会帮助您告诉您它们分配给的默认键盘快捷键.

Using the Sublime Text 3 menu, you can find EDIT -> Code Folding -> which exposes the folding methods and will helpfully tell you the default keyboard shortcuts they are assigned to.

默认情况下,您按 Ctrl+K,然后按 Ctrl+1 折叠所有子程序.然后,要展开所有内容,我会按 Ctrl+K 然后按 Ctrl+J.

By default you press Ctrl+K, then Ctrl+1 to fold all subroutines. Then, to unfold all I would press Ctrl+K then Ctrl+J.

如果这对您的文件类型/语法不起作用,请尝试 Ctrl+K、Ctrl+2 及以上,看看另一个折叠级别是否适合您.

If this does not work for your file type / syntax, try Ctrl+K, Ctrl+2 and above to see if another folding level works for you.

对我来说不幸的是,我使用的专有代码需要自定义语法和编写在我们内部包中的自定义函数来折叠我们的所有函数(一个用 python 编写并作为包安装的新 sublime 命令).

Unfortunately for me, the proprietary code I work with required custom syntax and a custom function written in our in-house package to fold all of our functions (a new sublime command written in python and installed as a package).

这篇关于SublimeText3 折叠/展开所有方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆