1

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 ..
}

1 Answer 1

1

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

3
  • 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, 2011 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, 2011 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, 2011 at 14:31

You must log in to answer this question.

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