Question

I have selected a text with the cursor.

Now I want to jump to the other side of the text, but how? If I made the selection with the mouse and moved the selection once with + /, I don't find a way to change the cursor position to the other side of the selected text.

Is there any way to make it happen. Maybe a script in PHP/Shell/Applescript?

I am using OS X Mavericks.

Was it helpful?

Solution

It took a while, but I have found a way. I use KeyBindings of OS X to reset the side where the cursor of the selection is, by killing the selection and yanking it in one step.

You need to add the following line to your ~/Library/KeyBindings/DefaultKeyBinding.dict file:

"$ " = (deleteToMark:, yankAndSelect:);

If you do not habe such a file you can create and add the line with this command:

echo $'{\n\t"$ " = (deleteToMark:, yankAndSelect:);\n}' > ~/Library/KeyBindings/DefaultKeyBinding.dict

Now the keyboard shortcut + Space can be used to reset the side on which the text insertion cursor is, when you have text selected.

Example:

  1. Select Text
  2. Hold and expand the selection on one side with the arrow keys (like + expands the selection on the left side)
  3. Hit + Space
  4. You can now decide again which side to expand, instead of only expanding/reducing one side (like + expands the selection on the right side)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top