Doom-emacs: how do i copy url quickly?

Created on 4 Feb 2020  Â·  5Comments  Â·  Source: hlissner/doom-emacs

i 'm beginner .
i have a question, i want to copy a url under point,
and i know something about textobjecs, we can copy a word by yiw.
Is there anyway to copy or select an url use yiu

:editor evil new question resolved

Most helpful comment

In 1575300 I added a u text object. iu selects the url without the protocol (https://) and querystring (?a=1&b=2). au selects the whole url.

All 5 comments

Assuming there's space or blank on both sides, yiW should grab it.

If it's surrounded by quotes, then yi" or yi' should get you what you want.

If it's jammed up against another symbol, and it's not surrounded by said symbol, then you're probably stuck going to the beginning of the url, going into visual mode, and then traveling to the end of the URL.

Which can be done pretty quickly with f/F, and E.
Get to the first character, and then E to the end.

@CodyW,Thank you very much.

In 1575300 I added a u text object. iu selects the url without the protocol (https://) and querystring (?a=1&b=2). au selects the whole url.

You're a god Henrik.

I should also mention, gf will open urls at point in your browser.

Was this page helpful?
0 / 5 - 0 ratings