mirror of
https://github.com/willemml/dotfiles.nix.git
synced 2025-04-13 19:57:19 +00:00
emacs mla/apa formatting, start on citations, remove org-roam
This commit is contained in:
parent
6eb110370b
commit
131b727a1e
1 changed files with 91 additions and 58 deletions
63
emacs.nix
63
emacs.nix
|
@ -13,6 +13,7 @@ in {
|
|||
usePackageVerbose = false;
|
||||
|
||||
earlyInit = ''
|
||||
; -*-emacs-lisp-*-
|
||||
;; Disable Toolbar
|
||||
(tool-bar-mode -1)
|
||||
;; Disable scrollbar
|
||||
|
@ -35,6 +36,7 @@ in {
|
|||
(setq warning-minimum-level 'error)
|
||||
'';
|
||||
prelude = ''
|
||||
; -*-emacs-lisp-*-
|
||||
;; Disable startup message.
|
||||
(setq inhibit-startup-screen t
|
||||
inhibit-startup-echo-area-message (user-login-name))
|
||||
|
@ -311,6 +313,7 @@ in {
|
|||
lsp-java = {
|
||||
enable = true;
|
||||
init = ''
|
||||
; -*-emacs-lisp-*-
|
||||
(setq lsp-java-format-settings-url
|
||||
"https://raw.githubusercontent.com/google/styleguide/gh-pages/eclipse-java-google-style.xml")
|
||||
(setq lsp-java-format-settings-profile
|
||||
|
@ -359,6 +362,7 @@ in {
|
|||
org = {
|
||||
enable = true;
|
||||
extraConfig = ''
|
||||
; -*-emacs-lisp-*-
|
||||
:preface
|
||||
(defun my/indent-org-block-automatically ()
|
||||
"Indent the current org code block."
|
||||
|
@ -390,9 +394,13 @@ in {
|
|||
(my/org-force-open-current-window)))
|
||||
'';
|
||||
init = ''
|
||||
; -*-emacs-lisp-*-
|
||||
(defvar my/org-dir "~/Documents/org/")
|
||||
|
||||
(require 'oc)
|
||||
(require 'oc-basic)
|
||||
(require 'oc-csl)
|
||||
(require 'oc-natbib)
|
||||
|
||||
(setq org-src-window-setup 'current-window)
|
||||
(setq org-confirm-babel-evaluate nil)
|
||||
|
@ -423,6 +431,10 @@ in {
|
|||
|
||||
(setq bibtex-completion-notes-path (expand-file-name "notes.org" my/org-dir))
|
||||
|
||||
(setq org-cite-global-bibliography '("~/Documents/org/zotero.bib"))
|
||||
|
||||
(setq org-cite-export-processors '((t basic)))
|
||||
|
||||
(setq org-cite-follow-processor 'ivy-bibtex-org-cite-follow)
|
||||
|
||||
(setq bibtex-completion-pdf-open-function
|
||||
|
@ -435,6 +447,13 @@ in {
|
|||
depth)))
|
||||
(setq org-export-latex-format-toc-function 'org-export-latex-no-toc)
|
||||
|
||||
(setq org-latex-pdf-process
|
||||
'("latexmk -pdflatex='pdflatex -interaction nonstopmode' -pdf -bibtex -f %f"))
|
||||
|
||||
(add-to-list 'exec-path "/Users/willem/.nix-profile/bin")
|
||||
|
||||
(require 'ox-latex)
|
||||
|
||||
(add-to-list 'org-latex-classes
|
||||
'("apa6"
|
||||
"\\documentclass{apa6}"
|
||||
|
@ -444,12 +463,20 @@ in {
|
|||
("\\paragraph{%s}" . "\\paragraph*{%s}")
|
||||
("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
|
||||
|
||||
(setq org-latex-pdf-process
|
||||
'("latexmk -pdflatex='pdflatex -interaction nonstopmode' -pdf -bibtex -f %f"))
|
||||
(add-to-list 'org-latex-classes
|
||||
'("mla"
|
||||
"\\documentclass{mla}"
|
||||
("\\section{%s}" . "\\section*{%s}")
|
||||
("\\subsection{%s}" . "\\subsection*{%s}")
|
||||
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
|
||||
("\\paragraph{%s}" . "\\paragraph*{%s}")
|
||||
("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
|
||||
|
||||
(add-to-list 'exec-path "/Users/willem/.nix-profile/bin")
|
||||
'';
|
||||
hook = [ "(org-babel-after-execute . org-redisplay-inline-images)" ];
|
||||
hook = [
|
||||
"(org-babel-after-execute . org-redisplay-inline-images)"
|
||||
"(org-mode . visual-line-mode)"
|
||||
];
|
||||
|
||||
bind = {
|
||||
"C-c n c" = "org-id-get-create";
|
||||
|
@ -513,6 +540,7 @@ in {
|
|||
];
|
||||
after = [ "org" ];
|
||||
config = ''
|
||||
; -*-emacs-lisp-*-
|
||||
(setq org-babel-python-command "${pkgs.python310}/bin/python3.10")
|
||||
(setq-default python-indent-guess-indent-offset-verbose nil)
|
||||
(defun my/org-babel-execute:python-session (body params)
|
||||
|
@ -527,6 +555,7 @@ in {
|
|||
enable = true;
|
||||
extraPackages = [ pkgs.sqlite ];
|
||||
config = ''
|
||||
; -*-emacs-lisp-*-
|
||||
(setq calibredb-root-dir "~/Documents/calibre-library")
|
||||
(setq calibredb-db-dir (expand-file-name "metadata.db" calibredb-root-dir))
|
||||
(setq calibredb-library-alist '(("~/Documents/calibre-library")))
|
||||
|
@ -537,6 +566,7 @@ in {
|
|||
meow = {
|
||||
enable = true;
|
||||
config = ''
|
||||
; -*-emacs-lisp-*-
|
||||
(defun meow-setup ()
|
||||
(setq meow-cheatsheet-layout meow-cheatsheet-layout-colemak)
|
||||
(meow-motion-overwrite-define-key
|
||||
|
@ -624,6 +654,7 @@ in {
|
|||
separedit = {
|
||||
enable = true;
|
||||
bind = { "C-c '" = "separedit"; };
|
||||
hook = [ "(separedit-buffer-creation . normal-mode)" ];
|
||||
};
|
||||
|
||||
editorconfig = {
|
||||
|
@ -647,6 +678,7 @@ in {
|
|||
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))
|
||||
|
||||
|
@ -660,11 +692,10 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
ivy-bibtext = {
|
||||
ivy-bibtex = {
|
||||
enable = true;
|
||||
init = ''
|
||||
(autoload 'ivy-bibtex "ivy-bibtex" "" t)
|
||||
|
||||
; -*-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
|
||||
|
@ -675,33 +706,35 @@ in {
|
|||
(setq reftex-default-bibliography '("~/Documents/org/zotero.bib"))
|
||||
(setq bibtex-completion-pdf-field "file")
|
||||
'';
|
||||
|
||||
hook = [
|
||||
''(Tex . (lambda () (define-key Tex-mode-map "C-ch" 'ivy-bibtex)))''
|
||||
];
|
||||
};
|
||||
|
||||
org-ref = {
|
||||
enable = true;
|
||||
|
||||
init = ''
|
||||
; -*-emacs-lisp-*-
|
||||
(setq org-ref-insert-cite-function
|
||||
(lambda ()
|
||||
(org-cite-insert nil)))
|
||||
|
||||
(setq org-ref-default-bibliography "~/Documents/org/zotero.bib")
|
||||
|
||||
(setq bibtex-completion-bibliography '("~/Documents/org/zotero.bib"))
|
||||
|
||||
(require 'org-ref)
|
||||
(require 'org-ref-ivy)
|
||||
'';
|
||||
|
||||
bindLocal.org-mode-map = { "C-c ]" = "org-ref-insert-link"; };
|
||||
};
|
||||
|
||||
pdf-tools = {
|
||||
enable = true;
|
||||
|
||||
init = ''
|
||||
(pdf-tools-install)
|
||||
|
||||
; -*-emacs-lisp-*-
|
||||
(setq-default pdf-view-display-size 'fit-width)
|
||||
|
||||
(define-key pdf-view-mode-map (kbd "C-s") 'isearch-forward)
|
||||
|
||||
(setq pdf-annot-activate-created-annotations t)
|
||||
'';
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue