On Thu, 5 Apr 2007, Rob McBroom wrote:
There doesn't seem to be a way to set "beginning of a line" as a Tab Trigger, but perhaps you could modify the relevant language grammars to have a "beginning of line" scope or an "empty line" scope and have a Snippet or Command with a Key Equivalent of ⇥ that inserts a literal Tab only in that scope.
This *almost* works, but my language-grammar-fu is not strong enough. In the C grammar, for example, I haven't been able to come up with a scoping rule to select '^\s*' that doesn't interfere with existing rules which contain whitespace anchored at the start of the line (like pre-processor directives). I think I'd have to edit every existing rule which contains '^\s*' to capture that leading whitespace into its own scope. That's way more grief than I'm looking for.
And, as I reflect on it some more, just re-assigning the tab key isn't exactly what I want. I also want cmd-] to insert hard tabs to indent a block, which wouldn't happen with this technique. Though I suppose I could write another command for cmd-] that would do that.