问题
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.
回答1:
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:
- Select Text
- Hold ⇧ and expand the selection on one side with the arrow keys (like ⇧ + ← expands the selection on the left side)
- Hit ⇧ + Space
- You can now decide again which side to expand, instead of only expanding/reducing one side (like ⇧ + → expands the selection on the right side)
来源:https://stackoverflow.com/questions/19819644/how-to-jump-to-the-other-side-of-selected-text