Grab and Open URLs with Vimium

Vimium's yy shortcut makes quick work of grabbing the URL for the current page. I find this useful for linking to an article in my notes or sharing a web page with my team in Slack/Discord. We'll get a glimpse at a couple other features like gi (for "go to input") and o to open the URL on the clipboard.

Get Started with Vimium
Lesson 3 of 9

Get Started with Vimium

Share with a coworker

Transcript

[00:00] A very common workflow for me is that while reading an article on the internet in Chrome, I will be writing up some notes. VS Maybe they're in a gist like this, maybe they're in another text editor like Vim or BS Code, and I'll get to a point where I want to include the URL of the article that I'm reading so that I can have that reference. This is especially handy in a situation where I'm writing markdown because then I can create a link essentially. And Vimium really helps me out with this workflow. So I will hit escape to stop typing into this text area, and then I'll hit shift-K to go over to this article that I'm reading.

[00:39] And now, Vimium offers, we'll hit question mark to view the help, Vimium offers this yy command right here. Now y in vim stands for yank. It's sort of the same thing as copy. So we're going to hit yy and that is going to put the current URL, the URL of the current page onto our system clipboard. And you'll see in the bottom right corner that that appears right as I hit it.

[01:05] It says yanked and then the URL. So now I can hit shift J to go back over to this gist that I'm working on. And now there's another fun feature of Vimium which is to hit GI and that's going to focus the primary text area or the most recently used text area on the page. In this case, there's a couple different text areas on the page, so we're going to see an interesting behavior. I hit GI.

[01:30] Now, the red one is the one that's in focus and we can see the blinking cursor, but I can even tab through to the other ones. But ultimately this is the one that I'm interested in and I've still got that URL on my paste buffer so I'm going to hit Command-V to paste it in. Similarly I might yank the URL of a page I'm reading and then pop over to Discord or Slack or wherever to then paste and share that link with people that I'm working with. It's just a nice way to quickly grab the current URL. So there are two other quick things we can do once we have a URL on our system clipboard.

[02:07] So I'm going to hit shift J to jump over to this one and I'm going to hit YY to yank it. And then I'm going to hit shift K twice to get back over here. Now if I hit lowercase p, that's short for paste, and that's just going to use the current URL and go to that URL in the current tab. So we can see it immediately advances to this Vimium one that I just yanked, and I can hit shift-h to go back. Similarly, if I use shift P, that's going to open the URL that's on my system clipboard in a new tab.

[02:43] So if I've grabbed a URL from somewhere else and I want to open it, that's one way I can do that.