Reputation: 615
I have put the following code
[
// Open the URL in default browser.
{
"button": "button1", "count": 2,
"press_command": "open_url"
}
]
in the following file ..[mydirectorystructure]..\sublimetext\3.0\Data\Packages\Default.sublime-mousemap
I am using Sublime 3 and the following plugin https://leonid.shevtsov.me/post/clickable-urls-in-sublime-text/
With this setup and code snippet I was expecting URLs (as written in my text file open in Sublime) to open up in my default browser, when I double click on the URL. It is not happening at the moment. There are no errors etc.
Can someone tell me what I am missing here.
Upvotes: 5
Views: 5990
Reputation: 16936
There is no plugin or additional configuration needed anymore.
Sublime Text provides a corresponding option in the context menu when right-clicking a URL.
Upvotes: 4
Reputation: 20644
Install the plugin "Clickable URLs". Then, under Linux, I had to create this file: "~/.config/sublime-text-3/Packages/User/Default (Linux).sublime-mousemap
". Add the following lines to this file:
[
{
"button": "button1",
"count": 2,
"modifiers": ["ctrl"],
"press_command": "drag_select",
"command": "open_url_under_cursor"
}
]
Press Ctrl
and double click on a link to open it in your browser.
Upvotes: 8
Reputation: 615
I am new to Sublime and hence still trying to get my bearings about it. Although I am not sharing "how to configure double click" to open URL, I am sharing how to configure in general.
How to configure any package in Sublime.
There are a couple of things that you want to remember before configuring though. Some keyboard shortcuts and mouse click combinations are, as expected already taken up and sometimes for critical functions. So, don't go about overriding any keyboard combo / mouse click combo lightly. Check what is the default function of that combo.
As for the double click of mouse, I find the default functionality too useful and hence have ultimately decided not to override this.
Here are my final settings.
.../Application Support/Sublime Text 3/Packages/Clickable URLs/Default (OSX).sublime-keymap
[
{ "keys": ["super+option+enter"], "command": "open_url_under_cursor" }
]
Please note that I have had to use "open_url_under_cursor" instead of the default "open_url".
.../Application Support/Sublime Text 3/Packages/User/ClickableUrls.sublime-settings
{
"highlight_urls": false
}
Upvotes: 1