I'm using Twitvim for the first time. Seeing all the URLs in there made me wonder, is there any way to open the URL under the cursor in your favorite browser or a specified one?
Join Stack Overflow to learn, share knowledge, and build your career.
|
|
Updated: from tpope's tweet today Press Original answer: Don't remember where I get this function. There is a bug with hash (#) in the url, but the function works well enough that I won't bother fixing it.
Note: If you are not on the Mac, use |
|||||||||||||||||||||
|
|
If you are using Vim 7.4 or later, in normal mode, put your cursor below the URL, then click |
|||||||||||||||||||||
|
|
I use this script to search gooogle for
You should use |
|||||
|
|
Ok so using the answers from @tungd and @kev and a little research I ended up with this script, which works just the way I need to. Like @tungd said the # can give a problem if inside a url but I'm cool with that, if anyone has a better expression for the url then it will be welcomed.
|
|||
|
|
|
I'm pretty late to this party, but here's another way of doing this that works especially well on Windows 7.
To use this mapping, type your Leader key from normal mode + u. It should read the line under your cursor and open it in your default browser. |
|||
|
|
|
Add following line to .vimrc file:
So in normal mode it pressing \ it selects current word and open it as address in web browser. Leader by default is \ (but I've mapped it to , with |
|||
|
|
|
You should take a quick look to this vim plugin It's basically what has been explained in some other responses, but specific configuration needed if you use a plugin manager :) |
|||
|
|
