diff options
author | mms <michal@sapka.me> | 2024-02-21 13:38:59 +0100 |
---|---|---|
committer | mms <michal@sapka.me> | 2024-02-21 13:39:18 +0100 |
commit | effb74469883db79ec4052fed9915358b9cce65c (patch) | |
tree | c7ef7bdfd727ba675b4479c3685e9b7ff6a2b8d6 /mms-misc.org | |
parent | f9e045dd758811721a5197902f439e98c7fb664f (diff) |
feat: follow links
Diffstat (limited to 'mms-misc.org')
-rw-r--r-- | mms-misc.org | 27 |
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 |