add octave/matlab to org babel

This commit is contained in:
willemml 2023-01-17 16:00:27 -08:00
parent 1366513f51
commit dae8183bf2
Signed by: willemml
GPG key ID: C3DE5DF6198DACBD

232
emacs.nix
View file

@ -535,6 +535,20 @@ in {
after = [ "org" ];
};
ob-matlab = {
enable = true;
after = [ "org" ];
init = ''
; -*-emacs-lisp-*-
(setq org-babel-octave-shell-command "${pkgs.octave}/bin/octave -q")
(setq org-babel-matlab-shell-command "~/Applications/MATLAB_R2022b.app/bin/matlab -nosplash")
'';
extraPackages = [ pkgs.octave ];
};
ob-python = {
enable = true;
extraPackages = [
@ -567,89 +581,91 @@ in {
meow = {
enable = true;
config = ''
init = ''
; -*-emacs-lisp-*-
(defun meow-setup ()
(setq meow-cheatsheet-layout meow-cheatsheet-layout-colemak)
(meow-motion-overwrite-define-key
;; Use e to move up, n to move down.
;; Since special modes usually use n to move down, we only overwrite e here.
'("e" . meow-prev)
'("<escape>" . ignore))
(meow-leader-define-key
'("?" . meow-cheatsheet)
;; To execute the originally e in MOTION state, use SPC e.
'("e" . "H-e")
'("1" . meow-digit-argument)
'("2" . meow-digit-argument)
'("3" . meow-digit-argument)
'("4" . meow-digit-argument)
'("5" . meow-digit-argument)
'("6" . meow-digit-argument)
'("7" . meow-digit-argument)
'("8" . meow-digit-argument)
'("9" . meow-digit-argument)
'("0" . meow-digit-argument))
(meow-normal-define-key
'("0" . meow-expand-0)
'("1" . meow-expand-1)
'("2" . meow-expand-2)
'("3" . meow-expand-3)
'("4" . meow-expand-4)
'("5" . meow-expand-5)
'("6" . meow-expand-6)
'("7" . meow-expand-7)
'("8" . meow-expand-8)
'("9" . meow-expand-9)
'("-" . negative-argument)
'(";" . meow-reverse)
'("," . meow-inner-of-thing)
'("." . meow-bounds-of-thing)
'("[" . meow-beginning-of-thing)
'("]" . meow-end-of-thing)
'("/" . meow-visit)
'("a" . meow-append)
'("A" . meow-open-below)
'("b" . meow-back-word)
'("B" . meow-back-symbol)
'("c" . meow-change)
'("d" . meow-delete)
'("e" . meow-prev)
'("E" . meow-prev-expand)
'("f" . meow-find)
'("g" . meow-cancel-selection)
'("G" . meow-grab)
'("h" . meow-left)
'("H" . meow-left-expand)
'("i" . meow-right)
'("I" . meow-right-expand)
'("j" . meow-join)
'("k" . meow-kill)
'("l" . meow-line)
'("L" . meow-goto-line)
'("m" . meow-mark-word)
'("M" . meow-mark-symbol)
'("n" . meow-next)
'("N" . meow-next-expand)
'("o" . meow-block)
'("O" . meow-to-block)
'("p" . meow-yank)
'("q" . meow-quit)
'("r" . meow-replace)
'("s" . meow-insert)
'("S" . meow-open-above)
'("t" . meow-till)
'("u" . meow-undo)
'("U" . meow-undo-in-selection)
'("v" . meow-search)
'("w" . meow-next-word)
'("W" . meow-next-symbol)
'("x" . meow-delete)
'("X" . meow-backward-delete)
'("y" . meow-save)
'("z" . meow-pop-selection)
'("'" . repeat)
'("<escape>" . ignore)))
(defun meow-setup ()
(setq meow-cheatsheet-layout meow-cheatsheet-layout-colemak)
(meow-motion-overwrite-define-key
;; Use e to move up, n to move down.
;; Since special modes usually use n to move down, we only overwrite e here.
'("e" . meow-prev)
'("<escape>" . ignore))
(meow-leader-define-key
'("?" . meow-cheatsheet)
;; To execute the originally e in MOTION state, use SPC e.
'("e" . "H-e")
'("1" . meow-digit-argument)
'("2" . meow-digit-argument)
'("3" . meow-digit-argument)
'("4" . meow-digit-argument)
'("5" . meow-digit-argument)
'("6" . meow-digit-argument)
'("7" . meow-digit-argument)
'("8" . meow-digit-argument)
'("9" . meow-digit-argument)
'("0" . meow-digit-argument))
(meow-normal-define-key
'("0" . meow-expand-0)
'("1" . meow-expand-1)
'("2" . meow-expand-2)
'("3" . meow-expand-3)
'("4" . meow-expand-4)
'("5" . meow-expand-5)
'("6" . meow-expand-6)
'("7" . meow-expand-7)
'("8" . meow-expand-8)
'("9" . meow-expand-9)
'("-" . negative-argument)
'(";" . meow-reverse)
'("," . meow-inner-of-thing)
'("." . meow-bounds-of-thing)
'("[" . meow-beginning-of-thing)
'("]" . meow-end-of-thing)
'("/" . meow-visit)
'("a" . meow-append)
'("A" . meow-open-below)
'("b" . meow-back-word)
'("B" . meow-back-symbol)
'("c" . meow-change)
'("d" . meow-delete)
'("e" . meow-prev)
'("E" . meow-prev-expand)
'("f" . meow-find)
'("g" . meow-cancel-selection)
'("G" . meow-grab)
'("h" . meow-left)
'("H" . meow-left-expand)
'("i" . meow-right)
'("I" . meow-right-expand)
'("j" . meow-join)
'("k" . meow-kill)
'("l" . meow-line)
'("L" . meow-goto-line)
'("m" . meow-mark-word)
'("M" . meow-mark-symbol)
'("n" . meow-next)
'("N" . meow-next-expand)
'("o" . meow-block)
'("O" . meow-to-block)
'("p" . meow-yank)
'("q" . meow-quit)
'("r" . meow-replace)
'("s" . meow-insert)
'("S" . meow-open-above)
'("t" . meow-till)
'("u" . meow-undo)
'("U" . meow-undo-in-selection)
'("v" . meow-search)
'("w" . meow-next-word)
'("W" . meow-next-symbol)
'("x" . meow-delete)
'("X" . meow-backward-delete)
'("y" . meow-save)
'("z" . meow-pop-selection)
'("'" . repeat)
'("<escape>" . ignore)))
(meow-setup)
'';
};
@ -676,37 +692,19 @@ in {
extraPackages = [ pkgs.pngpaste ];
};
exec-path-from-shell = {
enable = false;
init = ''
; -*-emacs-lisp-*-
(dolist (var '("LANG" "LC_CTYPE" "LC_MESSAGES" "NIX_SSL_CERT_FILE" "NIX_PROFILES" "JAVA_HOME" "GNUPGHOME"))
(add-to-list 'exec-path-from-shell-variables var))
(when (memq window-system '(mac ns x))
(exec-path-from-shell-initialize))
(when (daemonp)
(exec-path-from-shell-initialize))
(add-to-list 'exec-path "/Users/willem/.nix-profile/bin")
'';
};
ivy-bibtex = {
enable = true;
init = ''
; -*-emacs-lisp-*-
;; ivy-bibtex requires ivy's `ivy--regex-ignore-order` regex builder, which
;; ignores the order of regexp tokens when searching for matching candidates.
(setq ivy-re-builders-alist
'((ivy-bibtex . ivy--regex-ignore-order)
(t . ivy--regex-plus)))
;; ivy-bibtex requires ivy's `ivy--regex-ignore-order` regex builder, which
;; ignores the order of regexp tokens when searching for matching candidates.
(setq ivy-re-builders-alist
'((ivy-bibtex . ivy--regex-ignore-order)
(t . ivy--regex-plus)))
(setq ivy-bibtex-bibliography '("~/Documents/org/zotero.bib"))
(setq reftex-default-bibliography '("~/Documents/org/zotero.bib"))
(setq bibtex-completion-pdf-field "file")
(setq ivy-bibtex-bibliography '("~/Documents/org/zotero.bib"))
(setq reftex-default-bibliography '("~/Documents/org/zotero.bib"))
(setq bibtex-completion-pdf-field "file")
'';
};
@ -715,16 +713,16 @@ in {
init = ''
; -*-emacs-lisp-*-
(setq org-ref-insert-cite-function
(lambda ()
(org-cite-insert nil)))
(setq org-ref-insert-cite-function
(lambda ()
(org-cite-insert nil)))
(setq org-ref-default-bibliography "~/Documents/org/zotero.bib")
(setq org-ref-default-bibliography "~/Documents/org/zotero.bib")
(setq bibtex-completion-bibliography '("~/Documents/org/zotero.bib"))
(setq bibtex-completion-bibliography '("~/Documents/org/zotero.bib"))
(require 'org-ref)
(require 'org-ref-ivy)
(require 'org-ref)
(require 'org-ref-ivy)
'';
bindLocal.org-mode-map = { "C-c ]" = "org-ref-insert-link"; };
@ -737,9 +735,9 @@ in {
init = ''
; -*-emacs-lisp-*-
(setq-default pdf-view-display-size 'fit-width)
(setq-default pdf-view-display-size 'fit-width)
(setq pdf-annot-activate-created-annotations t)
(setq pdf-annot-activate-created-annotations t)
'';
extraPackages = [ pkgs.poppler pkgs.automake ];