feature: simple-action history table

19 views
Skip to first unread message

Daan van Rossum

unread,
Jul 11, 2019, 11:56:13 PM7/11/19
to vim...@vim.org
Dear vim devs,

There is one seemingly simple feature that is missing in vim, so I though it is time to bring it up:

Feature: simple action (dot-key) history table.

Quoting vim help:
```
There are actually five history tables:
- one for ':' commands
- one for search strings
- one for expressions
- one for input lines, typed for the input() function.
- one for debug mode commands
```

I'm sure there is a good reason, but why does a table for "repeat last change" (. key) not exist?

One nice thing about the history tables is that they are persistent across restarts. Pressing 'n' after starting vim will repeat the last 'search', pressing '.' would repeat the last 'action'...

Best, Daan
signature.asc

Tony Mechelynck

unread,
Jul 12, 2019, 12:03:44 AM7/12/19
to Daan van Rossum, vim_dev
I think the reason is that (in 'nocompatible' mode) there is an undo
feature which allows you to go back any number of recent changes, then
go forward redoing them.

See
:help u
:help CTRL-R
and in general
:help undo.txt


Best regards,
Tony.

Daan van Rossum

unread,
Jul 12, 2019, 5:33:31 AM7/12/19
to vim_dev
* on Friday, 2019-07-12 06:03 +0200, Tony Mechelynck <antoine.m...@gmail.com> wrote:

> I think the reason is that (in 'nocompatible' mode) there is an undo
> feature which allows you to go back any number of recent changes, then
> go forward redoing them.

The proposed "action history table" allows to repeat previous actions, so it is an extension of the 'dot'-key with deeper and persistent history. This is not about 'undo' and 'redo'.

This feature request is related to the RepeatLast.vim [1]plugin, and these two StackOverflow threads [2, 3].

Since we already have a number of history tables, would it not be easy to add a table for "action history"? There are application that benefit from a deeper and/or persistent history.

Thanks, Daan

1. https://www.vim.org/scripts/script.php?script_id=4381
2. https://stackoverflow.com/questions/16722566/a-more-powerful-version-of-dot-repeat
3. https://stackoverflow.com/questions/17960146/vim-repeat-dot-command-buffer
signature.asc

Bram Moolenaar

unread,
Jul 12, 2019, 9:37:39 AM7/12/19
to vim...@googlegroups.com, Daan van Rossum
This feature request has been in the todo list for a long time, but it
didn't get implemented yet. It would use a list of redo buffers,
currently there is only one such buffer.

--
GUEST: He's killed the best man!
SECOND GUEST: (holding a limp WOMAN) He's killed my auntie.
FATHER: No, please! This is supposed to be a happy occasion! Let's
not bicker and argue about who killed who ...
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages