简体   繁体   中英

vim macro across screen windows

I have recorded a vim macro in one screen window. In same screen session, I have multiple windows.

How to make macro I recorded in 1st screen window across other screen windows / across screen sessions?

Do we have to do something with vim registers for this?

  • If the two screen windows show two separate Vim instances on the same machine

    • If Vim is built with clipboard support

      1. In the Vim instance where you recorded that macro, put the content of the macro's register into the clipboard register:

         " assuming you recorded your macro in register `a`:let @+ = @a
      2. In the other Vim instance, put the content of the clipboard register into a named named register:

         :let @a = @+
    • If Vim is not built with clipboard support

      Vim stores registers in a .viminfo file. You are theoretically allowed to write to and read from arbitrary .viminfo files but it can lead to unwanted loss of state in Vim. Read :help viminfo-read-write very carefully and proceed with caution.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM