follow link on internet with vim

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

follow link on internet with vim

Mathieu
Hello,

Is it possible to follow a link with vim? for exemple, if my cursor is
on https://fr.wikipedia.org/wiki/Vim
i want to use my browser to go to this website.

By the same way, i can open a file with "gf" if my cursor is on the
file's name. But i don't know how to follow a link.

Best regards,
Mathieu

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/9cebd5cd46943be33c48f0fbd40c22daac4d40be.camel%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: follow link on internet with vim

Ruben Safir
On 7/9/19 8:56 AM, Mathieu Roux wrote:

> Hello,
>
> Is it possible to follow a link with vim? for exemple, if my cursor is
> on https://fr.wikipedia.org/wiki/Vim
> i want to use my browser to go to this website.
>
> By the same way, i can open a file with "gf" if my cursor is on the
> file's name. But i don't know how to follow a link.
>
> Best regards,
> Mathieu
>


ph please don't add a browser to VIM


--
So many immigrant groups have swept through our town
that Brooklyn, like Atlantis, reaches mythological
proportions in the mind of the world - RI Safir 1998
http://www.mrbrklyn.com

DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002
http://www.nylxs.com - Leadership Development in Free Software
http://www2.mrbrklyn.com/resources - Unpublished Archive
http://www.coinhangout.com - coins!
http://www.brooklyn-living.com

Being so tracked is for FARM ANIMALS and and extermination camps,
but incompatible with living as a free human being. -RI Safir 2013

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/ed762500-946f-1b2a-6bb2-be1c0a0a168b%40my.liu.edu.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: follow link on internet with vim

Tony Mechelynck
In reply to this post by Mathieu
On Tue, Jul 9, 2019 at 2:56 PM Mathieu Roux <[hidden email]> wrote:

>
> Hello,
>
> Is it possible to follow a link with vim? for exemple, if my cursor is
> on https://fr.wikipedia.org/wiki/Vim
> i want to use my browser to go to this website.
>
> By the same way, i can open a file with "gf" if my cursor is on the
> file's name. But i don't know how to follow a link.
>
> Best regards,
> Mathieu

I don't know if it is possible, but I know where to find the answer:

    :help netrw


Best regards,
Tony.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAJkCKXsbhzJ_C7sHmJy0p_GM8k-jTo4B1nGbwhfNGVLO6_0-nQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: follow link on internet with vim

Suresh Govindachar`
In reply to this post by Mathieu
On 7/9/2019 5:56 AM, Mathieu Roux wrote:
>
> Is it possible to follow a link with vim? for exemple, if my cursor is
> on https://fr.wikipedia.org/wiki/Vim
> i want to use my browser to go to this website.
>
> By the same way, i can open a file with "gf" if my cursor is on the
> file's name. But i don't know how to follow a link.
>

On Windows, when the following lines are in vimrc, the stuff below the
cursor can be opened with the default browser by hitting "\x" (below,
the "essential" characters that come after noremap need to be in the
same line):

   "eXecute string below cursor
   nnoremap \x   :silent !start rundll32 url.dll,FileProtocolHandler <cWORD>
   " eXecute string below cursor after prepending it with path to file
   nnoremap \xp  :silent !start rundll32 url.dll,FileProtocolHandler
%:p:h/<cWORD>

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/099ec4e6-8f95-9000-56d0-b51e52922b6e%40yahoo.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: follow link on internet with vim

Bill Hudacek-3
In reply to this post by Mathieu
Mathieu Roux wrote on 07/09/2019 08:56 AM:

> Hello,
>
> Is it possible to follow a link with vim? for exemple, if my cursor is
> on https://fr.wikipedia.org/wiki/Vim
> i want to use my browser to go to this website.
>
> By the same way, i can open a file with "gf" if my cursor is on the
> file's name. But i don't know how to follow a link.
>
> Best regards,
> Mathieu
>
In Linux, I use this - mapped to Alt-Z- I put it in one my my vim
startup files. This command sequence may not work if you try to do it
interactively (but you can play with it to find out what does work):

map ú mzlB"lyE:!o <16><12>l &<CR>;

Explained:

ú        is alt-z- Enter this using control-V, then Alt-Z if you use
same shortcut key as I do...(I avoid multi-key entry for stuff I use
most often)

mz           set mark 'z' for later return

l            move one char to right if possible
B            move cursor backward one big-word (to start of URL)

"lyE         capture big-word into register 'L'

:!xdg-open   go to Ex: command line, use xdg-open to process the
following arg(s)...

<16><12> In your chosen vimrc/other startup file, type control-V,
control-R

l & This inserts register L contents (which you will insert using
Control-R above)

The ampersand is important! In my linuxboxes (ubuntu, fedora, RHEL)
the command will not work without it. I do not know why.

Hope this helps.

--

Kind Regards,

Bill Hudacek
Master Certified IT Architect

All opinions are my own, of course.


--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/cafaeb2c-d52f-7253-5367-524af66aae87%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: follow link on internet with vim

Enno
In reply to this post by Tony Mechelynck
Le mardi 9 juillet 2019 10:32:52 UTC-3, Tony Mechelynck a écrit :

> On Tue, Jul 9, 2019 at 2:56 PM Mathieu Roux wrote:
> >
> > Hello,
> >
> > Is it possible to follow a link with vim? for exemple, if my cursor is
> > on https://fr.wikipedia.org/wiki/Vim
> > i want to use my browser to go to this website.
> >
> > By the same way, i can open a file with "gf" if my cursor is on the
> > file's name. But i don't know how to follow a link.
> >
> > Best regards,
> > Mathieu
>
> I don't know if it is possible, but I know where to find the answer:
>
>     :help netrw
>
>
> Best regards,
> Tony.
Thus, if elinks is installed, then typing `gf` will open the link as text in Vim.
Typing `gx` will open it with the program attached to links in the OS. On Linux, if one does not use Gnome or KDE desktop environment, then adding

let g:netrw_browsex_viewer = "xdg-open"

to the vimrc seems necessary.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/b222574e-477e-446a-b8b7-8382f94dfaa9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: follow link on internet with vim

Pete Doherty
On Tuesday, July 9, 2019 at 11:09:16 AM UTC-4, Enno wrote:

> Le mardi 9 juillet 2019 10:32:52 UTC-3, Tony Mechelynck a écrit :
> > On Tue, Jul 9, 2019 at 2:56 PM Mathieu Roux wrote:
> > >
> > > Hello,
> > >
> > > Is it possible to follow a link with vim? for exemple, if my cursor is
> > > on https://fr.wikipedia.org/wiki/Vim
> > > i want to use my browser to go to this website.
> > >
> > > By the same way, i can open a file with "gf" if my cursor is on the
> > > file's name. But i don't know how to follow a link.
> > >
> > > Best regards,
> > > Mathieu
> >
> > I don't know if it is possible, but I know where to find the answer:
> >
> >     :help netrw
> >
> >
> > Best regards,
> > Tony.
>
> Thus, if elinks is installed, then typing `gf` will open the link as text in Vim.
> Typing `gx` will open it with the program attached to links in the OS. On Linux, if one does not use Gnome or KDE desktop environment, then adding
>
> let g:netrw_browsex_viewer = "xdg-open"
>
> to the vimrc seems necessary.
Both `gf` and `gx` worked for me as described using Debian/i3 (without having to set `g:netrw_browsex_viewer`).

Thanks for sharing this simple solution, Enno!

PRD

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/ff2d8365-73a3-49fe-a6fc-3c2bb5225afa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: follow link on internet with vim

Ruben Safir
In reply to this post by Enno
On 7/9/19 11:09 AM, Enno wrote:

> Le mardi 9 juillet 2019 10:32:52 UTC-3, Tony Mechelynck a écrit :
>> On Tue, Jul 9, 2019 at 2:56 PM Mathieu Roux wrote:
>>>
>>> Hello,
>>>
>>> Is it possible to follow a link with vim? for exemple, if my cursor is
>>> on https://fr.wikipedia.org/wiki/Vim
>>> i want to use my browser to go to this website.
>>>
>>> By the same way, i can open a file with "gf" if my cursor is on the
>>> file's name. But i don't know how to follow a link.
>>>
>>> Best regards,
>>> Mathieu
>>
>> I don't know if it is possible, but I know where to find the answer:
>>
>>     :help netrw
>>
>>
>> Best regards,
>> Tony.
>
> Thus, if elinks is installed, then typing `gf` will open the link as text in Vim.
> Typing `gx` will open it with the program attached to links in the OS. On Linux, if one does not use Gnome or KDE desktop environment, then adding
>
> let g:netrw_browsex_viewer = "xdg-open"
>
> to the vimrc seems necessary.
>


this is stupid.  Use a WP

--
So many immigrant groups have swept through our town
that Brooklyn, like Atlantis, reaches mythological
proportions in the mind of the world - RI Safir 1998
http://www.mrbrklyn.com

DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002
http://www.nylxs.com - Leadership Development in Free Software
http://www2.mrbrklyn.com/resources - Unpublished Archive
http://www.coinhangout.com - coins!
http://www.brooklyn-living.com

Being so tracked is for FARM ANIMALS and and extermination camps,
but incompatible with living as a free human being. -RI Safir 2013

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/ec415ab4-1930-1e6a-2c42-6edbf15fc731%40my.liu.edu.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: follow link on internet with vim

Mathieu
In reply to this post by Pete Doherty
Thanks everybody for your answers.

In fact, without doing anything, gx works on my laptop!


On mar., 2019-07-09 at 08:21 -0700, Pete Doherty wrote:

> On Tuesday, July 9, 2019 at 11:09:16 AM UTC-4, Enno wrote:
> > Le mardi 9 juillet 2019 10:32:52 UTC-3, Tony Mechelynck a écrit :
> > > On Tue, Jul 9, 2019 at 2:56 PM Mathieu Roux wrote:
> > > >
> > > > Hello,
> > > >
> > > > Is it possible to follow a link with vim? for exemple, if my
> > > > cursor is
> > > > on https://fr.wikipedia.org/wiki/Vim
> > > > i want to use my browser to go to this website.
> > > >
> > > > By the same way, i can open a file with "gf" if my cursor is on
> > > > the
> > > > file's name. But i don't know how to follow a link.
> > > >
> > > > Best regards,
> > > > Mathieu
> > >
> > > I don't know if it is possible, but I know where to find the
> > > answer:
> > >
> > >     :help netrw
> > >
> > >
> > > Best regards,
> > > Tony.
> >
> > Thus, if elinks is installed, then typing `gf` will open the link
> > as text in Vim.
> > Typing `gx` will open it with the program attached to links in the
> > OS. On Linux, if one does not use Gnome or KDE desktop environment,
> > then adding
> >
> > let g:netrw_browsex_viewer = "xdg-open"
> >
> > to the vimrc seems necessary.
>
> Both `gf` and `gx` worked for me as described using Debian/i3
> (without having to set `g:netrw_browsex_viewer`).
>
> Thanks for sharing this simple solution, Enno!
>
> PRD
>
> --

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/b3373669e398abf6b320150eb4ed48a9da3a1fce.camel%40gmail.com.
For more options, visit https://groups.google.com/d/optout.