When I edit my tools' configuration files I usually put in them the website from where I stole that nifty trick, months later I can remember why I did something that way.
Opening an URL from a text editor usually involves this steps:
- Select the URL
- Copy the URL
- Switch to the browser
- Paste the URL and hit enter
Emacs has the Browse-URL package, it allows us to open URLs we encounter in a browser. To do this put the following snippet of code in your
;; Set the default browser command (setq browse-url-browser-function 'browse-url-generic browse-url-generic-program "open") ;; Set a keybind (global-set-key (kbd "C-c C-o") 'browse-url)
You can read more about
open on the man page.
Now you can open an URL with
C-c C-o, if the cursor is hover something that resemble an URL that URL is used as default.