summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mms-misc.org27
1 files changed, 27 insertions, 0 deletions
diff --git a/mms-misc.org b/mms-misc.org
index beadd85..b94cfd0 100644
--- a/mms-misc.org
+++ b/mms-misc.org
@@ -104,3 +104,30 @@ Of course I want to have it inside Emacs!
(use-package demo-it
:ensure t)
#+end_src
+
+
+* Open links
+
+First, let's be able to run Youtube inside emacs
+#+begin_src emacs-lisp
+ (use-package yeetube)
+#+end_src
+
+Then, let's pass the link to the correct handler.
+
+#+begin_src emacs-lisp
+ (defun mms-open-link-under-point ()
+ (interactive)
+ (setq url (thing-at-point 'url))
+ (cond
+ ((string-match "youtube.com" url) (yeetube-search url))
+ (t (eww url)))
+ )
+#+end_src
+
+And I want to have as =leader - enter - enter=
+
+#+begin_src emacs-lisp
+ (mms-leader-keys
+ "RET RET" '(lambda () (interactive) (mms-open-link-under-point) :wk "follow link"))
+#+end_src