What I often have to do is to copy something from my editor to the browser and vice versa. But this seems not so easy in some editors. I feel I have to add that I’m on wayland under hyprland.

In some Editors it’s super easy like GNOME Text Editor or nano, you mark some code in the text editor with the mouse and then in the browser you press the middle click on the mouse where you want to paste it, done. You could do it with ctrl-c and ctrl-v but with the mouse only it’s just so much faster. And it works both ways browser <–> editor

But in VSCodium I can do that from editor -> browser, but I can’t do it from browser -> editor, I have no idea why.

In neovim it’s the opposite I can do it from browser -> editor, but I can’t do it from editor -> browser.

Any ideas what is going on?

  • @Tempy@programming.dev
    link
    fedilink
    English
    8
    edit-2
    2 days ago

    The simplest and slowest way when you need to use something from the system clipboard:

    Copying: Enter visual mode (v) Highlight the text I want to copy then enter in command mode "+y which basically means “Use a register for following command (”) make it the external clipboard register (+) and yank/copy (y)"

    Pasting Move to where I want to paste then enter in command mode "+p to paste after the current position or "+P to paste before the current position

    If I don’t need to copy/paste stuff to applications outside of vim, then I can skip the "+ register setting part, and just use the default internal register.

    • @e8d79@discuss.tchncs.de
      link
      fedilink
      52 days ago

      You can also add set clipboard=unnamed to your .vimrc. This makes it so that all yank and paste operations use the system clipboard, but I find it gets in the way more often than it helps.

      • Coelacanthus
        link
        fedilink
        216 hours ago

        In most cases, yank in Vim just need somewhere to store contents temporarily, not share it with others.