如何在 Sublime Texteditor 中获取大纲视图?

发布于 2024-08-17 15:58:29 字数 406 浏览 6 评论 0原文

如何在 Windows 版 sublime 文本编辑器 中获取大纲视图?

小地图很有帮助,但我错过了传统的大纲(我的代码中所有功能的可点击列表,按它们出现的顺序排列,以便快速导航和定位)

也许有一个插件、附加组件或类似的?如果您能简短地指出使其工作所需的步骤,那就太好了。

有一个 重复这个问题在 Sublime Text 论坛上

How do I get an outline view in sublime text editor for Windows?

The minimap is helpful but I miss a traditional outline (a klickable list of all the functions in my code in the order they appear for quick navigation and orientation)

Maybe there is a plugin, addon or similar? It would also be nice if you can shortly name which steps are neccesary to make it work.

There is a duplicate of this question on the sublime text forums.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

听风吹 2024-08-24 15:58:29

点击 CTRL+RCMD+R(Mac)查看功能列表。这适用于 Sublime Text 1.3 或更高版本。

Hit CTRL+R, or CMD+R for Mac, for the function list. This works in Sublime Text 1.3 or above.

岁月无声 2024-08-24 15:58:29

包控制中有一个名为Outline的插件,试试吧!
https://packagecontrol.io/packages/Outline

注意:它不适用于多行/列模式。
对于多行/列工作,请使用此叉子:
https://github.com/vlad-wonderkidstudio/SublimeOutline

A plugin named Outline is available in package control, try it!
https://packagecontrol.io/packages/Outline

Note: it does not work in multi rows/columns mode.
For multiple rows/columns work use this fork:
https://github.com/vlad-wonderkidstudio/SublimeOutline

不寐倦长更 2024-08-24 15:58:29

我使用全部折叠动作。它将最小化声明中的所有内容,我可以看到所有方法/函数,然后展开我感兴趣的方法/函数。

I use the fold all action. It will minimize everything to the declaration, I can see all the methods/functions, and then expand the one I'm interested in.

柒七 2024-08-24 15:58:29

我简要介绍一下 SublimeText 3 apiview.find_by_selector(selector) 似乎能够返回区域列表。

所以我想有一个插件可以显示文件的轮廓/结构。

一个会显示如下内容的插件:

code Outline

注意:函数名称显示插件可以作为灵感提取类/方法名称或 ClassHierarchy 提取大纲结构

I briefly look at SublimeText 3 api and view.find_by_selector(selector) seems to be able to return a list of regions.

So I guess that a plugin that would display the outline/structure of your file is possible.

A plugin that would display something like this:

code outline

Note: the function name display plugin could be used as an inspiration to extract the class/methods names or ClassHierarchy to extract the outline structure

攀登最高峰 2024-08-24 15:58:29

如果您希望能够打印输出或保存轮廓,则 ctr / command + r 不是很有用。
可以对以下 grep 进行简单的查找全部 ^[^\n]*function[^{]+{ 或它的一些变体,以适应您正在使用的语言和情况。

完成查找后,您可以将结果复制并粘贴到新文档中,并且根据功能的数量,整理起来应该不会花费很长时间。

答案远非完美,特别是当评论中包含“功能”一词(或等效词)时,但我确实认为这是一个有用的答案。

经过非常快速的编辑,这就是我现在正在做的事情的结果。

    PathMaker.prototype.start = PathMaker.prototype.initiate = function(point){};
    PathMaker.prototype.path = function(thePath){};
    PathMaker.prototype.add = function(point){};
    PathMaker.prototype.addPath = function(path){};
    PathMaker.prototype.go = function(distance, angle){};
    PathMaker.prototype.goE = function(distance, angle){};
    PathMaker.prototype.turn = function(angle, distance){};
    PathMaker.prototype.continue = function(distance, a){};
    PathMaker.prototype.curve = function(angle, radiusX, radiusY){};
    PathMaker.prototype.up = PathMaker.prototype.north = function(distance){};
    PathMaker.prototype.down = PathMaker.prototype.south = function(distance){};
    PathMaker.prototype.east = function(distance){};
    PathMaker.prototype.west = function(distance){};
    PathMaker.prototype.getAngle = function(point){};
    PathMaker.prototype.toBezierPoints = function(PathMakerPoints, toSource){};
    PathMaker.prototype.extremities = function(points){};
    PathMaker.prototype.bounds = function(path){};
    PathMaker.prototype.tangent = function(t, points){};
    PathMaker.prototype.roundErrors = function(n, acurracy){};
    PathMaker.prototype.bezierTangent = function(path, t){};
    PathMaker.prototype.splitBezier = function(points, t){};
    PathMaker.prototype.arc = function(start, end){};
    PathMaker.prototype.getKappa = function(angle, start){};
    PathMaker.prototype.circle = function(radius, start, end, x, y, reverse){};
    PathMaker.prototype.ellipse = function(radiusX, radiusY, start, end, x, y , reverse/*, anchorPoint, reverse*/ ){};
    PathMaker.prototype.rotateArc = function(path /*array*/ , angle){};
    PathMaker.prototype.rotatePoint = function(point, origin, r){};
    PathMaker.prototype.roundErrors = function(n, acurracy){};
    PathMaker.prototype.rotate = function(path /*object or array*/ , R){};
    PathMaker.prototype.moveTo = function(path /*object or array*/ , x, y){};
    PathMaker.prototype.scale = function(path, x, y /* number X scale i.e. 1.2 for 120% */ ){};
    PathMaker.prototype.reverse = function(path){};
    PathMaker.prototype.pathItemPath = function(pathItem, toSource){};
    PathMaker.prototype.merge = function(path){};
    PathMaker.prototype.draw = function(item, properties){};

If you want to be able to printout or save the outline the ctr / command + r is not very useful.
One can do a simple find all on the following grep ^[^\n]*function[^{]+{ or some variant of it to suit the language and situation you are working in.

Once you do the find all you can copy and paste the result to a new document and depending on the number of functions should not take long to tidy up.

The answer is far from perfect, particularly for cases when the comments have the word function (or it's equivalent) in them, but I do think it's a helpful answer.

With a very quick edit this is the result I got on what I'm working on now.

    PathMaker.prototype.start = PathMaker.prototype.initiate = function(point){};
    PathMaker.prototype.path = function(thePath){};
    PathMaker.prototype.add = function(point){};
    PathMaker.prototype.addPath = function(path){};
    PathMaker.prototype.go = function(distance, angle){};
    PathMaker.prototype.goE = function(distance, angle){};
    PathMaker.prototype.turn = function(angle, distance){};
    PathMaker.prototype.continue = function(distance, a){};
    PathMaker.prototype.curve = function(angle, radiusX, radiusY){};
    PathMaker.prototype.up = PathMaker.prototype.north = function(distance){};
    PathMaker.prototype.down = PathMaker.prototype.south = function(distance){};
    PathMaker.prototype.east = function(distance){};
    PathMaker.prototype.west = function(distance){};
    PathMaker.prototype.getAngle = function(point){};
    PathMaker.prototype.toBezierPoints = function(PathMakerPoints, toSource){};
    PathMaker.prototype.extremities = function(points){};
    PathMaker.prototype.bounds = function(path){};
    PathMaker.prototype.tangent = function(t, points){};
    PathMaker.prototype.roundErrors = function(n, acurracy){};
    PathMaker.prototype.bezierTangent = function(path, t){};
    PathMaker.prototype.splitBezier = function(points, t){};
    PathMaker.prototype.arc = function(start, end){};
    PathMaker.prototype.getKappa = function(angle, start){};
    PathMaker.prototype.circle = function(radius, start, end, x, y, reverse){};
    PathMaker.prototype.ellipse = function(radiusX, radiusY, start, end, x, y , reverse/*, anchorPoint, reverse*/ ){};
    PathMaker.prototype.rotateArc = function(path /*array*/ , angle){};
    PathMaker.prototype.rotatePoint = function(point, origin, r){};
    PathMaker.prototype.roundErrors = function(n, acurracy){};
    PathMaker.prototype.rotate = function(path /*object or array*/ , R){};
    PathMaker.prototype.moveTo = function(path /*object or array*/ , x, y){};
    PathMaker.prototype.scale = function(path, x, y /* number X scale i.e. 1.2 for 120% */ ){};
    PathMaker.prototype.reverse = function(path){};
    PathMaker.prototype.pathItemPath = function(pathItem, toSource){};
    PathMaker.prototype.merge = function(path){};
    PathMaker.prototype.draw = function(item, properties){};
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文