I love Textmate, but this is a small oddity that always bothered me.
I am currently using Version 1.5.10.
I use Command + Option + Dot to close a html tag, but when I do the result is this.
<html>
</html>
I wish Textmate knew how to do this instead. Automatically de-indents when closing tag is added.
<html>
</html>
This works well for Ruby code by the way. Textmate de-indents when end is typed.
The
Insert Close Tag (⌘⌥.)command in TextMate (along with every other command in the Bundles menu) is completely customisable through theBundle Editor.If you open up the Bundle Editor (
Bundles>Bundle Editor>Show Bundle Editor (⌃⌘⌥B)), and find the ‘Insert Close Tag’ command in the list on the left, you should be able to view and edit the code in that command.To implement your un-indenting functionality, find this chunk of code (at the end of the file):
And modify it so that it looks like this:
This extra line of code tells TextMate that after inserting the closing tag, it should perform the
Shift Leftcommand, by simulating the a press of the key combination⌘[– thus un-indenting your code.