Re: [gedit-list] Extend gedit to open URLs in default browser



Here's what I did to get a very basic version working. (I could use some help making it work a little better.)

1. selected the external tools plugin in gedit
2. Defined a new tool with these values:
To use it, select the URL and type the shortcut key. It opens the link in a new tab in the default browser (firefox for me).

Now, how the heck can I make it more intelligent so I don't have to select the URL manually? In Cream (based on Vim), I can simply place the cursor anywhere in the text of the URL and it will expand the selection correctly (using regex) and open the URL in the default browser.
 
I would think it would be easy to modify the "Open URI Context Menu" gedit plugin to do this for http/https URIs, but I'm not familiar enough with the plugins to do it myself. See
http://wiki.sukimashita.com/GEdit_Plugins


On Feb 7, 2008 8:29 AM, Doug McNutt <douglist macnauchtan com> wrote:
At 17:13 -0500 2/6/08, Dave (My-IOP) wrote:
>I see others have asked for a URL Launcher to allow detection and launching in default browser of URLs within document (<http://live.gnome.org/Gedit/Plugins>http://live.gnome.org/Gedit/Plugins).
>
>I would like to have gedit work so that when the cursor is anywhere in a url (such as <http://www.ubuntuforums.org/>www.ubuntuforums.org, either beginning with "http://" or just "www.") it can select that full URL automatically, pass the URL to the default browser, and if the browser is already open, open the URL in a new tab.
>
>(It would also be great if the functionality to open local documents the same way existed too.)

Have a look at the xdg-open command line tool, man xdg-open. I'm just getting used to gedit and I find it easier to copy and paste things like

xdg-open http://something/somewhere.html

from a gedit file into tcsh but there are some extensions to gedit - tools - that intend to execute such commands in a temporary instance of a shell. I haven't  made them work yet and it's likely that there are problems with environment variables.

I'm coming from Apple's MPW and BBEdit where one has editable worksheets of type TEXT from which shell commands can be selected and executed directly with the ENTER key. They then stay around for use again weeks later. Shell output appears below the executed command. Yeah I am studying the gedit source code with that in mind.

xdg-open needs a -a option to select an application including a different browser with which to open the designated file.

--

--> From the U S of A, the only socialist country that refuses to admit it. <--
_______________________________________________
gedit-list mailing list
gedit-list gnome org
http://mail.gnome.org/mailman/listinfo/gedit-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]