Home Download Buy Blog Forum Support

Something like a tree or list of functions/blocks?

Something like a tree or list of functions/blocks?

Postby Ramon0 on Fri Feb 03, 2012 11:16 pm

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

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.
Ramon0
 
Posts: 4
Joined: Fri Feb 03, 2012 9:50 pm

Re: Something like a tree or list of functions/blocks?

Postby C0D312 on Sat Feb 04, 2012 12:13 am

Try "command/control + R"
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Re: Something like a tree or list of functions/blocks?

Postby roychen on Sat Feb 04, 2012 7:05 am

C0D312 wrote:Try "command/control + R"


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] http://www.vim.org/scripts/script.php?script_id=273
roychen
 
Posts: 5
Joined: Thu Jan 12, 2012 2:07 pm

Re: Something like a tree or list of functions/blocks?

Postby Ramon0 on Sat Feb 04, 2012 12:33 pm

C0D312 wrote:Try "command/control + R"


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 :) and it well could worth the try to be used to it.

Regards,
Ramon0
Ramon0
 
Posts: 4
Joined: Fri Feb 03, 2012 9:50 pm

Re: Something like a tree or list of functions/blocks?

Postby C0D312 on Sat Feb 04, 2012 1:03 pm

Does ST2 support API to create a new sidebar, or add new information to current sidebar?

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++ :) ).

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.

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.
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Re: Something like a tree or list of functions/blocks?

Postby Ramon0 on Sat Feb 04, 2012 3:13 pm

C0D312 wrote:
Does ST2 support API to create a new sidebar, or add new information to current sidebar?

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.


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 :)
Ramon0
 
Posts: 4
Joined: Fri Feb 03, 2012 9:50 pm

Re: Something like a tree or list of functions/blocks?

Postby impeached on Sun Feb 05, 2012 7:36 pm

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.
impeached
 
Posts: 20
Joined: Mon Nov 14, 2011 11:18 pm

Re: Something like a tree or list of functions/blocks?

Postby terwilliker on Thu Mar 22, 2012 7:22 am

Have you seen https://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).
terwilliker
 
Posts: 2
Joined: Thu Mar 22, 2012 7:08 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 24 guests