Hi,
I have just signed up with this list.
Up until recently I have been using emacs with PHP-model.el for all my PHP coding.
So far I have been impressed with Textmate however there is one feature I can't find.
In emacs w/ PHP-mode I can tidy a php script very easily by just pressing TAB on each of the lines. Even if I am in the middle of a word, pressing TAB just positions it correctly in relation to the line above. Tab does not break up a word, and pressing tab repeatedly does not move it further. Just enough to give nice consistent indentation.
I have been trying to do this in other editors but so far been unable.
Can Textmate do this ?
I can record a screen capture to illustrate if this doesn't make sense.
William
On 06/09/2005, at 16.25, William Macdonald wrote:
In emacs w/ PHP-mode I can tidy a php script very easily by just pressing TAB on each of the lines. Even if I am in the middle of a word, pressing TAB just positions it correctly in relation to the line above. Tab does not break up a word, and pressing tab repeatedly does not move it further. Just enough to give nice consistent indentation. [...] Can Textmate do this ?
This is a common emacs feature, that I also liked.. ish.. can be hard to get used to IMO ;-). TextMate can't do it as such, but it does have auto-indent of course, trying to indent in a sensible way when you press return. I suppose one could write a command to do indenting on pressing TAB, although for large documents I don't know how fast it would be. TextMate commands can do a lot, though.
-- Sune.
On 6 Sep 2005, at 15:25, William Macdonald wrote:
In emacs w/ PHP-mode I can tidy a php script very easily by just pressing TAB on each of the lines. Even if I am in the middle of a word, pressing TAB just positions it correctly in relation to the line above. Tab does not break up a word, and pressing tab repeatedly does not move it further. Just enough to give nice consistent indentation.
I've been missing this feature too. The closest I've found is that M-] and M-[ will in- and out-dent while the cursor is in the middle of a line, though it does occasionally decide to move the cursor onto the next line, and it doesn't automatically choose the 'right' indentation level.
I keep thinking that M-] (to indent) and M-[ (to outdent) is the wrong way round, though. Usually it's when you open a bracket that you want to indent, close it you want to outdent... It's kinda like how I always get confused with look-up and look-down with a joypad in games. :-)
On 06/09/2005, at 17.25, Graeme Mathieson wrote:
I keep thinking that M-] (to indent) and M-[ (to outdent) is the wrong way round, though. Usually it's when you open a bracket that you want to indent, close it you want to outdent... It's kinda like how I always get confused with look-up and look-down with a joypad in games. :-)
You can also use opt-tab to indent, and opt-shift-tab to unindent, anywhere in the line.
-- Sune.
You can also use opt-tab to indent, and opt-shift-tab to unindent, anywhere in the line.
Except for the following weirdness: If the cursor it so far to the right that an unindent will place it off the end of the line, it will jump to the start of the next line. Understandable side-effect, but a bit weird :-p.
-- Sune.
On 6 Sep 2005, at 16:44, Sune Foldager wrote:
Except for the following weirdness: If the cursor it so far to the right that an unindent will place it off the end of the line, it will jump to the start of the next line.
Bingo. That's actually specified the behaviour I was meaning better than my attempt of "though it does occasionally decide to move the cursor onto the next line". :-)
More natural behaviour would be for the cursor to stay at the end of that line, I'd have thought.