1234
1234

Reputation: 579

Vim share Ex commands globally

In Vim, I can open Vim Ex command Window with q: It seems to me all the commands are not shared in other instance of Vim. e.g. I have other Vim instance in a second console.

I'm wondering whether I can share all the Ex commands that I have typed for last ten days

Upvotes: 1

Views: 61

Answers (1)

Ingo Karkat
Ingo Karkat

Reputation: 172758

No, command history is not shared. Histories (as well as marks, jumps, opened files) are stored in a viminfo file. The contents are written when quitting Vim, and read during startup.

But (and here comes the interesting part), you can manually trigger these with the :rv[iminfo] and :wv[iminfo] commands. So, first execute :wv in the one Vim instance to export its history, then import via :rv in the second instance. This could even be automated via :autocmds.

Upvotes: 1

Related Questions