[TxMt] GUI, Bundles & Snippets Structure Revisited [LONG-ish]

Mats Persson mats at imediatec.co.uk
Fri Nov 19 15:17:59 UTC 2004

OK, I know this has been brought up before and that Allan is working on 
new implementations for sometime in the future, but I just want to make 
sure the following is considered as well.  Trying hard to be as 
succinct, logical and realistic as possible here, so apologies if I'm 


1a) Snippet Editor Window

Looking at the Snippet, Command & Macros Editor windows, there is 
essentially three different design concepts implemented there. Of the 
three I think the Command Editor is the better functioning concept, 
albeit not perfect. By making the 'entry NSBox view' fixed in size it 
enables the user to resize the window and thereby automatically resize 
the table view (NSScrollView) making it easier to read the full Command 
names and their triggers.

The main problem with the Snippet Editor window is that the table view 
(NSScrollView) is not resizable. However, this could be improved 
relatively quickly by:
--  implementing a NSSplitView functionality (split view resizing of 
window parts)
--  or making the NSBox view (the gray background box) fixed size as it 
is in Command Editor window. (Probably faster to implement)

This 'simple' change would make using the Snippet Editor much better.  
For further improvement ideas in the Snippet Editor window, see point 3 
below, as they are more context dependent.

1b) Project Drawer & Image files

Working mainly with web development and graphics/images, I think it 
would be great if you could see the image displayed in the main editor 
window, or alternatively opened by Preview rather than any other app 
regardless of the Creator Code of the image file when you double-click 
the filename. This should ideally be a preference option, where you can 
turn it on or off.
The file formats in question are: .jpg, .png. .gif. .pdf


2a) Too many syntax files available in the "Syntax Highlight as" menu

Being a bit of a 'boring' developer that only works with PHP, HMTL, CSS 
& JS I find that I essentially only need my own .tmbundle that contains 
all four of those languages.  I therefore want to be able to turn off 
the unused bundles, or alternatively keep the unused bundles further 
down in the "Syntax Hightlight as.." sub-menu. Sort of like this:

[ -> = sub-menu ]

Syntax Highlight as ->
	Syntax Status Editor   == (GUI see below)
	-- DIVIDER --
	-- DIVIDER --
	Disabled Syntax Files ->
		Unix Shell...

I know that this could be partly achieved by naming my commonly used 
bundles differently and renaming the others, but I shouldn't have to do 

2b) GUI Solution to Syntax Management:

A Snippet Editor type window where the available Syntax bundles are 
listed on the left, and in the right hand side view we could display a 
default bundle sample code template which is highlighted in the window, 
so that we can see if we like the syntax colouring.  Below it, we would 
have one button "Disable/Enable" with toggle status for 
enabling/disabling each bundle.

A quick & dirty mock-up can be found here: [ 
http://www.imediatec.co.uk/TM/Bundle-Manager-GUI.jpg ] It should give 
you a good enough idea about the whole concept.

Perhaps a .plist version could be implemented first ??


3a)	Snippets Numbering:
All snippets in /<something>.tmbundle/Snippets/  are numbered as 010, 
020, 030 and so on with 10 increments for each snippet.

Why increment by 10 each time ? Why not by 1 for each new snippet ?

Why use numbering at all, since the available snippet files can be 
displayed according to alphabetical order and then - see points below - 
could be reorganised according to the users own choice and the display 
order could be stored in a .plist file ?

Why oh WHY change the snippet numbers when I have numbered them as 010, 
011, 012 ?  Aarrrgh!! :(
(My idea behind numbering them that way was to create my own structured 
Snippets with sub-groups with space to add new snippets in between.)

3b)	Snippets Organisation:

As I have suggested on the wiki "Feature Requests" page, the snippets 
would be better if they were structured in categories, where each 
category is a sub-menu item.

When I create new snippets now, I give them a pseudo category 
identifier such as "PHP " or "XHTML " and then the snippet type id. 
This helps me keep my snippets fairly organised, but they still stay 
out of alphabetical order, mainly due to the Custom.tmbundle issue 
addressed above.

However, the biggest problem with my Snippets Menu is that it is too 
long for my screen (1600x1200) so I have to scroll the menu in order to 
get the bottom values. Moving to sub-menu categories would improve this 

Making the table view in the Snippet Editor GUI into an NSOutlineView 
(as partly implemented in the Project Drawer) where we could have these 
sub-groups, toggle the view of their content and so on.

3c)	New Snippets Save location:

When you create a new snippet it is stored into 
/App..Support/TM/Bundles/Custom.tmbundle/Snippets/ which are 
prioritised over the active bundle's snippets. My issues with this 
structure are:

-- I want to choose where I want my new snippet to be stored, as it 
most likely will be in relation to the current .tmbundle that's being 
used, and I find it better - in my mind - to add language related 
snippets in the language bundle they belong to. 
  -- In the Snippets Menu, I would want my active .tmBundle Snippets to 
be top of the list, not the other way around.

The same would be applicable for Commands & Macros as well.  That way, 
by saving all commands, Macros & Snippets related to the specific 
language/bundle, they are not available when we disable the bundle  as 
suggested in point 2 above.

In the GUI, this would work by selecting the current snippet category, 
and then clicking "New Snippet" button. Sort of like this works in 
Project Drawer.

3d)	Snippet Re-Ordering in Snippet Editor window listing:

What would be ideal in the Snippet Editor GUI, is the ability to drag 
around snippets and re-order them that way. Newly created snippets are 
always added to the bottom of each snippet group they are created 
within, but can then be moved by the user to the position they would 
want. (Think iTunes playlist for a good example of this)

OK, that's it for now. Hope I haven't wasted my or your time.

Kind regards,


-- -- -- -- --
"For those who aren't familiar with OS X, it is a full implementation 
of BSD Unix with a Macintosh front end, which is to say world class 
inside and out. OS X is faster, smarter, prettier, and easier to use 
than any version of Windows."
by Robert X. Cringley, Feb, 2002 [ http://www.pbs.org/cringely/ ]

More information about the textmate mailing list