osx - Transpose words in Sublime Text 3

06
2014-04
  • Trevor Burnham

    In Sublime Text 2, I'm able to transpose two words by placing the cursor on the space between them and pressing Ctrl+T. However, in Sublime Text 3 (build 3059 on OS X Mavericks), I get the default OS X behavior of just transposing two characters. This is the case even if I choose Edit > Text > Transpose through the status bar.

    Is this a bug, or by design? Is there a way to bring back the old behavior?

  • Answers
  • NovicePhysicist

    The TransposeCharacter plugin offers more intelligent transposing, see readme for details, and maybe even this screencast. It goes really well with the MarkAndMove plugin.

    While this doesn't answer your question, I hope it can render it obsolete :)


  • Related Question

    osx - how can I use the ctl+arrow windows shortcut to navigate through each word in a text at Mac?
  • yanis

    How can I use the Ctrl + Arrow windows shortcut to navigate through a text sting on a Mac?


  • Related Answers
  • lajuette

    Have you tried to use ⌥-arrow (ALT-arrow)?

  • Daniel Beck

    Create a file named DefaultKeyBinding.dict in ~/Library/Keybindings and add the following text:

    {
        "^\UF702" = (moveWordLeft:);
        "^\UF703" = (moveWordRight:);
    }
    

    This will reassign Ctrl-Left and Ctrl-Right from their default moveToBeginningOfLine/moveToEndOfLine to movement by words, the same action as performed by Opt-Left/Right.