jeromejj / vim

Automatically exported from code.google.com/p/vim
0 stars 0 forks source link

gx won't launch urls contained in parentheses #190

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In markdown documents where a url is formatted as [foo](http://www.foo.com) gx 
will not launch the url contained in the parentheses.

Original issue reported on code.google.com by roundroc...@gmail.com on 30 Dec 2013 at 4:19

GoogleCodeExporter commented 9 years ago
For clarity, this isn't specific to markdown as I've encountered this issue in 
non-markdown files as well. 

Original comment by wilmo...@moorefamily.ws on 14 Jun 2014 at 7:52

GoogleCodeExporter commented 9 years ago
Please try v153j of netrw; it includes a visual map version of gx which will 
let you put whatever text you want gx's way.

Original comment by drc...@campbellfamily.biz on 15 Jun 2014 at 12:52

GoogleCodeExporter commented 9 years ago
The other URL notation in Markdown <http://www.foo.com> does not work either.

Original comment by stoorband on 3 Oct 2014 at 3:19

GoogleCodeExporter commented 9 years ago
This bug should not be too difficult to solve given the fact that URI/URL 
detection works with both
[foo](http://www.foo.com) and <http://www.foo.com> for the gf command.

I suggest reusing the URI/URL detection code of the gf command for the gx 
command and all should be fine.

Original comment by stoorband on 7 Oct 2014 at 9:22

GoogleCodeExporter commented 9 years ago
Please try v153s of netrw 
(http://www.drchip.org/astronaut/vim/index.html#NETRW).

gf is a built-in command, part of vim; gx is provided by netrw; code re-use is 
not possible.  Netrw provides a visual map version of gx which will allow you 
to include whatever you want in the url.  Furthermore, you may use the 
g:netrw_gx variable to specify what expand() will use to grab the url (by 
default it is now "<cfile>"); other useful choices: "<cword>", "<cWORD>".

Original comment by drc...@campbellfamily.biz on 7 Oct 2014 at 1:52

GoogleCodeExporter commented 9 years ago
I ran into this issue too, and solved it by creating my own SmartOpen and 
mapping gx to it:  
https://github.com/drmikehenry/vimfiles/blob/9b987c0349c9b1739242369d3e2cd62deac
fd28c/vimrc#L2423

Original comment by jszakmei...@gmail.com on 7 Oct 2014 at 2:28

GoogleCodeExporter commented 9 years ago
If someone could add it to Vim markdown, that would be awesome: 
https://github.com/plasticboy/vim-markdown/issues/99

Original comment by ciro.san...@gmail.com on 22 Feb 2015 at 8:59