summaryrefslogtreecommitdiff
path: root/emacs-init.org
diff options
context:
space:
mode:
authorfpi2020-04-05 13:23:39 +0200
committerfpi2020-04-05 13:34:58 +0200
commitd9bafb8ab143142122b149e170f5c508b3c4e642 (patch)
tree9cd71a9e05674aa2baa3368b66b8d926cb465bc9 /emacs-init.org
parentNot mark beginning of footnotes section (diff)
Add call for org-src-block lang specific hydras
Diffstat (limited to 'emacs-init.org')
-rw-r--r--emacs-init.org11
1 files changed, 10 insertions, 1 deletions
diff --git a/emacs-init.org b/emacs-init.org
index 4ed8801..dfb1aec 100644
--- a/emacs-init.org
+++ b/emacs-init.org
@@ -3209,11 +3209,19 @@ _q_ quit
("c" org-table-toggle-coordinate-overlays :color blue)
("q" nil :color blue))
+(defun fpi/org-babel-src-mode-hydra ()
+ "Launch a hydra specific to the src language of the current
+ babel code block if defined."
+ (interactive)
+ (let* ((elem (org-element-context))
+ (lang (plist-get (cadr elem) :language)))
+ (pcase lang
+ ("bibtex" (org-ref-bibtex-hydra/body)))))
(defhydra hydra-babel-helper (:color pink :hint nil)
"
org babel src block helper functions
_n_ next _i_ info _I_ insert header
-_p_ prev _c_ check
+_p_ prev _c_ check _m_ ode hydra
_h_ goto head _E_ expand
^ ^ _s_ split
_q_ quit _r_ remove result _e_ examplify region
@@ -3229,6 +3237,7 @@ _q_ quit _r_ remove result _e_ examplify region
("e" org-babel-examplify-region :color blue)
("r" org-babel-remove-result :color blue)
("h" org-babel-goto-src-block-head)
+ ("m" fpi/org-babel-src-mode-hydra :color blue)
("q" nil :color blue))