-
Notifications
You must be signed in to change notification settings - Fork 17.4k
Support for vim-style insert transactions #962
Comments
Thanks for writing this 💯. I've had the exact same thought sitting in my head but I hadn't spent the time to write it down. The short answer is that this requires changes in Atom core's API and there are too many moving parts currently and our focus has been on our alpha 🚢. I think once that quiets down that it's definitely something we should add. |
I would love to have this in Atom as well. This was one of the biggest issues with the old vim plugin. I would like the following solution the best: While in insert mode you can use Command-Z as you normally do while writing. When the transaction is finished, Command-Z undoes the entire insert. |
Another user request for this atom/vim-mode#55 |
Closing in favor of atom/vim-mode#55 |
This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks! |
Vim has the interesting property that insertions are actually transactions. Batches of typing can be repeated, undone, and generally messed with atomically. For example:
2iabc<esc>
will enter insert mode, let you typeabc
, and when you leave insert mode,abc
will appear a second time, having been entered twice.Much more usefully:
iabc<esc><move around>.
will enter insert mode, typeabc
, leave insert mode, move to a new location, and repeat the last insert at the new location. Great for things like strings in tests.I poked around at adding this tonight. Up in vim-mode land it's actually not that complicated, but I ran into the weeds when I started to look at the telepath library SharedString underlying text buffers. It sure looks like these classes are just aching to support this kind of thing, what with their patches and transactions, but the transactions I see in the undo history are all associated with particular locations.
Is it possible to expose the concept of patches somehow? Something like 'apply the patch in undo location
n
to the current cursor location'?The text was updated successfully, but these errors were encountered: