10

I'm coming from windows editors and I'm used to moving word to word in an editor (notepad, visual studio) or any application for that matter

Can somebody tell me how to remap the ctrl+rightarrow and ctrl+leftarrow to move word to word on my mac book pro retina running lion?

Currently the ctrl+leftarrow moves to the other dsktop on mac no matter what application I'm currently using. How can I disable that for one...

...and more importantly get the word for word traverse working in an application via ctrl+leftarrow and ctrl_rightarrow?

genxgeek
  • 753
  • 1
  • 10
  • 20

1 Answers1

9

You can change the keyboard shortcuts for changing spaces from System Preferences:

Then create ~/Library/KeyBindings/ and save a property list like this as DefaultKeyBinding.dict:

{
  "^\UF702" = moveWordLeft:;
  "^\UF703" = moveWordRight:;
  "^$\UF702" = moveWordLeftAndModifySelection:;
  "^$\UF703" = moveWordRightAndModifySelection:;
}

You have to quit and reopen applications to apply changes to DefaultKeyBinding.dict.

See http://www.hcs.harvard.edu/~jrus/site/cocoa-text.html or http://lri.me/keybindings.html for more information.

Valentin
  • 416
  • 3
  • 10
Lri
  • 40,894
  • 7
  • 119
  • 157
  • Thanks for the reply. This seemed to work but it it won't move to the end of the last token of a line when seleting ctrl+rightarrow. For instance given the following line: "Test this lasttoken". The cursor only ends up before the "l" for lasttoken. It doesn't move to the end of the line. This was for text edit and skype just for starters. Any idea how to get it full 1:1 mapping as option+rightarrow? – genxgeek Oct 14 '13 at 05:09
  • Ah, of course! I was stuck trying to figure out why my DefaultKeyBinding.dict wasn't working for the ctrl+arrows, until I saw your answer and everything clicked! The default Mac shortcuts for Mission Control were getting in the way. This answer is almost 10 years old, but still relevant today. Thank you @Lri! – Gui Ambros Apr 04 '22 at 01:04