Swap Cursor and Mark (move to start/end selection)

In Emacs there's a way to move the cursor from one end of your selected text to the other. It's called: swap cursor and mark. I can't find anyway to do this in Idea. Is there already a solution out there?


I don't know, whether it's Windows behaviour, but some Windows applications
can do it (the text "line of" is selected):

This is a sample text.

When pressing <cursor-left>, the caret will be here:

This is a |line of sample text.

When at the original selectiion <cursor-right> is pressed, the caret is there:

This is a line of| sample text.

If IDEA could handle it as described, would this solve your needs?



Selfishly, yes, this would solve my problem, but right now those keystrokes unselect text so this solution would break that functionality - even if it's a side effect. However, since you can't move the cursor inside your selection anyway this solution seems reasonable and intuitive except for those people who've come to rely on these keystrokes unselecting text. Perhaps the CTRL-Cursor keys (when there's selected text).


Write a plugin for this, it shouldn't be difficult.

The LineUpDownMover plugin should be a good example, it's small and as a bit of cursor placement and selection detection code.


Yes, it removes the selection, but at least for me, this would be enough.



Please sign in to leave a comment.