views:

121

answers:

5

The shortcut for jumping to the beginning or end of a line of code with + -> or + <- does not work. I just get a mac os x system beep.

I believe this shortcut is universal to the mac os x platform, and not specifically TextMate, and it and it does work everywhere else (TextEdit, StackoverFlow, etc.).

Why would TextMate conflict with it, and not work?

It does work on my other mac in TextMate. Is there a configuration I can change somewhere? I tried reinstalling TextMate.

Update

I was on Textmate 1.8, and upgraded to 1.9 .

I noticed this in the Release notes :

[FIXED] Add local key bindings for command + arrows (as there are no defaults in Snow Leopard) - ticket 0FDE7076.

Now when I do + <- It closes the application, and goes to whatever app is also being used by finder.

When I do + -> it works as expected.

+1  A: 

Maybe you have a bundle item that's interfering? -Arrow does work as expected in TextMate.

mipadi
That's what I'm thinking. Off topic: How did you make those into buttons in your response? :D
Trip
Wrap it in **kbd** tags.
mipadi
+1, works as expected.
Agos
+1  A: 

Unlike many programs, short-cut keys are not defined in the preferences but it in the bundles that are loaded when the application starts.

TextMate has a bunch of places it looks for bundles and add-ons so you might have to hunt around to find the differences between the two apps. In general terms you should look in ~/Library/Application Support/TextMate and /Library/Application Support/TextMate to see what is set.

You should be able to copy the contents of the working bundle set over to the non-working computer to resolve the problem. Be sure to make a back-up of that directory first just in case you make it even worse by mistake.

tadman
TextMate does use most of the "global" Cocoa shortcut keys, such as Command-RightArrow and Command-LeftArrow.
mipadi
TextMate has to implement those on its own because it uses a custom editor control. The tab switching is particularly annoying because it uses a non-standard, non-modifiable short-cut. ⌘⌥] and ⌘⌥[ should work for most apps.
tadman
+2  A: 

I haven't heard of that shortcut, and no idea why it's not working.

I use the emacs combos that work in most Mac apps: Ctrl-A to jump to the beginning of a line and Ctrl-E to jump to the end.

Ctrl-D (forward delete), Ctrl-L (center current line) and Ctrl-T (transpose two chars) are also handy.

Frank Schmitt
Wow, I never knew they snuck those in there. Very interesting.
tadman
Yah very interesting!
Trip
Ctrl+A, Ctrl+E and Ctrl+D (and possibly others) work not only inside of Textmate, but in every Cocoa text box (or text view or whatever it's called), like the box I'm typing in now :)
Agos
TextMate's main window is not a Cocoa textbox, it just has most of the same text navigation shortcuts.
masonk
+1  A: 

TextMate doesn't use Cocoa for its main window text box, but it does implement most Cocoa shortcuts, including ⌘→ for jumping to the end of the line.

As discussed, you most likely have a bundle that's binding that command. However, because it's TextMate, and TextMate is awesome, there is a simple and direct method to find out what bundle item that is.

Bundles->Select Bundle Item..., then click the magnifying glass and switch to Key Equivalent. Type ⌘→ and it will show you what bundle item you're getting. This is context dependent, so make sure your cursor is in the scope where you're having problems.

If you don't see a bundle item show up, then it means some other program on your computer is eating ⌘→.

masonk
Interesting! I did try this, but nothing comes up. But nothing comes up for anything I put in. Even things I know would have made it come up for example <kbd>⌘</kbd>+<kbd>t</kbd> doesn't bring anything up..
Trip
⌘T isn't a bundle item either, so you wouldn't expect that to show up in the Show Bundle Items dialog. Both ⌘T and ⌘→ are built-ins to TextMate and wouldn't show up in the Show Bundle Items dialog. However, bundle items take precedence over builtins, so if you did have a bundle item blocking it, you would have seen it here. Are you SURE that it works everywhere else?
masonk
Positive. Even in stackoverflow it works. And TextEdit.
Trip
A: 

I finally found this! Turns out textmate doesn't work with Snow Leopard key bindings.

http://ticket.macromates.com/show?ticket_id=0FDE7076

Strange right? The files included in this link should address the problem.

Trip