Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7966549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:27:40+00:00 2026-06-04T06:27:40+00:00

I access a sever over ssh on which I run vim for editing files.

  • 0

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. I end up with the text I copied last locally. It does work if I just use p within vim alright.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T06:27:42+00:00Added an answer on June 4, 2026 at 6:27 am

    To expand on Ray’s answer…

    When you are using Vim on a remote server via SSH, everything you do in Vim is done on the remote server. The remote server and the remote Vim that you are running on it have zero practical knowledge of your local computer and its system clipboard.

    Because of that, y will never put the yanked text in your local clipboard.

    In order to copy a chunk of text from the remote Vim to your local machine’s clipboard you have three options:

    • Select the text with your mouse and hit Cmd+C like in any Mac OS X application.

      Obviously, it seems to be the easiest but it has at least three limitations:

      1. 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.

      2. It doesn’t play well with set mouse=a. With this option, any attempt to select something with the mouse will result in a visual mode selection which can’t be copied with Cmd+C. As a workaround, you can use Alt+mouse to select the text without entering visual mode or simply remove this setting from your remote ~/.vimrc.

      3. Line numbers are copied as well.

    • Put the yanked text in a temporary file, scp it to your local machine and use pbcopy to put it in your system clipboard.

      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. Here is one, feel free to google around for others.

    • Use X-forwarding to connect your local clipboard to the remote clipboard if available.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use Emacs TRAMP to access files over ssh on a
When I attempt to access mysql over an SSH tunnel, I get the error:
I am trying to access from an Android device over WiFi a local web
Is it possible to run a git server over ssh, using authorized_keys and command=
When I don't have SSH access to a server, I usually download stuff over
I have full access to some folder on a remote Linux server over ssh
I am developing a Client-Server based application in which client application will access server
I access my Unix server via ssh and I always do the same commands.
Need to query my SQL server from Access using an ADO connection (for example),
I'm trying to transfer some data from Access to SQL Server 2000 (there are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.