Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Soft undo" -- undo the last keystroke, not only edit. #3776

Open
mooskagh opened this issue Sep 10, 2022 · 2 comments
Open

"Soft undo" -- undo the last keystroke, not only edit. #3776

mooskagh opened this issue Sep 10, 2022 · 2 comments
Labels
A-helix-term Area: Helix term improvements C-enhancement Category: Improvements

Comments

@mooskagh
Copy link

There is a partially similar feature idea here #1583, but it's not exactly the same.

The idea is to have a key/command which would undo the last keystroke rather than an edit (without removing the classical "last edit" undo). This includes all navigation (and that's what I mostly want), but also would be nice to support selection, single character type in INSERT mode, replication of multiple cursors.

This is important especially for the new users who don't remember all the keystrokes well, but I'm sure power users would find it useful too.

Examples when I felt it could be userful:

  1. One pattern that I often have is typing g e hoping that it will go to the end of the line, but helix jumps to the end of the file. After that it's quite painful to find the place in the file where I was. Typeing undo key and then g l would be much more convenient.
  2. When I want to insert a text after particular token press w multiple times to navigate (and then press a), but I press w one time too many, it becomes unhandy to revert it (bbw I guess would be the way to undo it now).
  3. When I replicate cursor using C and pressed one time too much, I don't know what to do (likely there's a key for this, but it would be convenient to have a separate undo)
  4. When I went into the insert mode and typed something, forgot to leave the mode and then got distracted, I returned and started to type some command (:wq for example), it gots appended to the text. What I instinctively do after that, is <ESC> u, which removes everything that I typed during the last insert session. Then I do U and remove :wq! manually. It would be more convenient to press "soft undo" key several times instead.
  5. Sometimes I want to look the file around e.g. to check what is the funciton signature, and then return to the function I was writing. There is g . to jump to the last modification, but again, undoing the jumping would be easier to learn.
@mooskagh mooskagh added the C-enhancement Category: Improvements label Sep 10, 2022
@Omnikar
Copy link
Contributor

Omnikar commented Sep 10, 2022

I do think this would be a nice feature, but in the meantime, here are existing solutions to a couple of your points:
1: C-o will undo ge and other jumping commands.
3: A-, will get rid of the primary cursor (effectively undoing C).

@the-mikedavis
Copy link
Member

This looks like #1583 plus #1596

@kirawi kirawi added the A-helix-term Area: Helix term improvements label Sep 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements C-enhancement Category: Improvements
Projects
None yet
Development

No branches or pull requests

4 participants