Compare commits

..

1 Commits

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

View File

@@ -1,38 +0,0 @@
;;; +keybindings.el -*- lexical-binding: t; -*-
;; Custom keybindings
;;
;; Select target in Makefile compilation as default
(map! :leader :n "c c" #'makefile-executor-execute-project-target)
;; Keybindings for R markdown polymode
(map! :map poly-markdown+R-mode-map
:n "RET" #'polymode-eval-chunk
:desc "Evaluate code block")
;; Map elfeed to global keybinding
(map! :leader :n "o e" #'=rss
:desc "RSS reader")
;; Keybindings for org-noter
(map! :mode pdf-view-mode
:n "i" #'org-noter-insert-note
:desc "Insert note with a subheading")
(map! :mode pdf-view-mode
:n "x" #'org-noter-kill-session
:desc "Kill the current org-noter session")
;; Keybindings for pdf-view
(map! :mode pdf-view-mode
:n ":" #'pdf-view-goto-page
:desc "Move to the selected page")
;; Keybindings for mu4e
(map! :mode mu4e-view-mode
:n "S" #'mu4e-view-save-attachments
:desc "Save the chosen mail attachments")
;; Keybindings for next/previous buffer
(map! :n "C-c j" #'previous-buffer)
(map! :n "C-c k" #'next-buffer)
;; Keybindings for PlatformIO
(map! :after platformio-mode
:map platformio-mode-map
(:localleader
:desc "Compile the project" "c c" #'platformio-build
:desc "Upload the project" "c u" #'platformio-upload
:desc "Monitor the serial console" "c m" #'platformio-device-monitor
:desc "Upload data files" "c d" #'platformio-spiffs-upload))

View File

@@ -1,45 +0,0 @@
;;; +mail.el -*- lexical-binding: t; -*-
;; Mu4e configuration
;;
;; Set up the default email identity
(setq user-full-name "Amin Kasrou Aouam")
;; Use msmtp to send email
(setq sendmail-program (executable-find "msmtp")
send-mail-function #'smtpmail-send-it
message-sendmail-f-is-evil t
message-sendmail-extra-arguments '("--read-envelope-from")
message-send-mail-function #'message-send-mail-with-sendmail)
;; Account configuration
(set-email-account! "gmail"
'((mu4e-sent-folder . "/gmail/sent")
(mu4e-drafts-folder . "/gmail/drafts")
(mu4e-trash-folder . "/gmail/trash")
(mu4e-refile-folder . "/gmail/archive")
(smtpmail-smtp-user . "akasroua@gmail.com")
(user-mail-address . "akasroua@gmail.com"))
t)
(set-email-account! "disroot"
'((mu4e-sent-folder . "/disroot/sent")
(mu4e-drafts-folder . "/disroot/drafts")
(mu4e-trash-folder . "/disroot/trash")
(mu4e-refile-folder . "/disroot/archive")
(smtpmail-smtp-user . "akasroua@disroot.org")
(user-mail-address . "akasroua@disroot.org"))
t)
;; Configure mu4e contexts
(setq mu4e-context-policy 'ask-if-none
mu4e-compose-context-policy 'ask-if-none)
;; Run lazy check when syncing
(setq mu4e-index-lazy-check t)
;; Use ISO dates
(setq mu4e-headers-date-format "%Y-%m-%d %H:%M")
;; Disable colors for HTML emails
(setq shr-use-colors nil)
;; Use shortcuts to access inboxes easily
(setq mu4e-maildir-shortcuts
'(("/disroot/inbox" . ?d)
("/gmail/inbox" . ?g)))
;; Change mu4e bookmarks
(setq mu4e-bookmarks '((:name "Unread messages" :query "flag:unread AND NOT flag:trashed" :key 117)
(:name "Today's messages" :query "date:today..now" :key 116)
(:name "Last 7 days" :query "date:7d..now" :hide-unread t :key 119)))

133
+org.el
View File

@@ -1,56 +1,22 @@
;;; ~/.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 ;; Add Notes to agenda
(setq org-agenda-files '("~/Notes")) (setq org-agenda-files '("~/Notes"))
;; Tailor Org super agenda ;; Tailor Org super agenda
(use-package! org-super-agenda (use-package! org-super-agenda
:after org-agenda :after org-agenda
:init :init
(setq org-agenda-skip-scheduled-if-done t (setq org-super-agenda-groups '((:auto-category t)))
org-agenda-skip-deadline-if-done t
org-agenda-skip-scheduled-delay-if-deadline t
org-agenda-skip-deadline-prewarning-if-scheduled t
org-deadline-warning-days 0
org-agenda-include-deadlines t
org-agenda-tags-column 100
org-agenda-block-separator nil
org-agenda-compact-blocks t
org-agenda-start-day nil
org-agenda-span 7
org-agenda-start-on-weekday 0)
(setq org-super-agenda-groups '((:name "Overdue"
:deadline past
:order 0)
(:name "Important"
:and (:priority "A" :deadline future)
:order 1)
(:name "Today"
:time-grid t
:scheduled today
:deadline today
:order 2)
(:name "Assignments"
:tag "labs"
:order 3)
(:name "Mails"
:tag "mail"
:order 4)
(:name "Errands"
:tag ("errand" "call")
:order 10)
(:name "Projects"
:file-path "Projects"
:order 6)
(:discard (:tag ("periodic" "birthday")))))
:config :config
(org-super-agenda-mode)) (org-super-agenda-mode))
;; Add timestamp to DONE task ;; Add timestamp to DONE task
@@ -60,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
@@ -69,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
@@ -91,85 +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-audio-player "pw-play"
org-pomodoro-time-format "%.2m min"
org-pomodoro-keep-killed-pomodoro-time t)
;; Define declarative org capture remplates
(use-package! doct
:commands doct)
(setq org-capture-templates
(doct `(("Cookbook" :keys "c"
:file "~/Notes/Recipes.org"
:type entry
:template ("%(org-chef-get-recipe-from-url)"))
;; Fix org-chef scraping
(setq org-chef-prefer-json-ld t)
;; Get the current state of org-pomodoro
(defun bergheim/org-clock-status ()
"Return the org time status - including any pomodoro activity"
(if (and (featurep 'org-pomodoro) (org-pomodoro-active-p))
(cl-case org-pomodoro-state
(:pomodoro
(format "%d min" (/ (org-pomodoro-remaining-seconds) 60)))
(:short-break
(format "Short break: %d min" (/ (org-pomodoro-remaining-seconds) 60)))
(:long-break
(format "Long break: %d min" (/ (org-pomodoro-remaining-seconds) 60)))
(:overtime
(format "Overtime! %d min" (/ (org-pomodoro-remaining-seconds) 60))))
(if (org-clocking-p)
(format "%s" (org-duration-from-minutes (org-clock-get-clocked-time)))
"")))
;; 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 "$" "$")))
;; Only show a task once if it has a schedule and deadline
(setq org-agenda-skip-deadline-prewarning-if-scheduled t)
;; Show raw latex when the cursor on the expression
(add-hook! 'org-mode-hook 'org-fragtog-mode)
;; Auto tangle on save
(add-hook! 'org-mode-hook 'org-auto-tangle-mode)
;; HACK Fix search folded sections
(setq org-fold-core-style 'overlays)
(evil-select-search-module 'evil-search-module 'evil-search)

35
+rss.el
View File

@@ -1,35 +0,0 @@
;;; +rss.el -*- lexical-binding: t; -*-
;; Elfeed configuration
;;
;; Tweak appeareance of the main page
(setq elfeed-sort-order 'ascending
elfeed-search-filter "@all +unread"
elfeed-goodies/tag-column-width 0)
;; Synchronize elfeed with Miniflux
(use-package! elfeed-protocol
:after elfeed
:config
(setq elfeed-use-curl t
elfeed-protocol-enabled-protocols '(fever)
elfeed-protocol-feeds (list
(list "fever+https://coolneng@rss.psydnd.org"
:api-url "https://rss.psydnd.org/fever/"
:password (auth-source-pass-get 'secret "api/miniflux"))))
(elfeed-protocol-enable))
;; Update RSS feeds on startup
(add-hook! 'elfeed-search-mode-hook 'elfeed-update)
;; Use different font and show article in fullscreen
(setq elfeed-show-entry-switch #'switch-to-buffer)
(defadvice! +rss-elfeed-wrap-h-nicer ()
"Enhances an elfeed entry's readability by wrapping it to a width of
`fill-column' and centering it with `visual-fill-column-mode'."
:override #'+rss-elfeed-wrap-h
(setq-local truncate-lines nil
shr-width 160
visual-fill-column-center-text t
default-text-properties '(line-height 1.1))
(let ((inhibit-read-only t)
(inhibit-modification-hooks t))
(visual-fill-column-mode)
(setq-local shr-current-font '(:family "Lato" :height 1.1))
(set-buffer-modified-p nil)))

69
+ui.el
View File

@@ -2,19 +2,18 @@
;; 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 ;; Display Magit status in fullscreen
(after! magit (after! magit
(setq magit-display-buffer-function #'magit-display-buffer-fullframe-status-v1)) (setq magit-display-buffer-function #'magit-display-buffer-fullframe-status-v1))
;; Match pdf-tools colors to the theme, fit to page by default and enable smooth scrolling ;; Match pdf-tools colors to the theme
(after! pdf-tools (after! pdf-tools
(setq pdf-view-midnight-colors '("#BBC2CF" . "#282C34")) (setq pdf-view-midnight-colors '("#ECEFF4" . "#2E3440"))
(setq-default pdf-view-display-size 'fit-width) (add-hook 'pdf-tools-enabled-hook 'pdf-view-midnight-minor-mode))
(add-hook 'pdf-tools-enabled-hook 'pdf-view-roll-minor-mode))
;; Customize modeline ;; Customize modeline
(setq doom-modeline-major-mode-icon t (setq doom-modeline-major-mode-icon t
doom-modeline-buffer-encoding nil doom-modeline-persp-name t
doom-modeline-check-simple-format t) doom-modeline-buffer-encoding nil)
;; Hide direnv environment variables popup ;; Hide direnv environment variables popup
(setq direnv-always-show-summary nil) (setq direnv-always-show-summary nil)
;; Change splash-screen banner ;; Change splash-screen banner
@@ -24,54 +23,16 @@
(setq lsp-ui-doc-enable nil (setq lsp-ui-doc-enable nil
lsp-signature-auto-activate nil lsp-signature-auto-activate nil
lsp-enable-symbol-highlighting nil lsp-enable-symbol-highlighting nil
lsp-ui-sideline-enable nil lsp-ui-sideline-show-code-actions nil
lsp-modeline-code-actions-enable nil lsp-modeline-code-actions-enable nil))
lsp-headerline-breadcrumb-enable nil
lsp-len-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))
;; Reduce size of the popup terminal ;; Disable lsp header line
(set-popup-rule! "*doom:vterm-popup:*" :size 0.25 :vslot -4 :select t :quit nil :ttl 0) (after! lsp-mode
;; Show matching parenthesis on the minibuffer (setq lsp-headerline-breadcrumb-enable nil))
(after! smartparens (show-smartparens-global-mode t)) ;; Shrink terminal buffer
;; Modify the splash screen actions (set-popup-rule! "^\\*vterm" :size 0.1 :vslot -4 :select t :quit nil :ttl 0)
(setq +doom-dashboard-menu-sections
'(("Reload last session"
: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)
("Open email client"
:icon (nerd-icons-octicon "nf-oct-mail" :face 'doom-dashboard-menu-title)
:when (featurep! :email mu4e)
:face (:inherit (doom-dashboard-menu-title bold))
:action =mu4e)
("RSS reader"
:icon (nerd-icons-octicon "nf-oct-rss" :face 'doom-dashboard-menu-title)
:when (featurep! :app rss)
:face (:inherit (doom-dashboard-menu-title bold))
:action =rss)))
;; 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)
;; Increase size of the PlatformIO compilation buffer
(set-popup-rule! "*platformio*" :size 0.25 :vslot -4 :select t :quit t :ttl 0)

110
config.el
View File

@@ -4,56 +4,48 @@
;; ;;
;; Load appearance configuration ;; Load appearance configuration
(load! "+ui") (load! "+ui")
;; Load custom keybindings
(load! "+keybindings")
;; Set projects directories ;; Set projects directories
(setq projectile-project-search-path '(("~/Projects" . 2) (setq projectile-project-search-path '("~/Projects" "~/Documents/Work" "~/Documents/Typesetting"))
("~/Documents" . 5) ; Auto cleanup recentf
("~/Repos")
"~/.dotfiles"
"~/Notes"))
;; 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
(setq org-directory "~/Notes")
(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 ;; Disable company mode in Nix
(setq-hook! 'nix-mode-hook company-idle-delay nil) (setq-hook! 'nix-mode-hook company-idle-delay nil)
;; Trigger flycheck after save ;; Trigger flycheck after save
@@ -64,46 +56,6 @@
(add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]\\.pgdata\\'")) (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]\\.pgdata\\'"))
;; Ignore empty files ;; Ignore empty files
(after! projectile (after! projectile
(add-to-list 'projectile-globally-ignored-files ".gitkeep") (add-to-list 'projectile-globally-ignored-files ".gitkeep"))
(add-to-list 'projectile-globally-ignored-files ".envrc") ;; Set org-mode as the default
(add-to-list 'projectile-globally-ignored-files ".project") (setq-default major-mode 'org-mode)
(add-to-list 'projectile-globally-ignored-directories ".direnv")
(add-to-list 'projectile-globally-ignored-directories ".ipynb_checkpoints"))
;; Associate polymode to R markdown files
(add-to-list 'auto-mode-alist '("\\.[rR]md\\'" . poly-markdown+R-mode))
;; Set clangd as C/C++ LSP
(setq lsp-clients-clangd-args '("-j=3"
"--background-index"
"--clang-tidy"
"--completion-style=detailed"
"--header-insertion=never"
"--header-insertion-decorators=0"))
(after! lsp-clangd (set-lsp-priority! 'clangd 2))
;; Use relative line numbers (Usage: number <j/k>)
(setq display-line-numbers-type 'relative)
;; Set up RSS reader
(after! elfeed (load! "+rss"))
;; Set up the mail stack
(after! mu4e (load! "+mail"))
;; HACK Enable AOT native compilation
(setq native-comp-jit-compilation nil)
(after! (doom-packages straight)
(setq straight--native-comp-available t))
;; Use PlatformIO for Arduino development
(use-package! platformio-mode
:after cc-mode
:config
(add-hook! 'c++-mode-hook (platformio-conditionally-enable)))
;; Set indentation level to 2
(setq tab-width 2)
;; Move buffer while maintaining cursor centered
(use-package! centered-cursor-mode
:config
(global-centered-cursor-mode))
;; Enable smooth scrolling
(pixel-scroll-precision-mode)
;; Restore previous session on startup
(add-hook 'window-setup-hook #'doom/quickload-session)
;; Set ruff as the default python formatter
(after! python
(set-formatter! 'ruff :modes '(python-mode python-ts-mode)))

100
init.el
View File

@@ -11,30 +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
(corfu +orderless) ; complete with cap(f), cape and a flying feather!
;;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
@@ -72,19 +69,19 @@
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
@@ -92,9 +89,9 @@
;;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 +booster) ; 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
@@ -104,99 +101,88 @@
;;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
+poetry +pyright
+tree-sitter) +poetry)
;;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,29 +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)
;; Better org agenda
(package! org-super-agenda) (package! org-super-agenda)
;; Save recipes to org file
(package! org-chef)
;; Miniflux integration for elfeed
(package! elfeed-protocol)
;; Prettier LaTeX source blocks
(package! engrave-faces)
;; Prettier org mode
(package! org-modern)
;; Tangle org files on save
(package! org-auto-tangle)
;; Enable LaTeX previews automatically
(package! org-fragtog)
;; Arduino development
(package! platformio-mode)
;; Light theme
(package! os1-theme :recipe (:host github :repo "sashimacs/os1-theme"))
;; Move buffer while maintaining cursor centered
(package! centered-cursor-mode)
;; Use the fork of pdf-tools with smooth scrolling
(unpin! pdf-tools)
(package! pdf-tools :recipe (:host github :repo "aikrahguzar/pdf-tools" :branch "child-frame-preview"))
(package! image-roll :recipe (:host github :repo "dalanicolai/image-roll.el"))
;; Declarative org capture templates
(package! doct :recipe (:host github :repo "progfolio/doct"))

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
# --
Kind 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

View File

@@ -1,12 +0,0 @@
# -*- mode: snippet -*-
# name: work administration template
# key: work
# condition: t
# --
Dear colleague,
You will find attached to this mail my $1 for the month of `(format-time-string "%B %Y")`.
Kind regards,
Amin Kasrou Aouam