Compare commits

..

2 Commits

Author SHA1 Message Date
de46a61c3a HACK: Enable AOT native compilation 2022-10-01 00:58:15 +02:00
fd892debe9 Add keybinding to insert a heading in org-noter 2022-10-01 00:58:15 +02:00
13 changed files with 188 additions and 345 deletions

View File

@@ -8,31 +8,10 @@
:n "RET" #'polymode-eval-chunk :n "RET" #'polymode-eval-chunk
:desc "Evaluate code block") :desc "Evaluate code block")
;; Map elfeed to global keybinding ;; Map elfeed to global keybinding
(map! :leader :n "o e" #'=rss (map! :leader :n "o e" #'=rss)
:desc "RSS reader") ;; Map wallabag to global keybinding
(map! :leader :n "o w" #'=wallabag)
;; Keybindings for org-noter ;; Keybindings for org-noter
(map! :mode pdf-view-mode (map! :mode org-noter
:n "i" #'org-noter-insert-note :n "i" #'org-noter-insert-note
:desc "Insert note with a subheading") :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

@@ -18,6 +18,14 @@
(smtpmail-smtp-user . "akasroua@gmail.com") (smtpmail-smtp-user . "akasroua@gmail.com")
(user-mail-address . "akasroua@gmail.com")) (user-mail-address . "akasroua@gmail.com"))
t) t)
(set-email-account! "ugent"
'((mu4e-sent-folder . "/ugent/sent")
(mu4e-drafts-folder . "/ugent/drafts")
(mu4e-trash-folder . "/ugent/trash")
(mu4e-refile-folder . "/ugent/archive")
(smtpmail-smtp-user . "amin.kasrouaouam@ugent.be")
(user-mail-address . "amin.kasrouaouam@ugent.be"))
t)
(set-email-account! "disroot" (set-email-account! "disroot"
'((mu4e-sent-folder . "/disroot/sent") '((mu4e-sent-folder . "/disroot/sent")
(mu4e-drafts-folder . "/disroot/drafts") (mu4e-drafts-folder . "/disroot/drafts")
@@ -35,11 +43,3 @@
(setq mu4e-headers-date-format "%Y-%m-%d %H:%M") (setq mu4e-headers-date-format "%Y-%m-%d %H:%M")
;; Disable colors for HTML emails ;; Disable colors for HTML emails
(setq shr-use-colors nil) (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)))

87
+org.el
View File

@@ -8,7 +8,7 @@
;; 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
@@ -17,40 +17,24 @@
:init :init
(setq org-agenda-skip-scheduled-if-done t (setq org-agenda-skip-scheduled-if-done t
org-agenda-skip-deadline-if-done 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-include-deadlines t
org-agenda-tags-column 100
org-agenda-block-separator nil org-agenda-block-separator nil
org-agenda-compact-blocks t org-agenda-tags-column 100
org-agenda-start-day nil org-agenda-compact-blocks t)
org-agenda-span 7
org-agenda-start-on-weekday 0)
(setq org-super-agenda-groups '((:name "Overdue" (setq org-super-agenda-groups '((:name "Overdue"
:deadline past :deadline past)
:order 0)
(:name "Important"
:and (:priority "A" :deadline future)
:order 1)
(:name "Today" (:name "Today"
:time-grid t
:scheduled today :scheduled today
:deadline today :deadline today
:order 2) :time-grid t)
(:name "Important"
:priority "A")
(:name "Assignments" (:name "Assignments"
:tag "labs" :tag "labs"
:order 3)
(:name "Mails"
:tag "mail"
:order 4)
(:name "Errands"
:tag ("errand" "call")
:order 10) :order 10)
(:name "Projects" (:name "Exams"
:file-path "Projects" :tag "exams"
:order 6) :order 10)))
(: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 +44,9 @@
(: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) (setq writeroom-major-modes '(org-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
@@ -95,6 +80,8 @@
(use-package! engrave-faces-latex (use-package! engrave-faces-latex
:after ox-latex) :after ox-latex)
(setq org-latex-src-block-backend 'engraved) (setq org-latex-src-block-backend 'engraved)
;; Set up bibliography management
(setq citar-bibliography '("~/Documents/Education/Bibliography/references.bib"))
;; Add citeproc and metadata-file options to ox-pandoc ;; Add citeproc and metadata-file options to ox-pandoc
(after! ox-pandoc (after! ox-pandoc
(add-to-list 'org-pandoc-valid-options 'citeproc) (add-to-list 'org-pandoc-valid-options 'citeproc)
@@ -105,17 +92,12 @@
(setq org-pomodoro-length '45 (setq org-pomodoro-length '45
org-pomodoro-short-break-length '15 org-pomodoro-short-break-length '15
org-pomodoro-long-break-length '30 org-pomodoro-long-break-length '30
org-pomodoro-audio-player "pw-play" org-pomodoro-audio-player "pw-play")
org-pomodoro-time-format "%.2m min" ;; Define capture templates
org-pomodoro-keep-killed-pomodoro-time t)
;; Define declarative org capture remplates
(use-package! doct
:commands doct)
(setq org-capture-templates (setq org-capture-templates
(doct `(("Cookbook" :keys "c" '(("c" "Cookbook" entry (file "~/Notes/Recipes.org")
:file "~/Notes/Recipes.org" "%(org-chef-get-recipe-from-url)"
:type entry :empty-lines 1)))
:template ("%(org-chef-get-recipe-from-url)"))
;; Fix org-chef scraping ;; Fix org-chef scraping
(setq org-chef-prefer-json-ld t) (setq org-chef-prefer-json-ld t)
;; Get the current state of org-pomodoro ;; Get the current state of org-pomodoro
@@ -134,9 +116,10 @@
(if (org-clocking-p) (if (org-clocking-p)
(format "%s" (org-duration-from-minutes (org-clock-get-clocked-time))) (format "%s" (org-duration-from-minutes (org-clock-get-clocked-time)))
""))) "")))
;; Save org-download images to an assets directory ;; Save org-download images to ~/.cache
(after! org-download (after! org-download
(setq org-download-image-dir "assets/" (setq org-download-image-dir "~/.cache/org-download"
org-attach-id-dir "~/.cache/org-attach"
org-attach-auto-tag nil)) org-attach-auto-tag nil))
;; Show images by default with a limited width ;; Show images by default with a limited width
(setq org-startup-with-inline-images t (setq org-startup-with-inline-images t
@@ -146,30 +129,8 @@
:hook (org-mode . org-modern-mode) :hook (org-mode . org-modern-mode)
:config :config
(setq org-modern-star [""])) (setq org-modern-star [""]))
(add-hook! 'org-agenda-finalize-hook #'org-modern-agenda)
;; Configure a better split and some default for org-noter ;; Configure a better split and some default for org-noter
(after! org-noter (after! org-noter
(setq org-noter-always-create-frame nil (setq org-noter-always-create-frame nil
org-noter-doc-split-fraction '(0.7 . 0.3) org-noter-doc-split-fraction '(0.7 . 0.3)
org-noter-default-heading-title " " 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)))

68
+ui.el
View File

@@ -6,15 +6,16 @@
;; 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 and fit to page by default
(after! pdf-tools (after! pdf-tools
(setq pdf-view-midnight-colors '("#BBC2CF" . "#282C34")) (setq pdf-view-midnight-colors '("#BBC2CF" . "#282C34"))
(setq-default pdf-view-display-size 'fit-width) (setq-default pdf-view-display-size 'fit-width)
(add-hook 'pdf-tools-enabled-hook 'pdf-view-roll-minor-mode)) (add-hook 'pdf-tools-enabled-hook 'pdf-view-midnight-minor-mode))
;; Customize modeline ;; Customize modeline
(setq doom-modeline-major-mode-icon t (setq doom-modeline-major-mode-icon t
doom-modeline-persp-name t
doom-modeline-buffer-encoding nil doom-modeline-buffer-encoding nil
doom-modeline-check-simple-format t) doom-modeline-persp-name 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 +25,39 @@
(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! vertico
(setq vertico-count 8)) (setq vertico-count 8))
;; 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
(setq lsp-headerline-breadcrumb-enable nil))
;; Shrink terminal buffer
(set-popup-rule! "^\\*vterm" :size 0.1 :vslot -4 :select t :quit nil :ttl 0)
;; Show matching parenthesis on the minibuffer ;; Show matching parenthesis on the minibuffer
(after! smartparens (show-smartparens-global-mode t)) (after! smartparens (show-smartparens-global-mode t))
;; Modify the splash screen actions ;; Modify the splash screen actions
(setq +doom-dashboard-menu-sections (assoc-delete-all "Jump to bookmark" +doom-dashboard-menu-sections)
'(("Reload last session" (assoc-delete-all "Open private configuration" +doom-dashboard-menu-sections)
:icon (nerd-icons-octicon "nf-oct-history" :face 'doom-dashboard-menu-title) (assoc-delete-all "Open documentation" +doom-dashboard-menu-sections)
:when (cond ((modulep! :ui workspaces) (add-to-list '+doom-dashboard-menu-sections
(file-exists-p (expand-file-name persp-auto-save-fname persp-save-dir))) '("Open email client"
((require 'desktop nil t) :icon (all-the-icons-octicon "mail" :face 'doom-dashboard-menu-title)
(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) :when (featurep! :email mu4e)
:face (:inherit (doom-dashboard-menu-title bold)) :face (:inherit (doom-dashboard-menu-title bold))
:action =mu4e) :action =mu4e) t)
("RSS reader" (add-to-list '+doom-dashboard-menu-sections
:icon (nerd-icons-octicon "nf-oct-rss" :face 'doom-dashboard-menu-title) '("RSS reader"
:icon (all-the-icons-octicon "rss" :face 'doom-dashboard-menu-title)
:when (featurep! :app rss) :when (featurep! :app rss)
:face (:inherit (doom-dashboard-menu-title bold)) :face (:inherit (doom-dashboard-menu-title bold))
:action =rss))) :action =rss) t)
;; Restore previous session without confirmation (add-to-list '+doom-dashboard-menu-sections
(defadvice! restore-no-confirm-session-quickload-a () '("Read saved articles"
:override #'doom/quickload-session :icon (all-the-icons-octicon "book" :face 'doom-dashboard-menu-title)
(message "Restoring session...") :face (:inherit (doom-dashboard-menu-title bold))
(doom-load-session) :action =wallabag) t)
(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)

120
config.el
View File

@@ -8,51 +8,43 @@
(load! "+keybindings") (load! "+keybindings")
;; Set projects directories ;; Set projects directories
(setq projectile-project-search-path '(("~/Projects" . 2) (setq projectile-project-search-path '(("~/Projects" . 2)
("~/Documents" . 5) ("~/Documents/Work" . 1)
("~/Repos") ("~/Documents/Papers" . 0)
("~/Documents/Typesetting" . 1)
("~/Documents/Paperwork" . 1)
("~/Documents/Typesetting" . 1)
("~/Documents/Uni" . 3)
("~/Repos" . 1)
"~/.dotfiles" "~/.dotfiles"
"~/Notes")) "~/Notes"))
;; 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"))
;; Load org configuration ;; Load org configuration
(setq org-directory "~/Notes") (setq org-directory "~/Notes")
(after! org (load! "+org")) (after! org (load! "+org"))
;; Disable completion and line numbers in Markdown ;; 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
(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))
;; 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)
(let ((window (get-buffer-window buf)))
(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 ",")
;; 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)
@@ -65,10 +57,7 @@
;; 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") (add-to-list 'projectile-globally-ignored-directories ".direnv"))
(add-to-list 'projectile-globally-ignored-files ".project")
(add-to-list 'projectile-globally-ignored-directories ".direnv")
(add-to-list 'projectile-globally-ignored-directories ".ipynb_checkpoints"))
;; Associate polymode to R markdown files ;; Associate polymode to R markdown files
(add-to-list 'auto-mode-alist '("\\.[rR]md\\'" . poly-markdown+R-mode)) (add-to-list 'auto-mode-alist '("\\.[rR]md\\'" . poly-markdown+R-mode))
;; Set clangd as C/C++ LSP ;; Set clangd as C/C++ LSP
@@ -81,29 +70,56 @@
(after! lsp-clangd (set-lsp-priority! 'clangd 2)) (after! lsp-clangd (set-lsp-priority! 'clangd 2))
;; Use relative line numbers (Usage: number <j/k>) ;; Use relative line numbers (Usage: number <j/k>)
(setq display-line-numbers-type 'relative) (setq display-line-numbers-type 'relative)
;; Set up RSS reader ;; Use pass as auth-source
(after! elfeed (load! "+rss")) (add-to-list 'auth-sources 'password-store)
;; Set up wallabag
(after! wallabag
(setq wallabag-host "https://wallabag.coolneng.duckdns.org"
wallabag-username "coolneng"
wallabag-password (auth-source-pass-get 'secret "api/wallabag")
wallabag-clientid (auth-source-pass-get "clientid" "api/wallabag")
wallabag-secret (auth-source-pass-get "api-secret" "api/wallabag")
wallabag-show-sidebar 't
wallabag-show-entry-switch 'switch-to-buffer
url-automatic-caching t)
(add-hook 'wallabag-after-render-hook 'wallabag-search-update-and-clear-filter))
(add-hook! 'doom-real-buffer-functions
(defun +rss-buffer-p (buf)
(string-match-p "^\\*wallabag" (buffer-name buf))))
(defvar +wallabag-workspace-name "*wallabag*")
(defun =wallabag ()
"Activate (or switch to) `wallabag' in its workspace."
(interactive)
(if (modulep! :ui workspaces)
(progn
(+workspace-switch +wallabag-workspace-name t)
(doom/switch-to-scratch-buffer)
(wallabag)
(+workspace/display))
(setq +wallabag--wconf (current-window-configuration))
(delete-other-windows)
(switch-to-buffer (doom-fallback-buffer))
(wallabag)))
;; Set up elfeed
(after! elfeed
(setq elfeed-use-curl t)
(setq elfeed-feeds (list
(list "fever+https://coolneng@rss.coolneng.duckdns.org"
:api-url "https://rss.coolneng.duckdns.org/fever/"
:password (auth-source-pass-get 'secret "api/miniflux"))))
(setq elfeed-sort-order 'ascending
elfeed-search-filter "@all +unread"
elfeed-goodies/tag-column-width 0)
(elfeed-protocol-enable)
(add-hook! 'elfeed-search-mode-hook 'elfeed-update))
;; Use delta to view diffs in Magit
(use-package! magit-delta
:after magit
:config
(magit-delta-mode))
;; Set up the mail stack ;; Set up the mail stack
(after! mu4e (load! "+mail")) (after! mu4e (load! "+mail"))
;; HACK Enable AOT native compilation ;; HACK Enable AOT native compilation
(setq native-comp-jit-compilation nil) (setq native-comp-deferred-compilation nil)
(after! (doom-packages straight) (after! (doom-packages straight)
(setq straight--native-comp-available t)) (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)))

44
init.el
View File

@@ -11,11 +11,10 @@
(doom! :input (doom! :input
;;chinese ;;chinese
;;japanese ;;japanese
;;layout ; auie,ctsrnm is the superior home row ;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
@@ -34,7 +33,6 @@
(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
@@ -84,7 +82,7 @@
: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
@@ -94,7 +92,7 @@
;;gist ; interacting with github gists ;;gist ; interacting with github gists
lookup ; navigate your code and its documentation lookup ; navigate your code and its documentation
;;+docsets) ; ...or in Dash docsets locally ;;+docsets) ; ...or in Dash docsets locally
(lsp +booster) ; M-x vscode lsp ; M-x vscode
;;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,52 +102,49 @@
;;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 ;;beancount ; mind the GAAP
(cc +lsp (cc +lsp) ; C > C++ == 1
+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
;;dhall ;;dhall
;;(dart
;;+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 ;;fstar ; (dependent) types and (monadic) effects and Z3
;;fortran ; in FORTRAN, GOD is REAL (unless declared INTEGER)
;;gdscript ; the language you waited for ;;gdscript ; the language you waited for
(go +lsp (go +lsp) ; the hipster dialect
+tree-sitter) ; the hipster dialect
;;(graphql +lsp) ; Give queries a REST
;;(haskell +lsp) ; a language that's lazier than I am ;;(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 ; a language you can depend on
(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 +lsp) ; writing papers in Emacs has never been so fun
;;lean ; for folks with too much to prove ;;lean
;;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
@@ -160,12 +155,13 @@
+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)
;;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 ;;raku ; the artist formerly known as perl6
@@ -175,12 +171,12 @@
;;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 ;;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 ;;zig ; C, but simpler

View File

@@ -5,29 +5,11 @@
;; (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) (package! org-chef)
;; Miniflux integration for elfeed (package! emacsql-sqlite)
(package! wallabag :recipe (:host github :repo "chenyanming/wallabag.el" :files ("*.el" "*.alist" "*.css")))
(package! elfeed-protocol) (package! elfeed-protocol)
;; Prettier LaTeX source blocks (package! magit-delta)
(package! engrave-faces) (package! engrave-faces)
;; Prettier org mode
(package! org-modern) (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

@@ -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,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