120

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

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

也许有一个插件,插件或类似的?如果您能简短地指出哪些步骤是使其工作所必需的,那也很好。

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

4

5 回答 5

270

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

于 2010-02-06T00:15:45.877 回答
23

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

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

于 2017-11-02T14:09:17.703 回答
17

我使用 fold all 动作。它将最小化声明中的所有内容,我可以看到所有方法/函数,然后扩展我感兴趣的那个。

于 2013-05-08T14:18:06.437 回答
8

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

所以我想一个可以显示文件大纲/结构的插件是可能的。

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

代码大纲

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

于 2015-03-09T20:09:11.993 回答
0

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){};
于 2016-08-28T17:06:16.693 回答