Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Basically, I would like and + to "Shift Right" and "Shift Right" (Menu items to indent or unindent selection) in TextMate.

However, I can't set them using the System Preferences GUI, as pressing tabs to the next UI button.

Is there a way I can do that, maybe using a TextMate-specific custom KeyBindings.dict?

share|improve this question
add comment

3 Answers

up vote 1 down vote accepted

You could cp /Applications/TextMate.app/Contents/Resources/KeyBindings.dict ~/Libary/Application\ Support/TextMate/ and add:

"\t" = shiftRight:;
"$\t" = shiftLeft:;

That would prevent expanding snippets with tab though.

share|improve this answer
    
This is what I ended up doing, thanks! –  julien_c Jan 30 '12 at 12:22
add comment

Well you might run into a stone wall there because by default the system protects and limits the functions of tab so as to ensure proper system response... System Preferences > Keyboard allows one to turn tab to be used for all dialogs in a window, etc.

That being said, are you able to (in the same Keyboard preference window) add in a custom action. Under 10.7, you should have in the right window "Application Shortcuts" from there you can press "+" and select TextMate and then select the menu action you would like to perform. Then simply enter they key strokes.

share|improve this answer
    
Yes, this is what I am doing. –  julien_c Jan 14 '12 at 11:00
add comment

Custom application keyboard shortcuts are stored in the program's property list file in ~/Libary/Preferences, e.g. com.macromates.textmate.plist.

You can assign a keyboard shortcut (e.g. by adding Ctrl to both) using System Preferences and then edit the file to get the correct keyboard shortcut (by removing ^ from the shortcut, which is Ctrl).

enter image description here


Unfortunately, it still doesn't work. Pressing the key combination does not trigger the menu item it's assigned to, for both Tab and Shift-Tab. The previously assign Ctrl-Tab and Ctrl-Shift-Tab work without problems.

enter image description here


So, in this case, I'm afraid it's just not possible.

share|improve this answer
    
@gentmatt Please make sure your formatting edits don't break the answer. Thanks. –  Daniel Beck Jan 24 '12 at 8:38
    
I'm just trying to keep the formatting consistent here on AskDifferent. It's not nice if everybody uses different formatting in his/her post. –  gentmatt Jan 24 '12 at 8:52
    
@gentmatt I noticed. I only commented on it since you got this one wrong. –  Daniel Beck Jan 24 '12 at 9:08
    
How? Do you mean the little empty space between the lines or something else? Just curious :) –  gentmatt Jan 24 '12 at 9:18
    
@gentmatt ^ is a character (in this context), not a key. Everything else was fine as far as I could tell. –  Daniel Beck Jan 24 '12 at 9:29
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.