如何获得崇高的texteditor大纲视图?

如何在Windows的崇高文本编辑器中获得大纲视图?

小地图是有帮助的,但我错过了一个传统的轮廓(我的代码中的所有function按照它们出现的顺序的快速导航和方向klickable列表)

也许有一个插件,插件或类似的? 如果你能够很快指出哪些步骤是必须的,那么也很好。

在崇高的文本论坛上有这个问题的重复 。

点击CTRL + R或Mac的CMD + R作为函数列表。 这适用于Sublime Text 1.3或更高版本。

我用折叠所有的动作。 它会尽量减less声明,我可以看到所有的方法/函数,然后扩展我感兴趣的。

我简单看一下SublimeText 3 api和view.find_by_selector(selector)似乎能够返回一个区域列表。

所以我想这个插件可以显示你的文件的大纲/结构。

一个可以显示如下所示的插件:

代码大纲

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

一个名为Outline的插件可以在包控件中使用,试试吧! https://packagecontrol.io/packages/Outline

如果你想打印输出或保存轮廓,ctr / command + r不是很有用。 我们可以简单地在grep ^[^\n]*function[^{]+{ 或者它的一些变体find所有符合您所使用的语言和情况的^[^\n]*function[^{]+{

一旦你find所有你可以复制和粘贴结果到一个新的文件,并根据function的数量不应该花很长时间来收拾。

答案远非完美,特别是对于评论中有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 ie 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){};