TextMate is one of the best editors I have used on the Mac, and things like its macros, snippets, and tab triggers almost make me switch right away. Especially column-based typing is awesome.
However, there are a couple of limitations that are important enough for me to keep me from switching. In rough order of importance:
- Function parser is line-based
The functions popup or the symbol browser (Command-Shift-T) work line-based, i.e. they don't recognize functions such as
void foo( int param1, int param2) { }
We have a coding style that requires this layout for most functions, so the function popup/symbol browser is next to useless for us.
I understand that this is because the regular expression based function parser can only work line by line, but still this is one of the most severe limitations for me.
- Loses insertion point when document is changed by another app
If another application changes a document that is currently open in TextMate, TextMate notices this when you bring it to the front, and reloads the changed document. This is good; however, it loses track of where you were editing, and scrolls all the way to the top, setting the insertion point to the beginning of the text. I suppose this is intentional, because an existing selection may no longer be at the right place after the other application inserted or deleted text before the selection; however, in the majority of cases it makes more sense to me to keep the current selection and scroll position, even if it may be slightly off. For example, when I use TextMate for coding but Xcode for debugging, I often fix minor typos in the Xcode editor while debugging, and it is very annoying to have to go back to where you were editing in TextMate after that.
- Find has no "whole words only" option
I must be missing something here. This seems like such as basic feature of any serious text editor.
- Option-RightArrow stops too often
When stepping word by word through a sequence such as "abc / def", Option-RightArrow stops after 'abc' (which is fine), and then it stops *before* 'def', which is not; it should directly jump to after 'def'. In other words, it should jump from one end of a word to the end of the next word, skipping all non-words. Xcode and CodeWarrior do this right (in my opinion); in BBEdit it's even worse than in TM though.
- Bundle commands should be available without an open window
Some bundle commands are already available now when no window is open (e.g. "Relaunch TextMate"), but they don't do anything when chosen. For some commands this would be very useful though (e.g. Xcode/Run, or most Help commands).
- Undo is per-character
Typing sequences should be consolidated into a single undo step. Doesn't anybody use undo for typing? This is basically unusable in TextMate.
- Shift Left/Right should extend the selection to whole lines
I often put the insertion point somewhere in the middle of the first line of a paragraph, hit Shift-DownArrow until I'm in the middle of the last line of the paragraph, and then choose Shift Right; this will insert a tab in the middle of the first line, which makes absolutely no sense to me. Same for "Source/Comment Line". I think these commands should first extend the selection to the beginning of the first and end of the last selected line; I can't think of a single situation where you wouldn't want this. BBEdit gets this right.
- Remap keys for Shift Left/Right
If there's a multi-line selection, I'd like Tab and Shift-Tab to be bound to Shift Right/Shift-Left. I see no reason why I should have to hold down Option too.
- Control-RightArrow should jump by CamelCaps sub-words
Right now, Ctrl-Left/Right jump to the beginning/end of the line; there's already Command-Left/Right for that, so I think Ctrl-Left/Right would be free to jump over the sub-words of a CamelCapsVariableName. See Xcode.
- Show key binding for a particular key
With all those bundles and scope-based bindings, it can be very difficult to figure out what command a particular key is currently bound to in the current context. There's the Bundles/TextMate/Show Keyboard Shortcuts command, but it generates a huge list that you have to wade through. It would be very useful to have a function that lets you type a key and displays what it is bound to.
On Aug 6, 2006, at 10:33 AM, Stefan Haller wrote:
Find has no "whole words only" option
I must be missing something here. This seems like such as basic feature of any serious text editor.
Check the “Regular expression” option, and search for something like “\bfoo\b”. That would pick up “foo”, but not “foobar”.
-- Daniel
On Aug 6, 2006, at 9:33 AM, Stefan Haller wrote:
Option-RightArrow stops too often
When stepping word by word through a sequence such as "abc / def", Option-RightArrow stops after 'abc' (which is fine), and then it
stops *before* 'def', which is not; it should directly jump to after 'def'. In other words, it should jump from one end of a word to the end of the next word, skipping all non-words. Xcode and CodeWarrior do this right (in my opinion); in BBEdit it's even worse than in TM though.
My opinion is that TextMate is the only one that gets this right.
James Edward Gray II
Stefan Haller wrote:
However, there are a couple of limitations that are important enough for me to keep me from switching. In rough order of importance:
- Function parser is line-based
- Loses insertion point when document is changed by another app
Nothing to be done about these two at the moment
Find has no "whole words only" option
I must be missing something here. This seems like such as basic feature of any serious text editor.
As was mentioned, use regular expressions and add \b
Undo is per-character
Typing sequences should be consolidated into a single undo step. Doesn't anybody use undo for typing? This is basically unusable in TextMate.
You can add a customized key binding which does "undo:" several times. See my [article][1] about the text system for how to set up key bindings.
[1]: http://hcs.harvard.edu/~jrus/site/cocoa-text.html
Shift Left/Right should extend the selection to whole lines
I can't think of a single situation where you wouldn't want this. BBEdit gets this right.
I use this all the time in column mode, but you're probably right that in regular mode a whole line is usually desired. Then again, it's not really very hard to write your own macro or command that does this.
- Remap keys for Shift Left/Right
You can write a macro for this
- Control-RightArrow should jump by CamelCaps sub-words
You can write a macro for this too
-Jacob
Thanks for your help, I appreciate the suggestions; when composing a reply it occurred to me that I should probably have started separate threads for each issue. I'll reply in separate messages now so that the mails don't get too long.
Sorry for the flood of messages, I hope you bear with me.
Jacob Rus jrus@hcs.harvard.edu wrote:
Shift Left/Right should extend the selection to whole lines
I can't think of a single situation where you wouldn't want this. BBEdit gets this right.
I use this all the time in column mode, but you're probably right that in regular mode a whole line is usually desired. Then again, it's not really very hard to write your own macro or command that does this.
An example how to do this would be much appreciated; I can't seem to figure it out myself.
Stefan Haller wrote:
Jacob Rus jrus@hcs.harvard.edu wrote:
Shift Left/Right should extend the selection to whole lines
I can't think of a single situation where you wouldn't want this. BBEdit gets this right.
I use this all the time in column mode, but you're probably right that in regular mode a whole line is usually desired. Then again, it's not really very hard to write your own macro or command that does this.
An example how to do this would be much appreciated; I can't seem to figure it out myself.
Okay, I've attached a macro which indents including the beginning of the line. It's kinda slow (there may be a better way), but it gets the job done.
Jacob Rus jrus@hcs.harvard.edu wrote:
Okay, I've attached a macro which indents including the beginning of the line. It's kinda slow (there may be a better way), but it gets the job done.
Clever idea, thanks.
Jacob Rus jrus@hcs.harvard.edu wrote:
Undo is per-character
Typing sequences should be consolidated into a single undo step. Doesn't anybody use undo for typing? This is basically unusable in TextMate.
You can add a customized key binding which does "undo:" several times.
I don't see how this would help. I don't know in advance how many times I have to hit "Undo" to undo the last typing sequence. (A typing sequence is a string of characters that have been typed without moving the insertion point, or executing other commands.)
Stefan Haller wrote:
Jacob Rus jrus@hcs.harvard.edu wrote:
Undo is per-character
Typing sequences should be consolidated into a single undo step. Doesn't anybody use undo for typing? This is basically unusable in TextMate.
You can add a customized key binding which does "undo:" several times.
I don't see how this would help. I don't know in advance how many times I have to hit "Undo" to undo the last typing sequence. (A typing sequence is a string of characters that have been typed without moving the insertion point, or executing other commands.)
Well, maybe not a complete solution, but I find it helpful. I agree that chunked undo is something which is generally desirable, and I believe allan's had many requests, so it may be on the todo list.
Jacob Rus jrus@hcs.harvard.edu wrote:
Find has no "whole words only" option
I must be missing something here. This seems like such as basic feature of any serious text editor.
As was mentioned, use regular expressions and add \b
This is not convenient enough. Whole-word search is my default when I write code; I like double-clicking a variable name, hitting Command-E, and Command-G to find other instances of that variable. Having to go into the Find dialog and adding \b makes this much less pleasant.
Jacob Rus jrus@hcs.harvard.edu wrote:
- Remap keys for Shift Left/Right
You can write a macro for this
How? I want the Tab key to insert a tab when there's no selection, but to shift the selection right if there is. I don't see how I can do this with a macro.
Jacob Rus jrus@hcs.harvard.edu wrote:
- Control-RightArrow should jump by CamelCaps sub-words
You can write a macro for this too
The closest I could get is a macro that searches for the regex [A-Z][a-z], and then types left-arrow. (Actually, the real macro is a bit more complicated, but you get the idea.)
This is already pretty good, but the problem is that it doesn't work with the shift key down, which should extend the selection by CamelCapsSubWords. I see no way to achieve that, I think it needs support in the editor core so that anchor handling is done right.
Stefan Haller wrote:
Jacob Rus jrus@hcs.harvard.edu wrote:
- Control-RightArrow should jump by CamelCaps sub-words
You can write a macro for this too
The closest I could get is a macro that searches for the regex [A-Z][a-z], and then types left-arrow. (Actually, the real macro is a bit more complicated, but you get the idea.)
This is already pretty good, but the problem is that it doesn't work with the shift key down, which should extend the selection by CamelCapsSubWords. I see no way to achieve that, I think it needs support in the editor core so that anchor handling is done right.
Yeah, it requires some cleverness. This macro I've attached is kind of slow, but it gets the job done. This one does a forward selection, but you can do one for backwards selection as well. The one problem is that I'm not sure I can make commands which will take into account where the selection is anchored, and shrink the selection from one end. To really solve this problem we'll need some real scripting in TextMate, and that's only on the long-term todo from what I understand.
-Jacob