如何在Windows的sublime 文本编辑器中获得大纲视图?
小地图很有帮助,但我错过了一个传统的大纲(我的代码中所有函数的可点击列表,按它们出现的顺序排列,以便快速导航和定位)
也许有一个插件,插件或类似的?如果您能简短地指出哪些步骤是使其工作所必需的,那也很好。
在崇高的文本论坛上有这个问题的副本。
如何在Windows的sublime 文本编辑器中获得大纲视图?
小地图很有帮助,但我错过了一个传统的大纲(我的代码中所有函数的可点击列表,按它们出现的顺序排列,以便快速导航和定位)
也许有一个插件,插件或类似的?如果您能简短地指出哪些步骤是使其工作所必需的,那也很好。
在崇高的文本论坛上有这个问题的副本。
点击CTRL+R或Mac 的CMD+来查看函数列表。R这适用于 Sublime Text 1.3 或更高版本。
A plugin named Outline is available in package control, try it! https://packagecontrol.io/packages/Outline
注意:它不适用于多行/多列模式。对于多行/多列工作,请使用此 fork: https ://github.com/vlad-wonderkidstudio/SublimeOutline
我使用 fold all 动作。它将最小化声明中的所有内容,我可以看到所有方法/函数,然后扩展我感兴趣的那个。
我简要地看了一下SublimeText 3 api,view.find_by_selector(selector)
似乎能够返回一个区域列表。
所以我想一个可以显示文件大纲/结构的插件是可能的。
一个会显示如下内容的插件:
注意:函数名显示插件可以作为灵感提取类/方法名或ClassHierarchy提取大纲结构
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){};