Code Monkey home page Code Monkey logo

Comments (11)

tpope avatar tpope commented on August 15, 2024 3

It's great when copy and paste are properly hooked up, but in a world with ssh, tmux, and custom Vim builds that aren't always configured quite right, you sadly can't really count on that. Personally I :set mouse=nvi, so I can access the built-in terminal mouse support by pressing : when necessary. But that feels a bit too clever to impose on the world.

from vim-sensible.

tpope avatar tpope commented on August 15, 2024 1

This isn't some bug I'm talking about. Try running Vim via SSH without ForwardX11 and you won't be able to access the system clipboard. On Linux, this means dragging to copy to primary selection and middle click to paste won't work. On a Mac, this means you can't select text and press Cmd-C to copy.

from vim-sensible.

josephholsten avatar josephholsten commented on August 15, 2024 1

Ah I can confirm by:

  • ssh remote-machine
  • vi remote-file
  • :set mouse=a
  • Select text with your mouse
  • Then the local terminal emulator fails to present a "Copy" operation, either for Ctrl-C/Cmd-C or from a menu.

from vim-sensible.

Asheq avatar Asheq commented on August 15, 2024

I'm with you, but my guess is that some people might prefer having some or all of their mouse events (e.g. to select text and copy it) handled by the terminal itself. (I'm not one of those people)

from vim-sensible.

josephholsten avatar josephholsten commented on August 15, 2024

@tpope honestly, I haven't seen it broken anywhere since I turned it in my personal configs last year. Can you actually reproduce it working badly, or are you relying on memory? If it is still broken for people, I'd love to go fix it.

(Which might not address all possible misconfigured custom vim builds, but what would?)

from vim-sensible.

josephholsten avatar josephholsten commented on August 15, 2024

ah! I honestly don't do that ever. I'm mostly after being able to scroll and select text with the mouse.

Since vim-sensible doesn't :set clipboard= to anything, I think users expect the clipboard to be internal without further effort on their part, and this has been clearly communicated: #145

from vim-sensible.

tpope avatar tpope commented on August 15, 2024

Vim doesn't have an "internal clipboard", it has registers, and I think the incorrect terminology may be clouding your understanding.

When you need to copy something out of a remote Vim and paste it into a different application, how do you do it?

from vim-sensible.

Asheq avatar Asheq commented on August 15, 2024

@josephholsten, I'm not sure you quite understand the ssh scenario. Let's say you open a terminal emulator on your local machine. You ssh into a remote machine and start vim on the remote machine. If you make a visual selection and then use "*y, this will copy the selected text into the system clipboard of the remote machine where vim is running, NOT your local machine where your terminal emulator is running.

If you need to copy into the system clipboard of your local machine, a simple workaround is to select text via the mouse which is handled by your local terminal emulator by default. If you make the remote vim handle it (via mouse=a), this workaround wouldn't work.

We can always set mouse=a in our personal configs (I have this; I also like @tope's mouse=nvi idea), but I don't think we can expect vim-sensible to do it for us since there are many users who have to ssh and do other things where they would prefer having mouse events handled by their terminal emulator.

from vim-sensible.

tpope avatar tpope commented on August 15, 2024

Thanks for that thorough explanation @Asheq!

from vim-sensible.

0matgal0 avatar 0matgal0 commented on August 15, 2024

> Then the local terminal emulator fails to present a "Copy" operation, either for Ctrl-C/Cmd-C or from a menu.

Not even with Shift pressed?

from vim-sensible.

mikelward avatar mikelward commented on August 15, 2024

As well as breaking copy/paste, it also breaks my terminal's right click menu.

from vim-sensible.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.