mirror of
https://github.com/jbranchaud/til
synced 2026-01-03 15:18:01 +00:00
Add Breaking The Undo Sequence as a vim til.
This commit is contained in:
@@ -291,6 +291,7 @@ smart people at [Hashrocket](http://hashrocket.com/).
|
||||
- [Amend Commits With Fugitive](vim/amend-commits-with-fugitive.md)
|
||||
- [Beginning And End Of Previous Change](vim/beginning-and-end-of-previous-change.md)
|
||||
- [The Black Hole Register](vim/the-black-hole-register.md)
|
||||
- [Breaking The Undo Sequence](vim/breaking-the-undo-sequence.md)
|
||||
- [Buffer Time Travel](vim/buffer-time-travel.md)
|
||||
- [Case-Aware Substitution With vim-abolish](vim/case-aware-substitution-with-vim-abolish.md)
|
||||
- [Case-Insensitive Substitution](vim/case-insensitive-substitution.md)
|
||||
|
||||
34
vim/breaking-the-undo-sequence.md
Normal file
34
vim/breaking-the-undo-sequence.md
Normal file
@@ -0,0 +1,34 @@
|
||||
# Breaking The Undo Sequence
|
||||
|
||||
Generally, the sequence of undo-able actions is segmented by command. When
|
||||
entering Insert mode, everything typed until exiting Insert mode is part of
|
||||
a single undo-able segment. If you are going to be typing in Insert mode for
|
||||
a while though, you may want to break it up a bit. Without leaving Insert
|
||||
mode, hit `ctrl-g u` to mark a break in the sequence of undos.
|
||||
|
||||
For example, starting in Normal mode and then typing
|
||||
`iabc<CTRL-G>udef<CTRL-G>ughi<ESC>` will leave the buffer with:
|
||||
|
||||
```
|
||||
abcdefghi
|
||||
```
|
||||
|
||||
Hitting `u` once will leave the buffer with:
|
||||
|
||||
```
|
||||
abcdef
|
||||
```
|
||||
|
||||
Hitting `u` again:
|
||||
|
||||
```
|
||||
abc
|
||||
```
|
||||
|
||||
Hitting `ctrl-r`:
|
||||
|
||||
```
|
||||
abcdef
|
||||
```
|
||||
|
||||
See `:h i_CTRL-G_u` for more details.
|
||||
Reference in New Issue
Block a user