Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>To expand on Ray's answer…</p> <p>When you are using Vim <em>on</em> a remote server via SSH, everything you do in Vim is done on the remote server. The remote server <em>and</em> the remote Vim that you are running on it have zero practical knowledge of your local computer and its system clipboard.</p> <p>Because of that, <code>y</code> will never put the yanked text in your local clipboard.</p> <p>In order to copy a chunk of text <em>from</em> the remote Vim <em>to</em> your local machine's clipboard you have three options:</p> <ul> <li><p>Select the text with your mouse and hit <kbd>Cmd</kbd>+<kbd>C</kbd> like in any Mac OS X application.</p> <p>Obviously, it seems to be the easiest but it has at least three limitations:</p> <ol> <li><p>It is limited to the current screen. If the text you want to yank is not displayed entirely you won't be able to copy all of it.</p></li> <li><p>It doesn't play well with <code>set mouse=a</code>. With this option, any attempt to select something with the mouse will result in a <em>visual</em> mode selection which can't be copied with <kbd>Cmd</kbd>+<kbd>C</kbd>. As a workaround, you can use <kbd>Alt</kbd>+mouse to select the text without entering <em>visual</em> mode or simply remove this setting from your remote <code>~/.vimrc</code>.</p></li> <li><p>Line numbers are copied as well.</p></li> </ol></li> <li><p>Put the yanked text in a temporary file, <code>scp</code> it to your local machine and use <code>pbcopy</code> to put it in your system clipboard.</p> <p>This solution seems to be a little convoluted but it works (and the problem itself is also a little bit convoluted). Over the years I've seen a lot of different implementations ranging from simple one liners to client/server setups. <a href="http://endot.org/2011/12/04/remotecopy-copy-from-remote-terminals-into-your-local-clipboard/">Here is one</a>, feel free to google around for others.</p></li> <li><p>Use X-forwarding to connect your local clipboard to the remote clipboard if available.</p></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload