views:

143

answers:

1

In Textmate: Power Editing for the Mac, the author says that Textmate has Emacs key bindings. When I try to use them in Textmate some work and some don't work. For example C-n moves the cursor down one line, but C-p runs some command that gives me weird output (it doesn't move up one line). Is there a way in Textmate to lookup what a key binding does (like Emacs' help command)? Why are some Emacs key bindings being overridden by other commands and how do I fix this?

+2  A: 

There are some Emacs key bindings available. ^+A, ^+E, ^+K, ^+Y, etc., work as they do in Emacs (in fact, most of those will work in any Cocoa app). You can see a more complete list here (scroll down about ⅔ of the way down the page). However, active bundles may interfere with some of the these bindings, in which case you can edit the bundle by going to Bundles > Bundle Editor. Also, not all Emacs bindings work.

mipadi
Is there an easy way you can figure out what command C-p is bound to?
hekevintran
Bundles > Select Bundle Item will show you the current bundle items and keybindings in use. Or you can just hit C-p and see what happens...
mipadi
Right, but if it does something unexpected or returns weird output, I have no idea which command it was or which bundle it came from. Emacs' help command will tell you which function will run for a given key binding.
hekevintran
Well, Bundles > Select Bundle will show all the current bundle items and their key bindings.
mipadi
I want to search by key binding but I must search by bundle item order. It feels like I am referencing a phone book, but in reverse. It looks like this is the best that TextMate can do. =)
hekevintran