Sublime Forum

Something like a tree or list of functions/blocks?

#1

Hi! I’ve just discovered and I’m still treating to get used to the idea of how beautiful this text/code editor is :open_mouth:

Besides that… I’ve a little doubt, do you think there could be a way to have all the functions or “blocks” on the file listed as a sidebar tree or something so, in order to can navigate quickly through looong files? I come from Geany (which I choose precisely for such feature, BTW) and I make use of it all the time. OTOH, I think the Minimap is a very cool feature, but there is not too much use I can make of it as far as I can’t extract (practically) any info from it; I mean, if I only could see the function headers a little bigger or something…

Well, I only wanted to be sure. Of course if nothing like that be actually possible, just take all this as a convenient “feature request” :mrgreen:

Thanks,
Ramon0.

1 Like

#2

Try “command/control + R”

0 Likes

#3

Personally, I prefer something like Vim’s taglist[1] plugin.
For a C/C++ programmer, “Ctrl-R” is a little weak. Because it can only show function (and macro) names, and even does not display them separately.
Does ST2 support API to create a new sidebar, or add new information to current sidebar?

[1] vim.org/scripts/script.php?script_id=273

0 Likes

#4

Oh, thank you! Yeah I think this can “alleviate” the lack of a sidebar in someway… Anyway, existing still a sidebar like the “OPEN FILES” one, I can’t see the reason why we couldn’t have this functions listed on it (in a different tab or something), where no scrolling or typing will be needed in the majority of the cases because practically all the functions would be at a simple click, exposed all the time.

Well, only an opinion! Of course I’m still impressed with all the beauty and well functioning of this “little” piece of software :smile: and it well could worth the try to be used to it.

Regards,
Ramon0

0 Likes

#5

The API supports creating “scratch views,” which might be able to mimic this behavior when paired with a sublime mousemap, but I haven’t really seen a reason to recreate the behavior of command+r (then again, I don’t use C/C++ :smile: ).

I thought this sounded funny since programmers usually find it should be the other way around. I.E. replacing functions that require clicking with just typing. Most programmers are adverse to being “forced” to use a mouse and prefer not having to remove their hands from their keyboard.

If you both feel so strongly about the need for a tree of functions, consider posting a ticket at sublimetext.userecho.com
I’m pretty sure this has already been suggested, in that case, just vote for it.

0 Likes

#6

[quote=“C0D312”]

I thought this sounded funny since programmers usually find it should be the other way around. I.E. replacing functions that require clicking with just typing.[/quote]

Well, the curious thing is I like both ways and I think I see the advantage of both methods; so, OTOH, I don’t see why couldn’t they coexist, and more having a sidebar which usefulness well could be extended with this functionality getting double advantage in the same space. Anyway what I’d like more is, as I said, can see the functions name directly in Minimap in someway; that way, it’s usability will be 200% increased (actually it’s more like a simple (cool) giant scrollbar) and I think both words would be happy without too much app addons, philosophy changes or regressions.

Yeah, at this point the “feature requesting” is always the best way to deal with this issues, so thanks for the info/advice :smile:

0 Likes

#7

You could probably expand ctrl+R (I think it’s written in Python somewhere in the default packages), or make a new command palette similar to it, which lists the functions’ return types and parameters too.

Check out SublimeClang plugin for C/C++ if you want to be able to get methods and variables from other files. Then you could throw those into the ctrl+R too.

0 Likes

#8

Have you seen github.com/robcowie/SublimeTODO ? It uses regular expressions to build a new document that lists todos. In your Sublime user preferences, you can replace the default expressions to have it match and list whatever you want. Check the example from the package website https://gist.github.com/2049887 . If you want a tree like view, you can go into the todo.py file and change the output format or replace content.

For example, I have made regular expressions to capture my asciidoc headers. Then, some quick changes to the python file and I replace things like == or === with bullets and spaces, and end up with a nice tree list of sections across all documents in a folder. Note: the linking works on OS X, I am not sure if it works on other platforms (this is where you can click on the entry to be taken to the file and location of the header).

0 Likes

Navigation pane-like feature
#9

7 years have gone, and this is still a wanted request.

something like Notepads++ “SourceCookifier”
SourceCookifier

0 Likes

#10

https://packagecontrol.io/packages/Outline

1 Like

#11

Just if someone still needs it, I made a fork of the Outline package, which supports multiple rows/collumns

0 Likes

#12

Just adding to the list of people that would like to see this feature.

Coming in from from using netbeans, visual studio and matlab, I’m pretty used to the sidebar providing folder navigation in one pane and intra-file browsing below it, I’m kinda surprised it doesn’t already exist. (or maybe it does now but I don’t know how to turn it on.)

0 Likes