micro icon indicating copy to clipboard operation
micro copied to clipboard

Have a shortcut/command to toggle sticky selection

Open alexandrenavarro opened this issue 4 years ago • 5 comments

Description of the problem or steps to reproduce

New feature : Have a shortcut/command to toggle sticky selection.

Specifications

When you activate the sticky selection, you mark the current position of the cursor and when you move the cursor, it selects from your marked position to your current cursor position. It is like the shift is hold (without holding shift of course) until the deactivate it or you execute a command like copy / cut / delete.

It is named Toggle Sticky Selection in intellij and set mark command in emacs (https://www.gnu.org/software/emacs/manual/html_node/emacs/Setting-Mark.html) and ToggleNormalSelection in alacritty visual mode.

It should be great to have this feature in micro.

Don't hesitate if it is not clear or need more precision.

Thanks for your amazing terminal editor.

Commit hash: OS: Terminal:

alexandrenavarro avatar Aug 19 '21 23:08 alexandrenavarro

This is one of the main issues preventing me from replicating my very basic (default) Emacs setup in micro's simpler, nicer environment.

JPLeBreton avatar Sep 22 '21 18:09 JPLeBreton

Trying migrate to micro from midnight commander editor (shame:P), and I would love that feature too :)

dyipon avatar Oct 01 '21 12:10 dyipon

Bump. This is still a desirable feature, and would make migrating from Emacs much easier for users like myself.

HobbitJack avatar May 10 '25 06:05 HobbitJack

As always, PRs are welcome.

Or perhaps it could be implemented as a plugin, - if there was a way for a plugin to temporarily rebind a key to some other binding (e.g. as some form of modal keybindings support which was requested in #1740). Then a plugin would just need to temporarily bind the Right key to SelectRight instead of CursorRight, and so on.

dmaluka avatar May 11 '25 14:05 dmaluka

I tried to make a simple plugin that tries to recreate this behavior. (I never used such feature) Sticky

It's a pretty simple script that replaces arrow keys action based on a flag.

Feel free to leave feedback.

cutelisp avatar May 15 '25 01:05 cutelisp