How to “copy to clipboard” in vim of Bash on Windows?

前端 未结 9 1029
执念已碎
执念已碎 2020-12-13 00:38

I used to use \"+y to copy text to system\'s clipboard, but it doesn\'t work in vim of Bash on Windows.

9条回答
  •  一个人的身影
    2020-12-13 01:41

    vmap  y :w !clip.exe
    "---------------------- :w !clip.exe
    " The core command, thanks to Mitchell's answer.
    "---------------------------------- 
    " The first  closes the command;
    " the second  suppresses "Press ENTER or type command to continue".
    "--- :h map-silent
    " This fix the flicker caused by external commands and .
    "------------ :h leader
    " `:echo mapleader` to view your leader key.
    

    Standing on the shoulders of giants, I'm using the above solution now.

提交回复
热议问题