feat(emacs): Hy

This commit is contained in:
Pavel Korytov 2021-05-14 19:52:08 +03:00
parent 20590a0831
commit 3a01bee95c
2 changed files with 21 additions and 6 deletions

View file

@ -976,17 +976,21 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
:straight t
:init
(my-leader-def "ar" 'jupyter-run-repl))
(use-package ob-hy
:straight t)
(org-babel-do-load-languages
'org-babel-load-languages
'((emacs-lisp . t)
(python . t)
;; (typescript .t)
(hy . t)
(shell . t)
(octave . t)
(jupyter . t)))
(add-hook 'org-babel-after-execute-hook 'org-redisplay-inline-images)
(org-babel-jupyter-override-src-block "python")
(org-babel-jupyter-override-src-block "hy")
(add-hook 'org-src-mode-hook
(lambda ()
;; (hs-minor-mode -1)
@ -1072,6 +1076,9 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(interactive)
(jupyter-available-kernelspecs t))
(use-package ob-hy
:straight t)
(setq my/org-view-html-tmp-dir "/tmp/org-html-preview/")
(use-package f
@ -1095,7 +1102,7 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
:straight t
:after (org)
:config
(setq ob-async-no-async-languages-alist '("python" "jupyter-python" "jupyter-octave")))
(setq ob-async-no-async-languages-alist '("python" "hy" "jupyter-python" "jupyter-octave")))
(setq my/jupyter-runtime-folder (expand-file-name "~/.local/share/jupyter/runtime"))

View file

@ -9,10 +9,6 @@ My [[https://www.gnu.org/software/emacs/][Emacs]] configuration.
As with other files in the repo, parts prefixed with (OFF) are not used but kept for historic purposes.
| Note | Type |
|------+------------------------------------|
| TODO | Find a way to specify dependencies |
* Contents
:PROPERTIES:
:TOC: :include all :depth 4
@ -1379,6 +1375,11 @@ Highlight colors
#+end_src
* Dired
Dired is a built-in file manager. I use it as my primary file manager, hence the top level of config.
| Type | Note |
|------+------------------------|
| TODO | Make subdirs mode work |
** Basic config & keybindings
My config mostly follows ranger's and vifm's keybindings which I'm used to.
@ -1732,6 +1733,11 @@ Kernelspecs by default are hashed, so even switching Anaconda environments doesn
(interactive)
(jupyter-available-kernelspecs t))
#+end_src
*** Hy
#+begin_src emacs-lisp :noweb-ref org-lang-setup
(use-package ob-hy
:straight t)
#+end_src
*** View HTML in browser
Open HTML in the ~begin_export~ block with xdg-open.
@ -1763,6 +1769,7 @@ Enable languages
'((emacs-lisp . t)
(python . t)
;; (typescript .t)
(hy . t)
(shell . t)
(octave . t)
(jupyter . t)))
@ -1773,6 +1780,7 @@ Enable languages
Use Jupyter block instead of built-in Python.
#+begin_src emacs-lisp :tangle no :noweb-ref org-lang-setup
(org-babel-jupyter-override-src-block "python")
(org-babel-jupyter-override-src-block "hy")
#+end_src
Turn of some minor modes in source blocks.
@ -1791,7 +1799,7 @@ Async code blocks evaluations. Jupyter blocks have a built-in async, so they are
:straight t
:after (org)
:config
(setq ob-async-no-async-languages-alist '("python" "jupyter-python" "jupyter-octave")))
(setq ob-async-no-async-languages-alist '("python" "hy" "jupyter-python" "jupyter-octave")))
#+end_src
*** Managing Jupyter kernels
Functions for managing local Jupyter kernels.