Following positive to enthusiastic reviews, I downloaded TextMate last week for evaluation. While it is based on powerful concepts and there are some impressive features in there, I am overall rather disappointed by its practical usability - many details just don't work as they should. However, I may be overlooking something, so I'd appreciate corrections by more experienced users.
My two main file types are Python and LaTeX source code. LaTeX support is rather nice, once it is properly configured. But I had expected a more reasonable folding: what I want to fold is sections, subsections, etc. not begin-end blocks.
Python support is really disappointing. Folding is completely useless (blocks end at the first blank line), tabs are not handled in a reasonable way (using hard tabs with an indentation other than 8 is an invitation for disaster in Python code), leading to indentation errors, and the error output in PyMate is insufficient (I want the full traceback).
I looked a bit at the language definitions, and I have the impression that reasonable folding for LaTeX and Python cannot be implemented in TextMate, as the beginning and end of a block must be defined by a regular expression matching a single line. Or did I overlook something?
Konrad.
On 29 Jan 2008, at 14:04, Konrad Hinsen wrote:
Python support is really disappointing. Folding is completely useless (blocks end at the first blank line), tabs are not handled in a reasonable way (using hard tabs with an indentation other than 8 is an invitation for disaster in Python code), leading to indentation errors, and the error output in PyMate is insufficient (I want the full traceback).
TextMate has pretty bad tab support I'd say. The inability to separate indent size from tab size and the fact that tab sized chunks of whitespace are treated like physical tabs make it unusable for some file types / indentation schemes. These days I use vim if I need to care about tabs. Which is pretty tragic.
I looked a bit at the language definitions, and I have the impression that reasonable folding for LaTeX and Python cannot be implemented in TextMate, as the beginning and end of a block must be defined by a regular expression matching a single line. Or did I overlook something?
I don't think you missed anything. If you did, I missed the same thing. It makes it impossible to fold pod (Perl embedded documentation) too.
Konrad Hinsen wrote:
Python support is really disappointing. Folding is completely useless (blocks end at the first blank line), tabs are not handled in a reasonable way (using hard tabs with an indentation other than 8 is an invitation for disaster in Python code), leading to indentation errors, and the error output in PyMate is insufficient (I want the full traceback).
You only have to set the tab handling once (it's in the middle at the bottom statusbar of the window), and from then on the tab setting is maintained for that language.
I looked a bit at the language definitions, and I have the impression that reasonable folding for LaTeX and Python cannot be implemented in TextMate, as the beginning and end of a block must be defined by a regular expression matching a single line. Or did I overlook something?
For the current version, that is true. TextMate 2.0 will probably have something better for it. If you want to have folds, then you'll have to manually insert foldingmarkers. Although, at least for LaTeX, this has been made very easy with the bundled snippets.
Jeroen.
On Jan 29, 2008, at 15:43, Jeroen van der Ham wrote:
You only have to set the tab handling once (it's in the middle at the bottom statusbar of the window), and from then on the tab setting is maintained for that language.
Good to know, thanks!
For the current version, that is true. TextMate 2.0 will probably have something better for it. If you want to have folds, then you'll have to manually insert foldingmarkers. Although, at least for LaTeX, this has been made very easy with the bundled snippets.
See below ...
On Jan 29, 2008, at 16:25, Mark Eli Kalderon wrote:
Tab triggers are snippets of text that are inserted by typing some predetermined text and hitting tab. If you insert the sections (and subsections etc) using the tab triggers in the LaTeX bundle, i.e., typing “sec” and hitting tab, you get the following:
section{section name}label{sec:section_name} % (fold)
% section section_name (end)
I noticed this, and it works fine, but it won't help with my existing files, nor with files that I collaborate on with people using other editors.
Thanks for the feedback, Konrad.
On Jan 29 2008, at 16:06, Konrad Hinsen wrote:
On Jan 29, 2008, at 16:25, Mark Eli Kalderon wrote:
Tab triggers are snippets of text that are inserted by typing some predetermined text and hitting tab. If you insert the sections (and subsections etc) using the tab triggers in the LaTeX bundle, i.e., typing “sec” and hitting tab, you get the following:
section{section name}label{sec:section_name} % (fold)
% section section_name (end)
I noticed this, and it works fine, but it won't help with my existing files, nor with files that I collaborate on with people using other editors.
There is a manual work around: You can also control click a selection and choose fold...
On 1/29/2008, "Konrad Hinsen" konrad.hinsen@laposte.net wrote:
My two main file types are Python and LaTeX source code. LaTeX support is rather nice, once it is properly configured. But I had expected a more reasonable folding: what I want to fold is sections, subsections, etc. not begin-end blocks.
Tab triggers are snippets of text that are inserted by typing some predetermined text and hitting tab. If you insert the sections (and subsections etc) using the tab triggers in the LaTeX bundle, i.e., typing sec and hitting tab, you get the following:
section{section name}label{sec:section_name} % (fold)
% section section_name (end)
The comments (% (fold), % section section_name (end)) function as fold markers thus allowing code folding of sections. This is a standard part of the LaTeX bundle. Just be sure to insert your sections with the provided snippets. (It is quicker anyway.)
Best, Mark
On Jan 29, 2008, at 10:25 AM, Mark Eli Kalderon wrote:
Tab triggers are snippets of text that are inserted by typing some predetermined text and hitting tab. If you insert the sections (and subsections etc) using the tab triggers in the LaTeX bundle, i.e., typing “sec” and hitting tab, you get the following:
section{section name}label{sec:section_name} % (fold)
% section section_name (end)
The comments (”% (fold)”, “% section section_name (end)”) function as fold markers thus allowing code folding of sections. This is a standard part of the LaTeX bundle. Just be sure to insert your sections with the provided snippets. (It is quicker anyway.)
It's quicker only if you have the underscores package loaded. Otherwise, '_' isn't a valid character in a label, and you have to change all those underscores to something else. <g> I modified the snippets to use '.' instead of '_'.
-- Pete
Roundhouse Consulting, Ltd.
On Jan 29, 2008, at 11:00 AM, Pete Becker wrote:
On Jan 29, 2008, at 10:25 AM, Mark Eli Kalderon wrote:
The comments (”% (fold)”, “% section section_name (end)”) function as fold markers thus allowing code folding of sections. This is a standard part of the LaTeX bundle. Just be sure to insert your sections with the provided snippets. (It is quicker anyway.)
It's quicker only if you have the underscores package loaded. Otherwise, '_' isn't a valid character in a label, and you have to change all those underscores to something else. <g> I modified the snippets to use '.' instead of '_'.
I've been working for probably close to a decade with LaTeX, using labels with underscores in them all the time, and had not even heard of this package before! I never had any problem. Is it perhaps automatically loaded with some commonly used package?
To Konrad, if your main complaint from the LaTeX bundle is the folding, then I would take that to mean we've done an excellent job with it ;) Seriously, it would indeed be nice to be able to fold at sections, subsections etc. One could theoretically write a script that scans a tex file and adds the necessary folding markers, as if you had indeed used the snippets. It should not be too hard to implement I don't think.
Actually what would be even nicer, for me, would be to be able to get an outline of your whole project, essentially listing the table of contents, regardless of how many files the project is split into, and then to be able to simply drag and drop sections around to rearrange things. But I am probably just daydreaming.
Personally, I almost never fold, I haven't found it particularly useful. What do you guys use folding for? If I want to see an outline of the section structure and/or move around, I would use the symbol list. But I am probably missing some other extremely important use of folding.
For me the most useful commands are the wrapping and inserting commands. I couldn't live in a world where those aren't available.
-- Pete
Roundhouse Consulting, Ltd.
Haris Skiadas Department of Mathematics and Computer Science Hanover College
On 30.01.2008, at 02:36, Charilaos Skiadas wrote:
To Konrad, if your main complaint from the LaTeX bundle is the folding, then I would take that to mean we've done an excellent job with it ;)
I agree, LaTeX integration is one of the best I have seen in any editor. What I am disappointed about is not the LaTeX bundle, but the fact that it demonstrates how limited TextMates folding approach is.
Seriously, it would indeed be nice to be able to fold at sections, subsections etc. One could theoretically write a script that scans a tex file and adds the necessary folding markers, as if you had indeed used the snippets. It should not be too hard to implement I don't think.
That is not a satisfying solution in my opinion. My Mercurial repository would soon be littered with commits saying "added folding markers for TextMate".
Personally, I almost never fold, I haven't found it particularly useful. What do you guys use folding for? If I want to see an outline of the section structure and/or move around, I would use the symbol list. But I am probably missing some other extremely important use of folding.
A recent example of mine: I worked on a document consisting of a tutorial chapter followed by a list of exercises. With folding, I can see the exercise I work on on the same screen as the paragraph in the tutorial chapter that deals with the same subject. Of course there are other ways to do that (in Emacs I'd use a split window), but I didn't find any in TextMate yet.
For me the most useful commands are the wrapping and inserting commands. I couldn't live in a world where those aren't available.
Those are really nice, and clearly the most attractive feature in TextMate for me.
Anyway, it seems I won't be able to get a TextMate licence any time soon (my employer won't be able to handle credit card payments before the end of the year), so I'll just drop TextMate for now and have another look in a few months...
Konrad.
On Jan 30, 2008, at 2:39 AM, Konrad Hinsen wrote:
Personally, I almost never fold, I haven't found it particularly useful. What do you guys use folding for? If I want to see an outline of the section structure and/or move around, I would use the symbol list. But I am probably missing some other extremely important use of folding.
A recent example of mine: I worked on a document consisting of a tutorial chapter followed by a list of exercises. With folding, I can see the exercise I work on on the same screen as the paragraph in the tutorial chapter that deals with the same subject. Of course there are other ways to do that (in Emacs I'd use a split window), but I didn't find any in TextMate yet.
Ok in that case what you are really missing is a split window view, which was for a while and perhaps still is the number one request.
A slight workaround is to open the file as part of a project, then right click on the file in the drawer and select "Open in New Window". Not quite a split view, but would help a fair bit I think.
Haris Skiadas Department of Mathematics and Computer Science Hanover College
Charilaos Skiadas wrote:
Actually what would be even nicer, for me, would be to be able to get an outline of your whole project, essentially listing the table of contents, regardless of how many files the project is split into, and then to be able to simply drag and drop sections around to rearrange things. But I am probably just daydreaming.
Yeah. Jenny (and perhaps others) were talking about this a year ago, but it somehow still hasn't happened. If someone builds such a thing, I'll gladly buy them a beer. :)
-Jacob
Yeh, I am still here. What a dream come true this would be! I don't see how split windows would give a work around for dragging and dropping sections.
-Jenny
On 1/30/08, at 2:58 , Jacob Rus wrote:
Charilaos Skiadas wrote:
Actually what would be even nicer, for me, would be to be able to get an outline of your whole project, essentially listing the table of contents, regardless of how many files the project is split into, and then to be able to simply drag and drop sections around to rearrange things. But I am probably just daydreaming.
Yeah. Jenny (and perhaps others) were talking about this a year ago, but it somehow still hasn't happened. If someone builds such a thing, I'll gladly buy them a beer. :)
-Jacob
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On Jan 30, 2008, at 6:18 AM, Jenny Harrison wrote:
Yeh, I am still here. What a dream come true this would be! I don't see how split windows would give a work around for dragging and dropping sections.
-Jenny
On 1/30/08, at 2:58 , Jacob Rus wrote:
Charilaos Skiadas wrote:
Actually what would be even nicer, for me, would be to be able to get an outline of your whole project, essentially listing the table of contents, regardless of how many files the project is split into, and then to be able to simply drag and drop sections around to rearrange things. But I am probably just daydreaming.
Yeah. Jenny (and perhaps others) were talking about this a year ago, but it somehow still hasn't happened. If someone builds such a thing, I'll gladly buy them a beer. :)
Part of the reason it still hasn't happened, apart from my almost zero free time to invest in TextMate programming for at least the last 6 months or so, is what seems to me to be the destructiveness of the whole thing. We are moving vast amounts of text around, possibly across multiple files, and it seems to me it would be hard to test whether the right thing happened. This is why I have been hesitant to do something like that (apart from the other reasons preventing me from doing it).
If everyone was using a version control system on all their tex files/ projects, I might be less worried about it. I envisioned this as an HTML tree of the document, with those little triangles used for expanding or hiding the subtrees like in the bundle editor, and then drag and dropping sections around and tracking the thing via javascript. Should not be too hard once we have a reliable way to read the whole project in and get the overall structure figured out correctly and reliably.
-Jacob
Haris Skiadas Department of Mathematics and Computer Science Hanover College
Certainly this would be risky when writing something like a math paper, but outliners all have this feature and are well used and appreciated. As far as testing goes, it should not be hard to devise a "logic tester" to flag each time a \ref for a Lemma, Proposition, Theorem, etc., occurred before the statement. That would handle most serious rearrangement errors, the kind of tragic mistake that can occur at 3 am when very sleepy! Time Machine gives us all decent version control.
On 1/30/08, at 3:29 , Charilaos Skiadas wrote:
On Jan 30, 2008, at 6:18 AM, Jenny Harrison wrote:
Yeh, I am still here. What a dream come true this would be! I don't see how split windows would give a work around for dragging and dropping sections.
-Jenny
On 1/30/08, at 2:58 , Jacob Rus wrote:
Charilaos Skiadas wrote:
Actually what would be even nicer, for me, would be to be able to get an outline of your whole project, essentially listing the table of contents, regardless of how many files the project is split into, and then to be able to simply drag and drop sections around to rearrange things. But I am probably just daydreaming.
Yeah. Jenny (and perhaps others) were talking about this a year ago, but it somehow still hasn't happened. If someone builds such a thing, I'll gladly buy them a beer. :)
Part of the reason it still hasn't happened, apart from my almost zero free time to invest in TextMate programming for at least the last 6 months or so, is what seems to me to be the destructiveness of the whole thing. We are moving vast amounts of text around, possibly across multiple files, and it seems to me it would be hard to test whether the right thing happened. This is why I have been hesitant to do something like that (apart from the other reasons preventing me from doing it).
If everyone was using a version control system on all their tex files/projects, I might be less worried about it. I envisioned this as an HTML tree of the document, with those little triangles used for expanding or hiding the subtrees like in the bundle editor, and then drag and dropping sections around and tracking the thing via javascript. Should not be too hard once we have a reliable way to read the whole project in and get the overall structure figured out correctly and reliably.
When I meant of logic testing, I did not have exactly that in mind. One issue comes up when changing levels to something, which would require changing a sub to a sec, changing all labels and refs for it etc, doable but just adds to the complication. By logic I meant the logic of the program. For instance, where should a "\paragraph" end? Imagine this:
\section{my section}
Some text here \paragraph{a paragraph} Here is the paragraph. But where does it end?
Is this part of the paragraph? Or only the section? What if I have some equation:
[ \sin(x) ]
Is this now still the same paragraph? \section{the next section}
This is one problem. But my biggest problem is anticipating all the intricacies of everyone's LaTeX documents. Case in point: You assume everyone can use Time Machine, which for instance for me and other 10.4 people is not the case. In working on the LaTeX bundle, especially the bib parser, I encountered dozens of problems with custom bib files that I had not anticipated because my bib files don't behave like that, hence I was making assumptions about how all bib files look like based on how my bib files look like. Similar caution would be needed here. A mistake in this case could cause problems that might not become apparent until much-much later. It's not like some text will be colored with the wrong color. If that mistake causes a whole chunk of text in a 400 page document to vanish out of sight, or move to a different location, this might not be discovered for months. I really wouldn't want to be responsible for that. So any such feature, even if it does appear, will come with about a dozen warnings.
I do appreciate how useful this would be, and I do miss it quite a bit, but it is darned hard to get right for the totality of LaTeX documents, which is what I am trying to think of when working on the bundle.
Haris Skiadas Department of Mathematics and Computer Science Hanover College
On Jan 30, 2008, at 6:55 AM, Jenny Harrison wrote:
Certainly this would be risky when writing something like a math paper, but outliners all have this feature and are well used and appreciated. As far as testing goes, it should not be hard to devise a "logic tester" to flag each time a \ref for a Lemma, Proposition, Theorem, etc., occurred before the statement. That would handle most serious rearrangement errors, the kind of tragic mistake that can occur at 3 am when very sleepy! Time Machine gives us all decent version control.
On 1/30/08, at 3:29 , Charilaos Skiadas wrote:
On Jan 30, 2008, at 6:18 AM, Jenny Harrison wrote:
Yeh, I am still here. What a dream come true this would be! I don't see how split windows would give a work around for dragging and dropping sections.
-Jenny
On 1/30/08, at 2:58 , Jacob Rus wrote:
Charilaos Skiadas wrote:
Actually what would be even nicer, for me, would be to be able to get an outline of your whole project, essentially listing the table of contents, regardless of how many files the project is split into, and then to be able to simply drag and drop sections around to rearrange things. But I am probably just daydreaming.
Yeah. Jenny (and perhaps others) were talking about this a year ago, but it somehow still hasn't happened. If someone builds such a thing, I'll gladly buy them a beer. :)
Part of the reason it still hasn't happened, apart from my almost zero free time to invest in TextMate programming for at least the last 6 months or so, is what seems to me to be the destructiveness of the whole thing. We are moving vast amounts of text around, possibly across multiple files, and it seems to me it would be hard to test whether the right thing happened. This is why I have been hesitant to do something like that (apart from the other reasons preventing me from doing it).
If everyone was using a version control system on all their tex files/projects, I might be less worried about it. I envisioned this as an HTML tree of the document, with those little triangles used for expanding or hiding the subtrees like in the bundle editor, and then drag and dropping sections around and tracking the thing via javascript. Should not be too hard once we have a reliable way to read the whole project in and get the overall structure figured out correctly and reliably.
On 1/30/08, at 4:54 , Charilaos Skiadas wrote:
For instance, where should a "\paragraph" end? Imagine this:
\section{my section}
Some text here \paragraph{a paragraph} Here is the paragraph. But where does it end?
Is this part of the paragraph? Or only the section? What if I have some equation:
[ \sin(x) ]
Is this now still the same paragraph? \section{the next section}
The idea is not drag and drop directly in the document which could have problems you envision. (We can already do this via foldings, but it is unstable.) Instead, if we could drag and drop in the sidebar "Go to Symbol" we would have no option but to move whole paragraphs, subsections, or sections, much like OmniOutliner. This was a feature I could not live without in the old More II, but had to adjust when the program vanished. It should be part of the greater GTD philosophy, much like keeping fingers on the keyboard. When it came to a choice between OmniOutliner and Textmate, I chose the latter because of its numerous amazing features, but giving up clean folding and dragging and dropping sections was nontrivial.
Jenny
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On Jan 29, 2008, at 8:36 PM, Charilaos Skiadas wrote:
On Jan 29, 2008, at 11:00 AM, Pete Becker wrote:
On Jan 29, 2008, at 10:25 AM, Mark Eli Kalderon wrote:
The comments (”% (fold)”, “% section section_name (end)”) function as fold markers thus allowing code folding of sections. This is a standard part of the LaTeX bundle. Just be sure to insert your sections with the provided snippets. (It is quicker anyway.)
It's quicker only if you have the underscores package loaded. Otherwise, '_' isn't a valid character in a label, and you have to change all those underscores to something else. <g> I modified the snippets to use '.' instead of '_'.
I've been working for probably close to a decade with LaTeX, using labels with underscores in them all the time, and had not even heard of this package before! I never had any problem. Is it perhaps automatically loaded with some commonly used package?
Maybe. The problem, of course, is that '_' means subscript, and it's not valid outside math mode (obviously an unnecessary restriction). The correct package name is "underscore", not "underscores. <g>
-- Pete
Roundhouse Consulting, Ltd.
Konrad Hinsen wrote:
Python support is really disappointing. Folding is completely useless (blocks end at the first blank line),
This is an unfortunate side-effect of TextMate's current folding system which only allows foldings at matching indentation levels. It will certainly change sometime in the hazy indefinite future of later TM versions. In the mean time, as a workaround, if you get the whitespace just right, foldings work great (there's a Cleanup Whitespace command in the Python bundle which does this). It's far from ideal, but it works for me.
tabs are not handled in a reasonable way (using hard tabs with an indentation other than 8 is an invitation for disaster in Python code), leading to indentation errors,
I've never seen python code which uses a mix of hard tabs and spaces; such is explicitly discouraged by every Python style guideline I've ever seen. Pick either tabs or spaces and stick to it (you can set them with the little dropdown at the bottom of every window). I personally prefer 4-space tabs (never using hard tab characters in my Python code), but code using only hard tabs should also work fine, as should 2-space tabs (e.g. Google's internal code, according to Guido), etc.
and the error output in PyMate is insufficient (I want the full traceback).
The traceback should be close to identical to that you'd get in the regular Python shell. Do you have an example where it differs significantly?
I looked a bit at the language definitions, and I have the impression that reasonable folding for LaTeX and Python cannot be implemented in TextMate, as the beginning and end of a block must be defined by a regular expression matching a single line. Or did I overlook something?
It can't be done for now. So we just have to keep our fingers crossed for Allan's speedy progress. :)
-Jacob
On Jan 29, 2008 3:35 PM, Jacob Rus jacobolus@gmail.com wrote:
Konrad Hinsen wrote:
Python support is really disappointing. Folding is completely useless (blocks end at the first blank line),
This is an unfortunate side-effect of TextMate's current folding system which only allows foldings at matching indentation levels. It will certainly change sometime in the hazy indefinite future of later TM versions. In the mean time, as a workaround, if you get the whitespace just right, foldings work great (there's a Cleanup Whitespace command in the Python bundle which does this). It's far from ideal, but it works for me.
Wow, that is a great tip! Is it possible to have this command run in the background on every file save for example?
Cheers, Yi
On Jan 29, 2008 3:35 PM, Jacob Rus jacobolus@gmail.com wrote:
Konrad Hinsen wrote:
Python support is really disappointing. Folding is completely useless (blocks end at the first blank line),
This is an unfortunate side-effect of TextMate's current folding system which only allows foldings at matching indentation levels. It will certainly change sometime in the hazy indefinite future of later TM versions. In the mean time, as a workaround, if you get the whitespace just right, foldings work great (there's a Cleanup Whitespace command in the Python bundle which does this). It's far from ideal, but it works for me.
Just another note, this command works fine for function definitions that are not multiline.
e.g.,
def foo(bar): do something
will fold fine, but
def foo(bar1, bar2)
will not fold after cleaning up white space.
tabs are not handled in a reasonable way (using hard tabs with an indentation other than 8 is an invitation for disaster in Python code), leading to indentation errors,
I've never seen python code which uses a mix of hard tabs and spaces; such is explicitly discouraged by every Python style guideline I've ever seen. Pick either tabs or spaces and stick to it (you can set them with the little dropdown at the bottom of every window). I personally prefer 4-space tabs (never using hard tab characters in my Python code), but code using only hard tabs should also work fine, as should 2-space tabs (e.g. Google's internal code, according to Guido), etc.
and the error output in PyMate is insufficient (I want the full traceback).
The traceback should be close to identical to that you'd get in the regular Python shell. Do you have an example where it differs significantly?
I looked a bit at the language definitions, and I have the impression that reasonable folding for LaTeX and Python cannot be implemented in TextMate, as the beginning and end of a block must be defined by a regular expression matching a single line. Or did I overlook something?
It can't be done for now. So we just have to keep our fingers crossed for Allan's speedy progress. :)
-Jacob
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate