lang/org: add +babel.el
This commit is contained in:
parent
3f6de74ebb
commit
85a6c6e3b6
2 changed files with 43 additions and 39 deletions
42
modules/lang/org/+babel.el
Normal file
42
modules/lang/org/+babel.el
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
;;; lang/org/+babel.el
|
||||||
|
|
||||||
|
(add-hook '+org-init-hook '+org|init-babel t)
|
||||||
|
|
||||||
|
(defun +org|init-babel ()
|
||||||
|
(setq org-confirm-babel-evaluate nil ; you don't need my permission
|
||||||
|
org-src-fontify-natively t ; make code pretty
|
||||||
|
org-src-preserve-indentation t
|
||||||
|
org-src-tab-acts-natively t
|
||||||
|
org-src-window-setup 'current-window
|
||||||
|
org-edit-src-content-indentation 0)
|
||||||
|
|
||||||
|
(org-babel-do-load-languages
|
||||||
|
'org-babel-load-languages
|
||||||
|
(mapcar (lambda (sym) (cons sym t))
|
||||||
|
'(calc
|
||||||
|
css
|
||||||
|
emacs-lisp
|
||||||
|
haskell
|
||||||
|
js
|
||||||
|
latex
|
||||||
|
ledger
|
||||||
|
lilypond
|
||||||
|
lisp
|
||||||
|
matlab
|
||||||
|
plantuml
|
||||||
|
python
|
||||||
|
restclient
|
||||||
|
ruby
|
||||||
|
rust
|
||||||
|
sh
|
||||||
|
sqlite
|
||||||
|
sql-mode
|
||||||
|
translate
|
||||||
|
)))
|
||||||
|
|
||||||
|
;; I prefer C-c C-c for confirming over the default C-c '
|
||||||
|
(map! :map org-src-mode-map "C-c C-c" 'org-edit-src-exit)
|
||||||
|
;; I know the keybindings, no need for the header line
|
||||||
|
(defun +org|src-mode-remove-header ()
|
||||||
|
(when header-line-format (setq header-line-format nil)))
|
||||||
|
(add-hook 'org-src-mode-hook '+org|src-mode-remove-header))
|
|
@ -38,6 +38,7 @@
|
||||||
(load! +capture)
|
(load! +capture)
|
||||||
(load! +export)
|
(load! +export)
|
||||||
(load! +notebook)
|
(load! +notebook)
|
||||||
|
(load! +babel)
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
@ -136,14 +137,6 @@
|
||||||
(sequence "IDEA(i)" "NEXT(n)" "ACTIVE(a)" "WAITING(w)" "LATER(l)" "|" "CANCELLED(c)"))
|
(sequence "IDEA(i)" "NEXT(n)" "ACTIVE(a)" "WAITING(w)" "LATER(l)" "|" "CANCELLED(c)"))
|
||||||
|
|
||||||
|
|
||||||
;; Babel
|
|
||||||
org-confirm-babel-evaluate nil ; you don't need my permission
|
|
||||||
org-src-fontify-natively t ; make code pretty
|
|
||||||
org-src-preserve-indentation t
|
|
||||||
org-src-tab-acts-natively t
|
|
||||||
org-src-window-setup 'current-window
|
|
||||||
org-edit-src-content-indentation 0
|
|
||||||
|
|
||||||
;; Latex
|
;; Latex
|
||||||
org-format-latex-options
|
org-format-latex-options
|
||||||
(plist-put org-format-latex-options :scale 1.5)
|
(plist-put org-format-latex-options :scale 1.5)
|
||||||
|
@ -164,37 +157,6 @@
|
||||||
;; ("" "physics" t) TODO Install this)
|
;; ("" "physics" t) TODO Install this)
|
||||||
)
|
)
|
||||||
|
|
||||||
(org-babel-do-load-languages
|
|
||||||
'org-babel-load-languages
|
|
||||||
(mapcar (lambda (sym) (cons sym t))
|
|
||||||
'(calc
|
|
||||||
css
|
|
||||||
emacs-lisp
|
|
||||||
haskell
|
|
||||||
js
|
|
||||||
latex
|
|
||||||
ledger
|
|
||||||
lilypond
|
|
||||||
lisp
|
|
||||||
matlab
|
|
||||||
plantuml
|
|
||||||
python
|
|
||||||
restclient
|
|
||||||
ruby
|
|
||||||
;; rust
|
|
||||||
sh
|
|
||||||
sqlite
|
|
||||||
sql-mode
|
|
||||||
translate
|
|
||||||
)))
|
|
||||||
|
|
||||||
;; I prefer C-c C-c for confirming over the default C-c '
|
|
||||||
(map! :map org-src-mode-map "C-c C-c" 'org-edit-src-exit)
|
|
||||||
;; I know the keybindings, no need for the header line
|
|
||||||
(defun +org|src-mode-remove-header ()
|
|
||||||
(when header-line-format (setq header-line-format nil)))
|
|
||||||
(add-hook 'org-src-mode-hook '+org|src-mode-remove-header)
|
|
||||||
|
|
||||||
(let ((ext-regexp (regexp-opt '("GIF" "JPG" "JPEG" "SVG" "TIF" "TIFF" "BMP" "XPM"
|
(let ((ext-regexp (regexp-opt '("GIF" "JPG" "JPEG" "SVG" "TIF" "TIFF" "BMP" "XPM"
|
||||||
"gif" "jpg" "jpeg" "svg" "tif" "tiff" "bmp" "xpm"))))
|
"gif" "jpg" "jpeg" "svg" "tif" "tiff" "bmp" "xpm"))))
|
||||||
(setq iimage-mode-image-regex-alist
|
(setq iimage-mode-image-regex-alist
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue