Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I know I can press "Apple Left" or "Ctrl a" to move the cursor to the beginning of a line.

But how to move the cursor to the beginning of my code? (like I can do M-m in GNU Emacs on Terminal).

Ex. at the second line of this file, I want to move the cursor to a place right before "S" of "String", not below "c" of "class".

class Book {
    String title;
    .. cut ..
}
share|improve this question

1 Answer 1

up vote 1 down vote accepted

I would (and have, actually), created a macro that does this:

  1. Apple Left Arrow (to get to the beginning of the line, like you mentioned)
  2. Find, with Regex, \w
  3. left arrow (as the previous step has selected the first character)

FWIW, I have a TextMate bundle full of motion commands like this (which I added this to): https://github.com/rwilcox/motion_commands.tmbundle

share|improve this answer
    
thanks, "Apple Option Left" worked. Although I can do "Apple 1", "Apple 2", etc or "Apple t" then filename to navigate to another file, I also usually do "Apple Option Left" to navigate to the left file of the current one intuitively, now I can't do that anymore, kinda like unlearning qwerty to dvorak. Can we change that to another shortcut? Like "Option-m"? –  Arie Jun 25 '11 at 11:54
    
Didn't that keyboard shortcut change (back) in the latest TextMate?... or maybe I set it, myself, to Command-{. But yes, this brings up something I don't like about TM - hard to customize the keyboard shortcuts in a bundle –  RyanWilcox Jun 25 '11 at 13:29
    
I use the latest cutting-edge build of TextMate 1631. Nice to know "Command-{". I guess, I can use "Apple Option Left" happily with that "Command-{" now. –  Arie Jun 25 '11 at 14:31

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.