2

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?

3 Answers 3

4

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.

0
0

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.

1
  • Yes, this is what I am doing.
    – julien_c
    Commented Jan 14, 2012 at 11:00
0

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.

7
  • @gentmatt Please make sure your formatting edits don't break the answer. Thanks. Commented Jan 24, 2012 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
    Commented Jan 24, 2012 at 8:52
  • @gentmatt I noticed. I only commented on it since you got this one wrong. Commented Jan 24, 2012 at 9:08
  • How? Do you mean the little empty space between the lines or something else? Just curious :)
    – gentmatt
    Commented Jan 24, 2012 at 9:18
  • @gentmatt ^ is a character (in this context), not a key. Everything else was fine as far as I could tell. Commented Jan 24, 2012 at 9:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .