I sometimes execute commands in Vim by mistake, either in normal-, visual-, or ex-mode and have no idea what was executed.

Is it possible to see a history of executed command per mode in Vim?

I know that I can see the history of executed ex-mode commands by pressing : (to enter ex-mode) and then use the <arrow-up> and <arrow-down> keys to navigate the history, but I have no idea on how to do that in normal- or visual-mode?

1 Answer 1


There's no history for Normal/Visual mode in Vim.

The only thing I can remember of is v:operator which is set to the last Normal/Visual mode operator executed.

  • Why does :v:operator displays the contents of the current buffer? It just displays what's in the window in a new (split) window.
    – Shuzheng
    Jul 10, 2020 at 7:19
  • @Shuzheng v:operator is a builtin variable of String type.
    – Matt
    Jul 10, 2020 at 7:31
  • How do I see its contents? Also, :h v:operator says it only holds a single operator (character)? So, if I press diw, then it will only show w?
    – Shuzheng
    Jul 10, 2020 at 7:33
  • @Shuzheng It's "d", not "w".
    – Matt
    Jul 10, 2020 at 7:44
  • But, how can I see the contents of the v:operator?
    – Shuzheng
    Jul 10, 2020 at 7:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.