vim + COPY + mac over SSH

后端 未结 12 1313
悲哀的现实
悲哀的现实 2021-01-30 01:12

I access a sever over ssh on which I run vim for editing files. When I try to yank text from vim into an editor locally on my mac (lion) either with y OR \"+y it does not work.

12条回答
  •  星月不相逢
    2021-01-30 01:25

    Had this problem - log in from OSX over SSH to a linux box and cannot copy text from a file, opened with vim.

    My workaround is :set mouse=i

    By default mouse is enabled in all modes. When you set it to be enabled only in Insert mode you can scroll around and copy when you are not editing (normal mode) but when you start editing (by hitting the I or Insert key) and enter insert mode the mouse acts as cursor placement and you cannot copy from terminal.

    You can set that option in ~/.vimrc

    See :help mouse for more information about the values you can set and the modes.

提交回复
热议问题