How to copy and paste in Vim's terminal mode?

后端 未结 3 1185
南方客
南方客 2021-02-20 03:25

I often want to copy text from a :terminal window to a normal text buffer. At the moment I exit the shell session and copy from the history.

3条回答
  •  长情又很酷
    2021-02-20 03:47

    Set the clipboard setting in your .vimrc to using system clipboard as the Vim's clipboard. Depends on your OS it may differ, assume you are using Mac OS: set clipboard=unnamedplus

    Then you can use y command to copy then paste on another app just by Cmd + V, remember to exit the insert mode of the terminal by clicking any where or press Ctrl+\ Ctrl+n

提交回复
热议问题