On May 20, 2005, at 8:17 AM, Brad Miller wrote:
Haris,
I find that I rarely make it through a multi-part snippet without doing something that breaks me out of snippet-tab-mode. Then I fill in the rest of the snippet template by navigating to the pieces in the usual way. Maybe I just have an unusually short attention span, or I am an exceptionally erratic typist, not sure.
I also cannot work with a snippet that has more than two tabs, and that's already too much :-)
Anyway, usually by the end of the first template variable I've managed to get it so that tabs are just tabs.
I think that in a \begin \end environment like the one in your example, the $0 between the begin/end is the way to go. Usually people are going to do a fair amount of typing in between.
I think its important to remember that Snippets help two completely different classes of user.
- Novices -- advanced beginners: Snippets help them create basic
language constructs that they otherwise don't know how to do without spending time in the manual. How do I make a table? How do I insert a figure? etc. These users are most likely going to select snippets from the menu.
To this end, I'd like to see Allan add the ability to create categories and subcategories of snippets that result in menus/submenus if snippets. IMHO the snippets menu is useless for languages like Actionscript and OCaml because there are too many entries (screens of them)
I think this is a great idea. The way things are, I'm afraid to add too many snippets so as not to overload the menu. Btw, how much of a concern is the size of the bundle? Does adding a lot of snippets affect performance? If not, then I could try to add as many LaTeX commands as snippets as possible, or at least commands I think are likely to be often used.
- language power users : These users already know the syntax for
creating a table, the snippet is just helping this class of users go faster. These users are going to use tab completion. These users are going to be most annoyed when things don't behave logically. (at least as far as they understand the workings of things)
Here's the one that annoys me the most: (and I've just now figured out how to fix it since I've been writing this email :-) )
[snip]
Now, I've modified my copy of itemize to be: \begin{itemize} \item ${0:premier item} \end{itemize}
Now things behave like I would like them to. I think I'll commit this new itemize, and fix up the other list making environments as well.
This sounds more appropriate to me too. I can't remember if I edited it, or if someone else did, but I would guess whoever did it might have had the html lists in mind, where a simple return would not cut it. But I guess Command-return takes care of that now and is pretty intuitive. (btw, command-return is bound to <br /> in html. Do we really want that?)
As to your other question about theorems and definitions, I say add them so that they are there to help people get better with Latex.
Great, I'll edit them a bit and add them to the bundle, and people can adjust them as they see fit. On this respect, it might make sense to create a template for amsart, with these definitions included. Maybe a project for me for the weekend...
Brad
Haris