Copy from one register to another

后端 未结 2 1415
既然无缘
既然无缘 2021-01-30 06:06

How to copy the contents of one register to another without pasting on clipboard? I\'d yanked one text and it got yanked in the default \" register. Now I want to c

相关标签:
2条回答
  • 2021-01-30 06:46

    You can do something like this:

    let @a = getreg('"')
    

    That'll copy the " register to the a register.

    0 讨论(0)
  • 2021-01-30 06:52

    To copy or swap values between registers you can use the :let command, for example to copy the contents of the b register to a:

    :let @a=@b
    

    Or copy the contents of the " register to a:

    :let @a=@"
    

    Check this Vim Tip for some good key mapping suggestions:

    • Comfortable handling of registers
    0 讨论(0)
提交回复
热议问题