Compare commits

..

1 Commits

Author SHA1 Message Date
0f948c5399 Add org-ref integation to biblio module 2021-07-04 01:33:50 +02:00
17 changed files with 298 additions and 269 deletions

View File

@@ -1,6 +0,0 @@
;;; +keybindings.el -*- lexical-binding: t; -*-
;; Custom keybindings
;;
;; Keybindings for next/previous buffer
(map! :n "C-c j" #'previous-buffer)
(map! :n "C-c k" #'next-buffer)

74
+org.el
View File

@@ -1,14 +1,24 @@
;;; ~/.doom.d/+org.el -*- lexical-binding: t; -*- ;;; ~/.doom.d/+org.el -*- lexical-binding: t; -*-
;; Org mode configuration ;; Org mode configuration
;; ;;
(setq org-ellipsis "") (setq org-ellipsis ""
org-superstar-headline-bullets-list '(""))
;; Cycle through header visibility ;; Cycle through header visibility
(after! evil-org (after! evil-org
(remove-hook 'org-tab-first-hook #'+org-cycle-only-current-subtree-h)) (remove-hook 'org-tab-first-hook #'+org-cycle-only-current-subtree-h))
;; Disable completion ;; Disable completion
(set-company-backend! 'org-mode nil) (set-company-backend! 'org-mode nil)
;; Turn off line numbers ;; Turn off line numbers
(add-hook! 'org-mode-hook (display-line-numbers-mode -1)) (add-hook 'org-mode-hook (lambda () (display-line-numbers-mode -1)))
;; Add Notes to agenda
(setq org-agenda-files '("~/Notes"))
;; Tailor Org super agenda
(use-package! org-super-agenda
:after org-agenda
:init
(setq org-super-agenda-groups '((:auto-category t)))
:config
(org-super-agenda-mode))
;; Add timestamp to DONE task ;; Add timestamp to DONE task
(setq org-log-done 'time) (setq org-log-done 'time)
;; Print babel results to the buffer and export them ;; Print babel results to the buffer and export them
@@ -16,8 +26,7 @@
(:cache . "no") (:noweb . "no") (:hlines . "no") (:tangle . "no")) (:cache . "no") (:noweb . "no") (:hlines . "no") (:tangle . "no"))
org-babel-default-lob-header-args '((:exports . "both"))) org-babel-default-lob-header-args '((:exports . "both")))
;; Enter writeroom-mode in all org files ;; Enter writeroom-mode in all org files
(add-hook! 'org-mode-hook 'global-writeroom-mode) (add-hook 'org-mode-hook 'global-writeroom-mode)
(add-hook! 'org-mode-hook 'visual-line-mode)
;; Respect LANGUAGE export variable ;; Respect LANGUAGE export variable
(add-to-list 'org-latex-packages-alist '("AUTO" "babel" t ("pdflatex"))) (add-to-list 'org-latex-packages-alist '("AUTO" "babel" t ("pdflatex")))
;; Don't evaluate code blocks on export ;; Don't evaluate code blocks on export
@@ -25,7 +34,7 @@
;; Speed up agenda startup ;; Speed up agenda startup
(setq org-agenda-dim-blocked-tasks nil) (setq org-agenda-dim-blocked-tasks nil)
;; Open file with folded headlines ;; Open file with folded headlines
(setq org-startup-folded t) (setq org-startup-folded 'content)
;; Add tufte-handout to LaTeX classes ;; Add tufte-handout to LaTeX classes
(after! ox-latex (after! ox-latex
(add-to-list 'org-latex-classes (add-to-list 'org-latex-classes
@@ -47,54 +56,13 @@
("\\subsubsection{%s}" . "\\subsubsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}")))) ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))))
;; Prettify code block export ;; Enable listings for LaTeX export
(use-package! engrave-faces-latex (setq org-latex-listings 't)
:after ox-latex) ;; Set up bibliography management
(setq org-latex-src-block-backend 'engraved) (setq! +biblio-pdf-library-dir "~/Documents/Uni/TFG/bibliography/"
;; Add citeproc and metadata-file options to ox-pandoc +biblio-default-bibliography-files '("~/Documents/Uni/TFG/assets/bibliography.bib"))
(after! ox-pandoc ;; Add citeproc and metadata-file options to ox-latex
(add-to-list 'org-pandoc-valid-options 'citeproc) (add-to-list 'org-pandoc-valid-options 'citeproc)
(add-to-list 'org-pandoc-valid-options 'metadata-file)) (add-to-list 'org-pandoc-valid-options 'metadata-file)
;; Allow referencing by label in org-ref ;; Allow referencing by label in org-ref
(setq org-latex-prefer-user-labels t) (setq org-latex-prefer-user-labels t)
;; Extend pomodoro length to 45/15
(setq org-pomodoro-length '45
org-pomodoro-short-break-length '15
org-pomodoro-long-break-length '30
org-pomodoro-time-format "%.2m min"
org-pomodoro-keep-killed-pomodoro-time t)
;; Save org-download images to an assets directory
(after! org-download
(setq org-download-image-dir "assets/"
org-attach-auto-tag nil))
;; Show images by default with a limited width
(setq org-startup-with-inline-images t
org-image-actual-width 600)
;; Use a modern look
(use-package! org-modern
:hook (org-mode . org-modern-mode)
:config
(setq org-modern-star [""]))
(add-hook! 'org-agenda-finalize-hook #'org-modern-agenda)
;; Configure a better split and some default for org-noter
(after! org-noter
(setq org-noter-always-create-frame nil
org-noter-doc-split-fraction '(0.7 . 0.3)
org-noter-default-heading-title " "
org-noter-separate-notes-from-heading nil))
;; Show latex preview automatically and increase its size
(setq org-startup-with-latex-preview t
org-format-latex-options (plist-put org-format-latex-options :scale 3.0))
;; Close tags automatically
(after! smartparens
(sp-with-modes 'org-mode
(sp-local-pair "*" "*")
(sp-local-pair "_" "_")
(sp-local-pair "/" "/")
(sp-local-pair "~" "~")
(sp-local-pair "$" "$")))
;; Show raw latex when the cursor on the expression
(add-hook! 'org-mode-hook 'org-fragtog-mode)
;; HACK Fix search folded sections
(setq org-fold-core-style 'overlays)
(evil-select-search-module 'evil-search-module 'evil-search)

58
+ui.el
View File

@@ -2,41 +2,37 @@
;; Appearance settings ;; Appearance settings
;; Set Font and theme ;; Set Font and theme
(setq doom-font (font-spec :family "Iosevka Medium" :size 26) (setq doom-font (font-spec :family "Iosevka Medium" :size 26)
doom-theme 'doom-one) doom-theme 'doom-nord)
;; Display Magit status in fullscreen
(after! magit
(setq magit-display-buffer-function #'magit-display-buffer-fullframe-status-v1))
;; Match pdf-tools colors to the theme
(after! pdf-tools
(setq pdf-view-midnight-colors '("#ECEFF4" . "#2E3440"))
(add-hook 'pdf-tools-enabled-hook 'pdf-view-midnight-minor-mode))
;; Customize modeline ;; Customize modeline
(setq doom-modeline-buffer-encoding nil) (setq doom-modeline-major-mode-icon t
doom-modeline-persp-name t
doom-modeline-buffer-encoding nil)
;; Hide direnv environment variables popup
(setq direnv-always-show-summary nil)
;; Change splash-screen banner ;; Change splash-screen banner
(setq fancy-splash-image "~/.doom.d/assets/emacs.svg") (setq fancy-splash-image "~/.doom.d/assets/emacs.svg")
;; Disable LSP documentation popup
(after! lsp-ui
(setq lsp-ui-doc-enable nil
lsp-signature-auto-activate nil
lsp-enable-symbol-highlighting nil
lsp-ui-sideline-show-code-actions nil
lsp-modeline-code-actions-enable nil))
;; Shrink minibuffer ;; Shrink minibuffer
(after! vertico (after! ivy
(setq vertico-count 8)) (setq ivy-height 10))
;; Eliminate gaps between windows ;; Eliminate gaps between windows
(after! frame (after! frame
(remove-hook 'doom-init-ui-hook #'window-divider-mode)) (remove-hook 'doom-init-ui-hook #'window-divider-mode))
;; Show matching parenthesis on the minibuffer ;; Disable lsp header line
(after! smartparens (show-smartparens-global-mode t)) (after! lsp-mode
;; Modify the splash screen actions (setq lsp-headerline-breadcrumb-enable nil))
(setq +doom-dashboard-menu-sections ;; Shrink terminal buffer
'(("Reload last session" (set-popup-rule! "^\\*vterm" :size 0.1 :vslot -4 :select t :quit nil :ttl 0)
:icon (nerd-icons-octicon "nf-oct-history" :face 'doom-dashboard-menu-title)
:when (cond ((modulep! :ui workspaces)
(file-exists-p (expand-file-name persp-auto-save-fname persp-save-dir)))
((require 'desktop nil t)
(file-exists-p (desktop-full-file-name))))
:face (:inherit (doom-dashboard-menu-title bold))
:action doom/quickload-session)
("Open org-agenda"
:icon (nerd-icons-octicon "nf-oct-calendar" :face 'doom-dashboard-menu-title)
:when (fboundp 'org-agenda)
:action org-agenda)
("Recently opened files"
:icon (nerd-icons-faicon "nf-fa-file_text" :face 'doom-dashboard-menu-title)
:action recentf-open-files)))
;; Restore previous session without confirmation
(defadvice! restore-no-confirm-session-quickload-a ()
:override #'doom/quickload-session
(message "Restoring session...")
(doom-load-session)
(message "Session restored. Welcome back."))
;; Decrease size of icons in the modeline
(setq nerd-icons-scale-factor 1.0)

View File

@@ -4,58 +4,58 @@
;; ;;
;; Load appearance configuration ;; Load appearance configuration
(load! "+ui") (load! "+ui")
;; Load custom keybindings ;; Set projects directories
(load! "+keybindings") (setq projectile-project-search-path '("~/Projects" "~/Documents/Work" "~/Documents/Typesetting"))
;; Auto cleanup recentf ; Auto cleanup recentf
(setq recentf-auto-cleanup 300) (setq recentf-auto-cleanup 300)
;; Save backup files to ~/.cache and autosave files to ~/.cache/emacs ; Save backup files to ~/.cache and autosave files to ~/.cache/emacs
(setq backup-directory-alist `(("." . "~/.cache")) (setq backup-directory-alist `(("." . "~/.cache"))
auto-save-list-file-prefix (concat "~/.cache")) auto-save-list-file-prefix
(concat "~/.cache/emacs"))
;; Set Magit repositories
(setq magit-repository-directories '(("~/Projects" . 3)
("~/.dotfiles" . 0)
("~/.doom.d" . 0)))
;; Load org configuration ;; Load org configuration
(after! org (load! "+org")) (after! org (load! "+org"))
;; Disable completion and line numbers in Markdown ;; Enter writeroom and disable completion and line numbers in Markdown
(add-hook! 'markdown-mode-hook (display-line-numbers-mode -1)) (add-hook 'markdown-mode-hook (lambda () (display-line-numbers-mode -1)))
(after! markdown (after! markdown
(set-company-backend! 'markdown-mode nil)) (set-company-backend! 'markdown-mode nil)
;; Enable writeroom-mode for text modes (add-hook 'markdown-mode-hook 'global-writeroom-mode))
(setq writeroom-major-modes '(org-mode markdown-mode)
+zen-text-scale 1.5)
(add-hook! 'markdown-mode-hook 'global-writeroom-mode)
;; Reload file from disk without confirmation ;; Reload file from disk without confirmation
(defun revert-buffer-no-confirm () (defun revert-buffer-no-confirm ()
(interactive) (interactive)
(revert-buffer :ignore-auto :noconfirm)) (revert-buffer :ignore-auto :noconfirm))
;; Select target in Makefile compilation as default
(map! :leader :n "c c" #'makefile-executor-execute-project-target)
;; Align columns in CSV mode ;; Align columns in CSV mode
(add-hook! 'csv-mode-hook 'csv-align-mode) (add-hook 'csv-mode-hook 'csv-align-mode)
(add-hook! 'csv-mode-hook 'csv-header-line)
;; Close compilation buffer if successful ;; Close compilation buffer if successful
(defun close-compilation-buffer-if-successful (buffer string) (setq compilation-finish-functions
"Bury a compilation buffer if succeeded without warnings " (lambda (buf str)
(when (and (eq major-mode 'compilation-mode) (if (null (string-match ".*exited abnormally.*" str))
(string-match "finished" string) (progn
(not (run-at-time
(with-current-buffer buffer "0.5 sec" nil 'delete-windows-on
(search-forward "warning" nil t)))) (get-buffer-create "*compilation*"))
(run-with-timer 1 nil (message "No Compilation Errors!")))))
(lambda (buf) ;; Enable writeroom for text modes
(let ((window (get-buffer-window buf))) (setq writeroom-major-modes '(markdown-mode org-mode))
(when (and (window-live-p window)
(eq buf (window-buffer window)))
(delete-window window))))
buffer)))
(add-hook 'compilation-finish-functions #'close-compilation-buffer-if-successful)
;; Map leader key for major mode to , ;; Map leader key for major mode to ,
(setq evil-snipe-override-evil-repeat-keys nil)
(setq doom-localleader-key ",") (setq doom-localleader-key ",")
;; Show matching parenthesis on the minibuffer
(after! smartparens (show-smartparens-global-mode t))
;; Disable company mode in Nix
(setq-hook! 'nix-mode-hook company-idle-delay nil)
;; Trigger flycheck after save ;; Trigger flycheck after save
(setq flycheck-check-syntax-automatically '(save)) (setq flycheck-check-syntax-automatically '(save))
;; Use relative line numbers (Usage: number <j/k>) ;; Ignore development databases folders
(setq display-line-numbers-type 'relative) (after! lsp-mode
;; Set indentation level to 2 (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]\\.mysql\\'")
(setq tab-width 2) (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]\\.pgdata\\'"))
;; Move buffer while maintaining cursor centered ;; Ignore empty files
(use-package! centered-cursor-mode (after! projectile
:config (add-to-list 'projectile-globally-ignored-files ".gitkeep"))
(global-centered-cursor-mode)) ;; Set org-mode as the default
;; Restore previous session on startup (setq-default major-mode 'org-mode)
(add-hook 'window-setup-hook #'doom/quickload-session)

122
init.el
View File

@@ -11,29 +11,27 @@
(doom! :input (doom! :input
;;chinese ;;chinese
;;japanese ;;japanese
;layout ; auie,ctsrnm is the superior home row
:completion :completion
(company + tng) ; the ultimate code completion backend (company + tng) ; the ultimate code completion backend
;;helm ; the *other* search engine for love and life ;;helm ; the *other* search engine for love and life
;;ido ; the other *other* search engine... ;;ido ; the other *other* search engine...
;;(ivy ; a search engine for love and life (ivy ; a search engine for love and life
;;+fuzzy ; fuzzy search is a millenial thing +fuzzy ; fuzzy search is a millenial thing
;;+icons) ; prettify the small thingss +icons) ; prettify the small thingss
(vertico +icons) ; The search engine of the future
:ui :ui
;;deft ; notational velocity for Emacs ;;deft ; notational velocity for Emacs
doom ; what makes DOOM look the way it does doom ; what makes DOOM look the way it does
doom-dashboard ; a nifty splash screen for Emacs doom-dashboard ; a nifty splash screen for Emacs
doom-quit ; DOOM quit-message prompts when you quit Emacs doom-quit ; DOOM quit-message prompts when you quit Emacs
;;fill-column ; a `fill-column' indicator
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
;;hydra ;;hydra
;;indent-guides ; highlighted indent columns ;;indent-guides ; highlighted indent columns
(ligatures (ligatures
+extra +extra
+iosevka) ; ligatures and symbols to make your code pretty again +iosevka) ; ligatures and symbols to make your code pretty again
;;minimap ; show a map of the code on the side
modeline ; snazzy, Atom-inspired modeline, plus API modeline ; snazzy, Atom-inspired modeline, plus API
nav-flash ; blink the current line after jumping nav-flash ; blink the current line after jumping
;;neotree ; a project drawer, like NERDTree for vim ;;neotree ; a project drawer, like NERDTree for vim
@@ -44,7 +42,7 @@
;;tabs ; an tab bar for Emacs ;;tabs ; an tab bar for Emacs
;;treemacs ; a project drawer, like neotree but cooler ;;treemacs ; a project drawer, like neotree but cooler
;;unicode ; extended unicode support for various languages ;;unicode ; extended unicode support for various languages
;;vc-gutter ; vcs diff in the fringe vc-gutter ; vcs diff in the fringe
vi-tilde-fringe ; fringe tildes to mark beyond EOB vi-tilde-fringe ; fringe tildes to mark beyond EOB
window-select ; visually switch windows window-select ; visually switch windows
workspaces ; tab emulation, persistence & separate workspaces workspaces ; tab emulation, persistence & separate workspaces
@@ -68,135 +66,123 @@
dired ; making dired pretty [functional] dired ; making dired pretty [functional]
electric ; smarter, keyword-based electric-indent electric ; smarter, keyword-based electric-indent
;;ibuffer ; interactive buffer management ;;ibuffer ; interactive buffer management
;;vc ; version-control and Emacs, sitting in a tree vc ; version-control and Emacs, sitting in a tree
:term :term
;;eshell ; the elisp shell that works everywhere ;;eshell ; a consistent, cross-platform shell (WIP)
;;shell ; simple shell REPL for Emacs ;;shell ; a terminal REPL for Emacs
;;term ; basic terminal emulator for Emacs ;;term ; terminals in Emacs
;;vterm ; the best terminal emulation in Emacs vterm ; another terminals in Emacs
:checkers :checkers
syntax ; tasing you for every semicolon you forget syntax ; tasing you for every semicolon you forget
;;(spell +flyspell) ; tasing you for misspelling mispelling ;;spell ; tasing you for misspelling mispelling
;;grammar ; tasing grammar mistake every you make ;;grammar ; tasing grammar mistake every you make
:tools :tools
;;ansible ;;ansible
;; biblio ; Writes a PhD for you (citation needed) biblio ; Writes a PhD for you[citation needed]
;; debugger ; FIXME stepping through code, to help you add bugs debugger ; FIXME stepping through code, to help you add bugs
;; direnv direnv
;;docker ;;docker
;;editorconfig ; let someone else argue about tabs vs spaces ;;editorconfig ; let someone else argue about tabs vs spaces
;;ein ; tame Jupyter notebooks with emacs ;;ein ; tame Jupyter notebooks with emacs
;;(eval +overlay) ; run code, run (also, repls) (eval +overlay) ; run code, run (also, repls)
;;gist ; interacting with github gists ;;gist ; interacting with github gists
lookup ; navigate your code and its documentation lookup ; helps you navigate your code and documentation
;;+docsets) ; ...or in Dash docsets locally ;;+docsets) ; ...or in Dash docsets locally
;;lsp ; M-x vscode lsp
;;macos ; MacOS-specific commands ;;macos ; MacOS-specific commands
;;magit ; a git porcelain for Emacs magit ; a git porcelain for Emacs
;;make ; run make tasks from Emacs make ; run make tasks from Emacs
;;pass ; password manager for nerds ;;pass ; password manager for nerds
;;pdf ; pdf enhancements pdf ; pdf enhancements
;;prodigy ; FIXME managing external services & code builders ;;prodigy ; FIXME managing external services & code builders
;;rgb ; creating color strings ;;rgb ; creating color strings
;;terraform ; infrastructure as code ;;terraform ; infrastructure as code
;;tmux ; an API for interacting with tmux ;;tmux ; an API for interacting with tmux
;;tree-sitter ; syntax and parsing, sitting in a tree... upload ; map local to remote projects via ssh/ftp
;;upload ; map local to remote projects via ssh/ftp
:lang :lang
;;agda ; types of types of types of types... ;;agda ; types of types of types of types...
;;assembly ; assembly for fun or debugging ;;assembly ; assembly for fun or debugging
;;beancount ; mind the GAAP (cc +lsp) ; C/C++/Obj-C madness
;;(cc +lsp
;; +tree-sitter) ; C > C++ == 1
;;clojure ; java with a lisp ;;clojure ; java with a lisp
;;common-lisp ; if you've seen one lisp, you've seen them all ;;common-lisp ; if you've seen one lisp, you've seen them all
;;coq ; proofs-as-programs ;;coq ; proofs-as-programs
;;crystal ; ruby at the speed of c ;;crystal ; ruby at the speed of c
;;csharp ; unity, .NET, and mono shenanigans ;;csharp ; unity, .NET, and mono shenanigans
data ; config/data formats data ; config/data formats
;;(dart +flutter) ; paint ui and not much else ;;(dart
;;dhall ;;+flutter
;;+lsp) ; paint ui and not much else
;;elixir ; erlang done right ;;elixir ; erlang done right
;;elm ; care for a cup of TEA? ;;elm ; care for a cup of TEA?
emacs-lisp ; drown in parentheses emacs-lisp ; drown in parentheses
;;erlang ; an elegant language for a more civilized age ;;erlang ; an elegant language for a more civilized age
;;(ess +lsp) ; emacs speaks statistics (ess +lsp) ; emacs speaks statistics
;;faust ; dsp, but you get to keep your soul ;;faust ; dsp, but you get to keep your soul
;;fortran ; in FORTRAN, GOD is REAL (unless declared INTEGER)
;;fsharp ; ML stands for Microsoft's Language ;;fsharp ; ML stands for Microsoft's Language
;;fstar ; (dependent) types and (monadic) effects and Z3 (go +lsp) ; the hipster dialect
;;gdscript ; the language you waited for ;;(haskell +dante) ; a language that's lazier than I am
;;(go +lsp
;; +tree-sitter) ; the hipster dialect
;;(graphql +lsp) ; Give queries a REST
;;(haskell +lsp) ; a language that's lazier than I am
;;hy ; readability of scheme w/ speed of python ;;hy ; readability of scheme w/ speed of python
;;idris ; a language you can depend on ;;idris ;
;;(json +tree-sitter) ; At least it ain't XML json ; At least it ain't XML
;;(java +lsp (java +lsp) ; the poster child for carpal tunnel syndrome
;;+tree-sitter) ; the poster child for carpal tunnel syndrome
;;(javascript +lsp) ; all(hope(abandon(ye(who(enter(here)))))) ;;(javascript +lsp) ; all(hope(abandon(ye(who(enter(here))))))
;;julia ; a better, faster MATLAB ;;julia ; a better, faster MATLAB
;;kotlin ; a better, slicker Java(Script) ;;kotlin ; a better, slicker Java(Script)
;;(latex +lsp) ; writing papers in Emacs has never been so fun latex ; writing papers in Emacs has never been so fun
;;lean ; for folks with too much to prove ;;lean
;;factor
;;ledger ; an accounting system in Emacs ;;ledger ; an accounting system in Emacs
;;lua ; one-based indices? one-based indices ;;lua ; one-based indices? one-based indices
markdown ; writing docs for people to ignore markdown ; writing docs for people to ignore
;;nim ; python + lisp at the speed of c ;;nim ; python + lisp at the speed of c
;;(nix +tree-sitter); I hereby declare "nix geht mehr!" nix ; I hereby declare "nix geht mehr!"
;;ocaml ; an objective camel ;;ocaml ; an objective camel
(org ; organize your plain life in plain text (org ; organize your plain life in plain text
+dragndrop ; drag & drop files/images into org buffers +dragndrop ; drag & drop files/images into org buffers
;;+hugo ; use Emacs for hugo blogging ;;+hugo ; use Emacs for hugo blogging
;;+jupyter ; jupyter support for babel ;;+ipython ; ipython/jupyter support for babel
+noter
+pandoc ; export-with-pandoc support +pandoc ; export-with-pandoc support
+pomodoro ; be fruitful with the tomato technique ;;+pomodoro ; be fruitful with the tomato technique
+present) ; using org-mode for presentations +present ; using org-mode for presentations
;;+pretty) +pretty
+ref)
;;perl ; write code no one else can comprehend
;;php ; perl's insecure younger brother ;;php ; perl's insecure younger brother
;;plantuml ; diagrams for confusing people more ;;plantuml ; diagrams for confusing people more
;;purescript ; javascript, but functional ;;purescript ; javascript, but functional
;;(python +lsp ; beautiful is better than ugly (python +lsp ; beautiful is better than ugly
;;+pyright +pyright
;;+poetry +poetry)
;;+tree-sitter)
;;qt ; the 'cutest' gui framework ever ;;qt ; the 'cutest' gui framework ever
;;racket ; a DSL for DSLs ;;racket ; a DSL for DSLs
;;raku ; the artist formerly known as perl6 rest ; Emacs as a REST client
;;rest ; Emacs as a REST client
;;rst ; ReST in peace ;;rst ; ReST in peace
;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} ;;ruby ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"}
;;rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap() ;;rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
;;scala ; java, but good ;;scala ; java, but good
;;scheme ; a fully conniving family of lisps ;;scheme ; a fully conniving family of lisps
;;(sh +tree-sitter) ; she sells {ba,z,fi}sh shells on the C xor sh ; she sells {ba,z,fi}sh shells on the C xor
;;sml
;;solidity ; do you need a blockchain? No. ;;solidity ; do you need a blockchain? No.
;;swift ; who asked for emoji variables? ;;swift ; who asked for emoji variables?
;;terra ; Earth and Moon in alignment for performance. ;;terra ; Earth and Moon in alignment for performance.
;;(web +tree-sitter); the tubes web ; the tubes
;;yaml ; JSON, but readable yaml ; JSON, but readable
;;zig ; C, but simpler
:email :email
;;(mu4e +org +gmail) ;;(mu4e +gmail)
;;notmuch ;;notmuch
;;(wanderlust +gmail) ;;(wanderlust +gmail)
:app :app
;;calendar ;;calendar
;;emms
;;everywhere ; *leave* Emacs!? You must be joking
;;irc ; how neckbeards socialize ;;irc ; how neckbeards socialize
;;rss ; emacs as an RSS reader ;;(rss +org) ; emacs as an RSS reader
;;twitter ; twitter client https://twitter.com/vnought ;;twitter ; twitter client https://twitter.com/vnought
;;write ; emacs for writers (fiction, notes, papers, etc.)
:config :config
;;literate ;;literate
@@ -206,7 +192,9 @@
;; If you edit it by hand, you could mess it up, so be careful. ;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance. ;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right. ;; If there is more than one, they won't work right.
) '(org-agenda-files
(quote
("~/Sync/Notes/Personal.org" "~/Sync/Notes/Education.org" "~/Sync/Projects/Titank/Organization.org" "~/Sync/Notes/Uni.org" "~/Sync/Notes/Projects.org"))))
(custom-set-faces (custom-set-faces
;; custom-set-faces was added by Custom. ;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful. ;; If you edit it by hand, you could mess it up, so be careful.

116
modules/biblio/config.el Normal file
View File

@@ -0,0 +1,116 @@
;;; tools/biblio/config.el -*- lexical-binding: t; -*-
;; Internal function to set the various paths used in the
;; reference packages.
(defun +biblio-set-paths-fn (&optional symbol value)
(when symbol
(set-default symbol value))
(when value
(cond ((eq symbol '+biblio-pdf-library-dir)
(when (featurep! :lang org)
(setq org-ref-pdf-directory value))
(setq bibtex-completion-library-path value))
((eq symbol '+biblio-default-bibliography-files)
(when (featurep! :lang org)
(setq reftex-default-bibliography value
org-ref-default-bibliography value))
(setq bibtex-completion-bibliography value))
((eq symbol '+biblio-notes-path)
(when (featurep! :lang org)
(if (directory-name-p value)
(setq org-ref-notes-directory value)
(setq org-ref-bibliography-notes value)))
(setq bibtex-completion-notes-path value)))))
(defcustom +biblio-pdf-library-dir nil
"Directory where pdf files are stored. Must end with a slash."
:type 'string
:set #'+biblio-set-paths-fn)
(defcustom +biblio-default-bibliography-files nil
"A list of default bibtex files to use."
:type '(repeat :tag "List of bibtex files" file)
:set #'+biblio-set-paths-fn)
(defcustom +biblio-notes-path nil
"The place where you will store your notes for bibliography files.
This can be either a single file or directory of files.
In case of directory the path must end with a slash."
:type 'string
:set #'+biblio-set-paths-fn)
(use-package! bibtex-completion
:defer t
:preface
;; Allow the user to set a template of their own via (setq). if the user does
;; not set one fall back to the +biblio variants which have a reasonable
;; fallback.
(defvar bibtex-completion-notes-template-multiple-files nil)
:config
(when (featurep! :completion ivy)
(add-to-list 'ivy-re-builders-alist '(ivy-bibtex . ivy--regex-plus)))
(setq bibtex-completion-additional-search-fields '(keywords)
;; This tell bibtex-completion to look at the File field of the bibtex
;; to figure out which pdf to open
bibtex-completion-pdf-field "file")
(unless bibtex-completion-notes-template-multiple-files
(setq bibtex-completion-notes-template-multiple-files
"${title} : (${=key=})
- tags ::
- keywords :: ${keywords}
\n* ${title}\n :PROPERTIES:\n :Custom_ID: ${=key=}\n :URL: ${url}\n :AUTHOR: ${author-or-editor}\n :NOTER_DOCUMENT: /${file}\n :NOTER_PAGE: \n :END:\n\n")))
;; TODO which set of keys that should be bound for commonly used functions
;; see https://github.com/jkitchin/org-ref/blob/master/org-ref-core.el#L3998
(use-package! org-ref
:when (featurep! :lang org +ref)
:after org
:preface
;; This need to be set before the package is loaded, because org-ref will
;; automatically `require' an associated package during its loading.
(setq org-ref-completion-library (cond ((featurep! :completion ivy) #'org-ref-ivy-cite)
((featurep! :completion helm) #'org-ref-helm-bibtex)
(t #'org-ref-reftex)))
:config
;; Although the name is helm-bibtex, it is actually a bibtex-completion function
;; it is the legacy naming of the project helm-bibtex that causes confusion.
(setq org-ref-open-pdf-function 'org-ref-get-pdf-filename-helm-bibtex)
;; orb will define handlers for note taking so not needed to use the
;; ones set for bibtex-completion
(unless (featurep! :lang org +roam)
;; Allow org-ref to use the same template mechanism as {helm,ivy}-bibtex for
;; multiple files if the user has chosen to spread their notes.
(setq org-ref-notes-function (if (and org-ref-notes-directory (directory-name-p org-ref-notes-directory))
#'org-ref-notes-function-many-files
#'org-ref-notes-function-one-file))))
(use-package! org-roam-bibtex
:when (featurep! :lang org +roam)
:preface
;; if the user has not set a template mechanism set a reasonable one of them
;; The package already tests for nil itself so we define a dummy tester
(defvar orb-preformat-keywords
'("=key=" "title" "url" "file" "author-or-editor" "keywords"))
(defvar orb-templates nil)
:hook (org-roam-mode . org-roam-bibtex-mode)
:config
(unless orb-templates
(setq orb-templates
'(("r" "ref" plain (function org-roam-capture--get-point)
""
:file-name "${slug}"
:head "#+TITLE: ${=key=}: ${title}\n#+roam_key: ${ref}\n#+roam_tags: lit
- tags ::
- keywords :: ${keywords}
\n* ${title}\n :PROPERTIES:\n :Custom_ID: ${=key=}\n :URL: ${url}\n :AUTHOR: ${author-or-editor}\n :NOTER_DOCUMENT: %(orb-process-file-field \"${=key=}\")\n :NOTER_PAGE: \n :END:\n\n"
:unnarrowed t)))))

View File

@@ -0,0 +1,12 @@
;; -*- no-byte-compile: t; -*-
;;; tools/biblio/packages.el
(package! bibtex-completion :pin "9f6ea920a49457d85096caa0e61f086a42b2908e")
(when (featurep! :completion ivy)
(package! ivy-bibtex :pin "9f6ea920a49457d85096caa0e61f086a42b2908e"))
(when (featurep! :completion helm)
(package! helm-bibtex :pin "9f6ea920a49457d85096caa0e61f086a42b2908e"))
(when (featurep! :lang org +ref)
(package! org-ref :pin "8aa2bb45268f660956151547533689d4ec30378d"))
(when (featurep! :lang org +roam)
(package! org-roam-bibtex :pin "f7b5be2ce0b43dd4d842484fc0ec37fdc8526907"))

View File

@@ -5,13 +5,4 @@
;; (package! some-package) ;; (package! some-package)
;; (package! another-package :recipe (:host github :repo "username/repo")) ;; (package! another-package :recipe (:host github :repo "username/repo"))
;; (package! builtin-package :disable t) ;; (package! builtin-package :disable t)
;; Prettier LaTeX source blocks (package! org-super-agenda)
(package! engrave-faces)
;; Prettier org mode
(package! org-modern)
;; Enable LaTeX previews automatically
(package! org-fragtog)
;; Light theme
(package! os1-theme :recipe (:host github :repo "sashimacs/os1-theme"))
;; Move buffer while maintaining cursor centered
(package! centered-cursor-mode)

View File

@@ -5,6 +5,7 @@
#+TITLE: $0 #+TITLE: $0
#+SUBTITLE: #+SUBTITLE:
#+AUTHOR: Amin Kasrou Aouam #+AUTHOR: Amin Kasrou Aouam
#+LANGUAGE: es
#+OPTIONS: toc:nil #+OPTIONS: toc:nil
#+LATEX_CLASS: org-plain-latex #+LATEX_CLASS: org-plain-latex
#+LATEX_CLASS_OPTIONS: [a4paper] #+LATEX_CLASS_OPTIONS: [a4paper]

View File

@@ -9,9 +9,10 @@
#+PANDOC_OPTIONS: template:~/.pandoc/templates/eisvogel.latex #+PANDOC_OPTIONS: template:~/.pandoc/templates/eisvogel.latex
#+PANDOC_OPTIONS: listings:t #+PANDOC_OPTIONS: listings:t
#+PANDOC_OPTIONS: toc:t #+PANDOC_OPTIONS: toc:t
#+PANDOC_METADATA: lang=es
#+PANDOC_METADATA: titlepage:t #+PANDOC_METADATA: titlepage:t
#+PANDOC_METADATA: listings-no-page-break:t #+PANDOC_METADATA: listings-no-page-break:t
#+PANDOC_METADATA: toc-own-page:t #+PANDOC_METADATA: toc-own-page:t
#+PANDOC_METADATA: table-use-row-colors:t #+PANDOC_METADATA: table-use-row-colors:t
#+PANDOC_METADATA: colorlinks:t #+PANDOC_METADATA: colorlinks:t
#+PANDOC_METADATA: logo:/home/coolneng/Photos/Logos/UGent.png #+PANDOC_METADATA: logo:/home/coolneng/Photos/Logos/UGR.png

View File

@@ -1,9 +0,0 @@
# -*- mode: snippet -*-
# name: img
# uuid: img
# key: trigger-key
# condition: t
# --
#+CAPTION: $1
#+LABEL: $2
#+ATTR_HTML: :width 50%

View File

@@ -1,10 +0,0 @@
# -*- mode: snippet -*-
# name: metropolis presentation
# key: met
# --
#+TITLE: $0
#+AUTHOR: Amin Kasrou Aouam
#+SUBTITLE:
#+PANDOC_OPTIONS: pdf-engine:xelatex
#+PANDOC_METADATA: theme:metropolis
#+PANDOC_METADATA: logo:/home/coolneng/Photos/Logos/UGent.png

View File

@@ -4,6 +4,7 @@
# -- # --
#+TITLE: $0 #+TITLE: $0
#+SUBTITLE: #+SUBTITLE:
#+LANGUAGE: es
#+REVEAL_TITLE_SLIDE: %t <br>%s</br> #+REVEAL_TITLE_SLIDE: %t <br>%s</br>
#+REVEAL_THEME: moon #+REVEAL_THEME: moon
#+OPTIONS: toc:nil ^:nil num:nil #+OPTIONS: toc:nil ^:nil num:nil

View File

@@ -4,6 +4,7 @@
# -- # --
#+TITLE: $0 #+TITLE: $0
#+AUTHOR: Amin Kasrou Aouam #+AUTHOR: Amin Kasrou Aouam
#+LANGUAGE: es
#+OPTIONS: toc:nil #+OPTIONS: toc:nil
#+LATEX_CLASS: tufte-handout #+LATEX_CLASS: tufte-handout
#+LATEX_CLASS_OPTIONS: [a4paper] #+LATEX_CLASS_OPTIONS: [a4paper]

View File

@@ -1,8 +0,0 @@
# -*- mode: snippet -*-
# name: email signature
# key: sign
# --
Best regards,
Amin Kasrou Aouam

View File

@@ -1,5 +0,0 @@
# -*- mode: snippet -*-
# name: formal greeting
# key: dear
# --
Dear Madam/Sir,

View File

@@ -1,8 +0,0 @@
# -*- mode: snippet -*-
# name: email signature
# key: frsign
# --
Cordialement,
Amin Kasrou Aouam