Copy and paste from external source

后端 未结 5 549
半阙折子戏
半阙折子戏 2021-01-02 05:21

I use vim (Actually gvim on windows) as my main text editor. In my work flow I have to copy sentences to/from various external sources, therefore I use clipboard=unnamed to

5条回答
  •  难免孤独
    2021-01-02 06:22

    I don't know if I misunderstand you but I tried what you are doing and I have no problem in doing that with the + drop-register.

    My workflow:

    1. copy a sentence in an external application (ie. browser)
    2. visual select a sentence in vim and replaced it with "+p or p (with clipboard=unnamed set)
    3. visually select another sentence and replace it with "+p

    Sadly when pasting the second time you have to explicitly paste from the + register. Therefore I would recommend a mapping for p/P instead of using clipboard=unnamed

    nmap p "+p
    

    Try using

    :registers
    

    to see the contents of the different registers.

提交回复
热议问题