Search code examples
vimcopyyank

What is the Vim command to copy content from a file (opened in Vim editor) and paste in Firefox browser address bar?


I'm trying to copy a text (link) from my file (opened in vim), go to FF browser and paste the copied text in address bar. How should I do that without touching Mouse?

I am using Ubuntu OS and vim editor

Steps:

  • Open a file using vim
    vim temp.txt

  • copy a text line from temp.txt
    say the file has text www.google.com
    I'm using command v(for visual mode), shift+$ (to select the line) and y (to yank)

  • paste on Firefox browser address bar so that I can visit google.com

but not working (not able to paste).

Please help me with the command ?

Thank you


Solution

  • Turning my comment into an answer:

    "+ is the register that refers to the system clip board, this works for Linux as well as Windows (this is what I was able to test). You can copy to it with the "+y key strokes, given that you've previously selected something. To copy the whole line you're on, you can use "+yy (used as an example, you might have to google other cordes). You can then switch to firefox, with alt + tab for example, and then select the address bar using Ctrl+L, and paste using your system's paste shortcut, most likely Ctrl+V.