Skip to content

n1tsu/doom-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Config

This is my Doom Emacs configuration files. They are greatly inspired from various sources:

General configuration

Enable lexical binding.

;;; -*- lexical-binding: t; -*-
(remove-hook 'after-init-hook #'debian-ispell-set-startup-menu) 

Adding name and mail address.

(setq user-full-name "Augustin Thiercelin"
      user-mail-address "augustin.thiercelin@epita.fr")

Setting org directory

(setq org-directory "~/org/")

Determine style of line numbers and display battery in mode bar.

(display-battery-mode 1)
(setq display-line-numbers-type t)

Set transparency

(set-frame-parameter (selected-frame) 'alpha '(95 . 95))
(add-to-list 'default-frame-alist '(alpha . (95 . 95)))

Hide hidden files using dired-omit-mode in dired

(require 'dired-x)
(setq dired-omit-files "^\\...+$")
(add-hook 'dired-mode-hook (lambda () (dired-omit-mode 1)))

Bind org-mark-ring-goto (leader key is SPACE)

(map! :leader
      :desc "Go back to position before clicking link"
      "p p" #'org-mark-ring-goto)

Japanese input bindings

(map! :leader
      :desc "Japanese"
      "j j" (cmd! (set-input-method "japanese"))
      :desc "Japanese Hiragana"
      "j h" (cmd! (set-input-method "japanese-hiragana"))
      :desc "Japanese Katakana"
      "j k" (cmd! (set-input-method "japanese-katakana")))

Theme

Swap theme function between a light and a dark theme. Light theme is greatly inspired from this website. Dark theme uses doom-vibrant theme as a base, light theme uses spacemacs-light. Then faces are modified.

(defun book-faces (org-foreground org-background font)
  "Change org-faces"
  (interactive)

  (if (string= org-background "black")
      (setq block-background "#31314a")
    (setq block-background "LavenderBlush2"))

  (custom-set-faces!
    `(org-level-1 :inherit nil :family ,font :weight normal :slant normal :height 1.6 :foreground ,org-foreground)
    `(org-level-2 :inherit nil :family ,font :weight normal :slant italic :height 1.3 :foreground ,org-foreground)
    `(org-level-3 :inherit nil :family ,font :weight normal :slant italic :height 1.2 :foreground ,org-foreground)
    `(org-level-4 :inherit nil :family ,font :weight normal :slant italic :height 1.1 :foreground ,org-foreground)
    `(org-level-5 :inherit nil :family ,font :weight normal :slant italic :height 1.0 :foreground ,org-foreground)
    `(org-document-title :inherit nil :family ,font :height 1.8 :foreground ,org-foreground :underline nil)
    `(org-document-info :height 1.2 :slant italic)
    `(org-headline-done :family ,font :strike-through t)
    `(org-block :background ,block-background :family "Fira Code" :height 0.7 :foreground ,org-foreground)
    `(org-block-begin-line :background nil :height 0.8 :family "sans-mono-font" :foreground "slate")
    `(org-block-end-line :background nil :height 0.8 :family "sans-mono-font" :foreground "slate")
    `(org-document-info-keyword :height 0.8 :foreground "gray")
    `(org-link :foreground ,org-foreground)
    `(org-special-keyword :family "sans-mono-font" :foreground "gray" :height 0.8)
    `(org-hide :foreground ,org-background)
    `(org-indent :inherit (org-hide fixed-pitch))
    `(org-date :family "sans-mono-font" :height 0.8)
    `(org-agenda-date :inherit nil :height 1.1)
    `(org-agenda-done :strike-through t :foreground "doc")
    `(org-ellipsis :underline nil :foreground "comment")
    `(org-tag :foreground "doc")
    `(org-table :family "serif-mono-font" :height 0.9 :background ,org-background)
    `(org-code :inherit nil :family "serif-mono-font" :foreground "comment" :height 0.9)
    `(org-meta-line :foreground "gray" :inherit org-document-info-keyword)
    `(org-drawer :foreground "gray" :inherit org-document-info-keyword)
    `(org-property-value :foreground "gray" :inherit org-document-info-keyword)
    `(variable-pitch :family ,font)
    )
  )

(defun black-theme ()
  (setq org-superstar-headline-bullets-list '("" "" "" "" "" "" ""))
  (load-theme 'doom-vibrant t)
  (book-faces "white" "black" "Fira Code")
  )

(defun white-theme ()
  (setq org-superstar-headline-bullets-list '(" "))
  (load-theme 'spacemacs-light t)
  (book-faces "black" "white" "ETBembo")
  )

(defun swap-theme ()
  "Swap dark and light theme"
  (interactive)
  (if (eq doom-theme 'doom-vibrant)
      (white-theme)
    (black-theme)
    )
  )

Using Fira Mono font and fixing size for normal and variable-pitch mode and setting doom theme. Doom theme is set according to text inside ~/.config/.theme file.

(setq doom-font (font-spec :family "Fira Code" :size 16 :weight 'semi-light)
      doom-variable-pitch-font (font-spec :family "Fira Code" :size 16))

(defun get-string-from-file (filePath)
  "Return filePath's file content."
  (with-temp-buffer
    (insert-file-contents filePath)
    (buffer-string)))

(setq theme_value (string-trim (get-string-from-file "~/.config/.theme")))
(if (string= theme_value "white")
    (white-theme)
  (black-theme))

Org

Modify check-boxes inside org files.

(add-hook 'org-mode-hook (lambda ()
   "Beautify Org Checkbox Symbol"
   (push '("[ ]" .  "") prettify-symbols-alist)
   (push '("[X]" . "" ) prettify-symbols-alist)
   (push '("[-]" . "" ) prettify-symbols-alist)
   (prettify-symbols-mode)))

Add margin and remove line indications

(setq visual-fill-column-width 110
      visual-fill-column-center-text t)

(add-hook 'org-mode-hook (lambda () (display-line-numbers-mode 0)))
(add-hook 'org-mode-hook 'visual-fill-column-mode)
(add-hook 'org-mode-hook 'auto-fill-mode)

Add a customized function to take screenshot. StackOverflow original code

(defun my-org-screenshot ()
  "Take a screenshot into a time stamped unique-named file in a
  subdirectory named as the org-buffer and insert a link to this file."
  (interactive)
  (setq path-no-ext (file-name-sans-extension buffer-file-name))
  (setq filename-no-ext (file-name-nondirectory path-no-ext))
  (setq screenshots-dir-name (concat path-no-ext "-screenshots"))
  (if (not (file-directory-p screenshots-dir-name))
      (make-directory screenshots-dir-name))
  (setq file-path
          (concat filename-no-ext "-screenshots/"
                  (format-time-string "%Y%m%d_%H%M%S.png")))
  (call-process "import" nil nil nil file-path)
  (setq caption (read-string "Caption: "))
  (insert (concat "#+CAPTION: " caption "\n"))
  (insert (concat "[[file:" file-path "]]")))

Export with properties and add options for minted latex export.

(setq org-export-with-properties t)
(setq org-latex-minted-options '(("linenos" "true") ("frame" "single")))
(setq org-export-with-toc t)

Add captures templates for org:

  • Todo templates add a checkbox in dedicated sections inside the ~/org/todo.org file.
  • Cours templates open ~/org/roam/cours/cours_index.org file to add an entry
  • Veille templates open ~/org/veille.org file to add a checkbox with the current day timestamp. A formatted link with the clipboard content is set, needing a link description.
(setq org-capture-templates
      ;; Create new entry in org/todo.org in corresponding section
      '(("t" "Personal todo" entry
         (file+headline +org-capture-todo-file "MISC")
         "* [ ] %?\n%i\n%a"
         :prepend t)
        ("i" "SRS todo" entry
         (file+headline +org-capture-todo-file "SRS")
         "* [ ] %?\n%i\n%a"
         :prepend t)
        ("a" "ACU todo" entry
         (file+headline +org-capture-todo-file "ACU")
         "* [ ] %?\n%i\n%a"
         :prepend t)
        ("p" "PROLOGIN todo" entry
         (file+headline +org-capture-todo-file "PROLOGIN")
         "* [ ] %?\n%i\n%a"
         :prepend t)
        ;; Create new entry in org/notes.org
        ("n" "Personal notes" entry
         (file+headline "~/org/notes.org" "Notes")
         "* %u %?\n%i\n%a"
         :prepend t)
        ;; Add new entry in org/roam/cours/cours_index.org
        ("c" "Cours communs" entry
         (file+headline "~/org/roam/cours/cours_index.org" "Communs")
         "* %?\n%i\n%a"
         :jump-to-captured t)
        ("s" "Cours SRS" entry
         (file+headline "~/org/roam/cours/cours_index.org" "SRS")
         "* %?\n%i\n%a"
         :jump-to-captured t)
        ;; Add new entry in org/veille.org with clipboard
        ("v" "Veille SRS" entry
         (file+headline "~/org/veille.org" "Veille SRS")
         "* [ ] %u [[%x][%?]]\n%i\n%a"
         :prepend t)
        ("m" "Veille TCOM" entry
         (file+headline "~/org/veille.org" "Veille TCOM")
         "* [ ] %u [[%x][%?]]\n%i\n%a"
         :prepend t)))

Org-roam

Basic configuration for roam, enabling version 2, setting the directory and adding some bindings.

(use-package org-roam
  :ensure t
  :init
  (setq org-roam-v2-ack t)
  :custom
  (org-roam-directory (file-truename "~/org/roam/"))
  :bind (("C-c n l" . org-roam-buffer-toggle)
         ("C-c n f" . org-roam-node-find)
         ("C-c n g" . org-roam-graph)
         ("C-c n i" . org-roam-node-insert)
         ("C-c n c" . org-roam-capture)
         ;; Dailies
         ("C-c n j" . org-roam-dailies-capture-today))
  :config
  (org-roam-setup))

Add org-roam templates:

  • default creating a file with a title and the current date
  • cours creating a file inside ~/org/roam/cours prompting for the name of the professor and adding readtheorg export option.
  • misc creating a file inside ~/org/roam/misc adding readtheorg export option.
(setq org-roam-capture-templates
      '(("d" "default" plain "%?"
         :if-new (file+head "${slug}.org"
                            "#+TITLE: ${title}
#+DATE: %U")
         :unnarrowed t)
        ("c" "cours" plain "%?"
         :if-new (file+head "cours/${slug}.org"
                            "#+TITLE: ${title}
#+DATE: %U
#+PROFESSOR: %^{PROF|FIXME}
#+FILETAGS: :cours:
#+SETUPFILE: org/theme-readtheorg.setup
#+HTML_LINK_HOME: cours_index.html
#+HTML_LINK_LINK_UP: cours_index.html")
         :unnarrowed t)
        ("m" "misc" plain "%?"
         :if-new (file+head "misc/${slug}.org"
                            "#+TITLE: ${title}
#+DATE: %U
#+FILETAGS: :misc:
#+SETUPFILE: org/theme-readtheorg.setup
#+HTML_LINK_HOME: misc_index.html
#+HTML_LINK_LINK_UP: misc_index.html")
          :unnarrowed t )
        ("n" "network" plain "%?"
         :if-new (file+head "network/${slug}.org"
                            "#+TITLE: ${title}
#+DATE: %U
#+FILETAGS: :network:
#+SETUPFILE: org/theme-readtheorg.setup
#+HTML_LINK_HOME: network_index.html
#+HTML_LINK_LINK_UP: network_index.html")
          :unnarrowed t )
         ("j" "jardinage" plain "%?"
          :if-new (file+head "jardinage/${slug}.org"
                             "#+TITLE: ${title}
#+DATE: %U
#+FILETAGS: :jardinage:
#+SETUPFILE: org/theme-readtheorg.setup
#+HTML_LINK_HOME: jardinage.html")
          :unnarrowed t)))

(setq org-roam-completion-everywhere t)

Add templates for roam-daily:

  • cours adding it in section “Notes de cours”
  • misc adding it in section “Notes generales”
(setq org-roam-dailies-capture-templates
      '(("c" "cours" entry "* %?"
         :if-new (file+head "daily/%<%Y-%m-%d>.org"
         "#+TITLE: %<%Y-%m-%d>\n")
         :olp ("Notes de cours"))

        ("m" "misc" entry "* %?"
         :file-name "daily/%<%Y-%m-%d>.org"
         :head "#+TITLE: %<%Y-%m-%d>\n"
         :olp ("Notes generales"))))

Publish

Setup two project to publish:

  • cours exporting all org-roam files with resources from ~/org/roam/cours
  • misc exporting all org-roam file with resources from ~/org/roam/misc
  • jardinage exporting all org-roam files with resources from ~/org/roam/jardinage
  • network exporting all org-roam file with resources from ~/org/roam/network
(require 'ox-publish)
(setq org-publish-project-alist
      '(
        ("cours-note"
         :base-directory "~/org/roam/cours"
         :base-extension "org"
         :publishing-directory "~/cours/public_html/"
         :recursive t
         :publishing-function org-html-publish-to-html
         :headline-levels 4
         :auto-preamble t)
        ("cours-static"
         :base-directory "~/org/roam/cours"
         :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf\\|setup"
         :publishing-directory "~/cours/public_html/"
         :recursive t
         :publishing-function org-publish-attachment)
        ("misc-note"
         :base-directory "~/org/roam/misc"
         :base-extension "org"
         :publishing-directory "~/misc/public_html/"
         :recursive t
         :publishing-function org-html-publish-to-html
         :headline-levels 4
         :auto-preamble t)
        ("misc-static"
         :base-directory "~/org/roam/misc"
         :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf\\|setup"
         :publishing-directory "~/misc/public_html/"
         :recursive t
         :publishing-function org-publish-attachment)
        ("network-note"
         :base-directory "~/org/roam/network"
         :base-extension "org"
         :publishing-directory "~/network/public_html/"
         :recursive t
         :publishing-function org-html-publish-to-html
         :headline-levels 4
         :auto-preamble t)
        ("network-static"
         :base-directory "~/org/roam/network"
         :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf\\|setup"
         :publishing-directory "~/network/public_html/"
         :recursive t
         :publishing-function org-publish-attachment)
        ("jardinage-note"
         :base-directory "~/org/roam/jardinage"
         :base-extension "org"
         :publishing-directory "~/jardinage/public_html/"
         :recursive t
         :publishing-function org-html-publish-to-html
         :headline-levels 4
         :auto-preamble t)
        ("jardinage-static"
         :base-directory "~/org/roam/jardinage"
         :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf\\|setup"
         :publishing-directory "~/jardinage/public_html/"
         :recursive t
         :publishing-function org-publish-attachment)
        ("jardinage" :components ("jardinage-note" "jardinage-static"))
        ("cours" :components ("cours-note" "cours-static"))
        ("misc" :components ("misc-note" "misc-static"))
        ("network" :components ("network-note" "network-static"))
        ("all" :components ("cours" "misc" "jardinage"))))

Force pushing even if files didn’t change

(setq org-publish-use-timestamps-flag 'nil)

Honestly, I don’t remember those lines

(require 'ox-latex)
(add-to-list 'org-latex-packages-alist '("" "minted"))
(setq org-latex-listings 'minted)

(setq org-latex-pdf-process
      '("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
        "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
        "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"))

Presentation

Basic configuration for present-mode, stolen from daviwil configuration

(defun dw/org-present-prepare-slide ()
  (org-overview)
  (org-show-entry)
  (org-show-children)
  (outline-show-all))

(defun dw/org-present-hook ()
  (setq-local face-remapping-alist '((default (:height 1.5) variable-pitch)
                                     (header-line (:height 4.5) variable-pitch)
                                     (org-document-title (:height 1.75) org-document-title)
                                     (org-code (:height 1.55) org-code)
                                     (org-verbatim (:height 1.55) org-verbatim)
                                     (org-block (:height 1.25) org-block)
                                     (org-block-begin-line (:height 0.7) org-block)))
  (setq header-line-format " ")
  (org-display-inline-images)
  (dw/org-present-prepare-slide))

(defun dw/org-present-quit-hook ()
  (setq-local face-remapping-alist '((default variable-pitch default)))
  (setq header-line-format nil)
  (org-present-small)
  (org-remove-inline-images))

(defun dw/org-present-prev ()
  (interactive)
  (org-present-prev)
  (dw/org-present-prepare-slide))

(defun dw/org-present-next ()
  (interactive)
  (org-present-next)
  (dw/org-present-prepare-slide)
  (when (fboundp 'live-crafter-add-timestamp)
    (live-crafter-add-timestamp (substring-no-properties (org-get-heading t t t t)))))

(use-package org-present
  :bind (:map org-present-mode-keymap
         ("C-c C-j" . dw/org-present-next)
         ("C-c C-k" . dw/org-present-prev))
  :hook ((org-present-mode . dw/org-present-hook)
         (org-present-mode-quit . dw/org-present-quit-hook)))

Org customization

Remove bullets headline

(after! org
  (setq org-superstar-headline-bullets-list '("" "" "" "" "" "" "")))
(add-hook 'org-mode-hook 'org-superstar-mode)

Multiple display configuration

;; Multiple display configuration
(setq org-startup-indented t
      line-spacing 0.1
      org-bullets-bullet-list '(" ") ;; no bullets, needs org-bullets package
      org-ellipsis "" ;; folding symbol
      org-pretty-entities t
      org-hide-emphasis-markers t
      org-agenda-block-separator ""
      org-fontify-whole-heading-line t
      org-fontify-done-headline t
      org-fontify-quote-and-verse-blocks t)

Setup variable-pitch-mode inside org-mode

(add-hook 'org-mode-hook 'variable-pitch-mode)

Centaur-tabs

Modify visual tabs bar.

(setq centaur-tabs-set-bar 'under)
(setq x-underline-at-descent-line t)
(after! centaur-tabs (centaur-tabs-group-by-projectile-project))

Add bindings to navigate groups and tab.

(map! :leader :desc "Switch to next group" "t n" #'centaur-tabs-forward-group
      :leader :desc "Switch to previous group" "t p" #'centaur-tabs-backward-group
      :leader :desc "Create a new tab" "t t" #'centaur-tabs--create-new-tab
      :leader :desc "List groups" "t g" #'centaur-tabs-counsel-switch-group
      :leader :desc "Kill this buffer" "t k" #'centaur-tabs--kill-this-buffer-dont-ask
      :leader :desc "Kill all buffers in group" "t a" #'centaur-tabs-kill-all-buffers-in-current-group
      :leader :desc "Kill all buffers in group except current" "t e" #'centaur-tabs-kill-other-buffers-in-current-group)

Treemacs

Slightly increase treemacs width

(setq treemacs-width 25)

Mail

Reading mail with this configuration relies on offlineimap. Its goal is to download mails to be then be read by mu4e.

(setq +mu4e-backend 'offlineimap)

Set an email account

(set-email-account! "epita.fr"
  '((mu4e-sent-folder       . "/Sent")
    (mu4e-drafts-folder     . "/Drafts")
    (mu4e-trash-folder      . "/Trash")
    (mu4e-refile-folder     . "/INBOX")
    (mu4e-compose-signature . "Augustin Thiercelin")
    (smtpmail-smtp-user     . "augustin.thiercelin@epita.fr")
    (user-mail-address      . "augustin.thiercelin@epita.fr"))
  t)

Set mu4e default to send mail from emacs. Kill buffer after sending a mail, and use mu4e user agent.

(set-variable 'read-mail-command 'mu4e)
(setq message-kill-buffer-on-exit t)
(setq mail-user-agent 'mu4e-user-agent)

Set the smtp configuration to send mail

(setq gnus-select-method '(nntp "news.cri.epita.fr"))
(setq smtpmail-smtp-server "smtp.office365.com"
      smtpmail-stream-type 'starttls
      smtpmail-smtp-service 587)

Remove org-msg-mode when writing a mail. This mode is nice since it permits to write mail in org mode that will be then transformed into html, but it is useless when needing to send plain-text mails.

(remove-hook! 'mu4e-compose-pre-hook #'org-msg-mode)

org static blog

(setq org-static-blog-publish-title "blog n1tsu")
(setq org-static-blog-publish-url "https://blog.n1tsu.com/")
(setq org-static-blog-publish-directory "~/org/blog/")
(setq org-static-blog-posts-directory "~/org/blog/posts/")
(setq org-static-blog-drafts-directory "~/org/blog/drafts/")
(setq org-static-blog-enable-tags t)
(setq org-export-with-section-numbers nil)
(setq org-static-blog-use-preview t)

(setq org-static-blog-page-header
      "<meta name=\"author\" content=\"Augustin Thiercelin\">
<meta name=\"referrer\" content=\"no-referrer\">
<link href= \"static/style.css\" rel=\"stylesheet\" type=\"text/css\" />
<link rel=\"icon\" href=\"static/favicon.ico\">")

(setq org-static-blog-page-preamble
      "<div class=\"header\">
<a href=\"https://n1tsu.com\">Page principale</a> ; <a href=\"https://blog.n1tsu.com\">Index</a> ;</div>
<h1 class=\"main-title\">Cybercarnet</h1>
<div class=\"sub-body\">
")

(setq org-static-blog-page-postamble
      "</div><div class=\"love\"<center>Créé avec 💟 par GNU Emacs et 🦄 org mode</center></div>")

(setq org-static-blog-index-front-matter
      "")

(setq org-static-blog-langcode "fr")


(defun org-static-blog-post-preamble-override (post-filename)
  (concat
   "<h1 class=\"post-title\">"
   "<a href=\"" (org-static-blog-get-post-url post-filename) "\">" (org-static-blog-get-title post-filename) "</a>"
   "</h1>\n"
   "<div class=\"top-post\">"
   "<div class=\"post-date\"><" (format-time-string (org-static-blog-gettext 'date-format)
                                                   (org-static-blog-get-date post-filename))
   "></div>"
   "<div class=\"taglist\">" (org-static-blog-post-taglist post-filename) "</div></div>"))

(defun org-static-blog-post-postamble-override (post-filename)
  (if (string= org-static-blog-post-comments "")
      ""
    (concat "\n<div id=\"comments\">"
            org-static-blog-post-comments
            "</div>")))

(defun org-static-blog-get-preview-override (post-filename)
  (with-temp-buffer
    (insert-file-contents (org-static-blog-matching-publish-filename post-filename))
    (let ((post-title (org-static-blog-get-title post-filename))
          (post-date (org-static-blog-get-date post-filename))
          (post-taglist (org-static-blog-post-taglist post-filename))
          (post-ellipsis "")
          (preview-region (org-static-blog--preview-region)))
      (when (and preview-region (search-forward "<p>" nil t))
        (setq post-ellipsis
              (concat (when org-static-blog-preview-link-p
                        (format "<a href=\"%s\">"
                                (org-static-blog-get-post-url post-filename)))
                      org-static-blog-preview-ellipsis
                      (when org-static-blog-preview-link-p "</a>\n"))))
      ;; Put the substrings together.
      (let ((title-link
             (format "<h2 class=\"post-title\"><a href=\"%s\">%s</a></h2>"
                     (org-static-blog-get-post-url post-filename) post-title))
            (date-link
             (format-time-string (concat "<div class=\"post-date\"><"
                                         (org-static-blog-gettext 'date-format)
                                         "></div>")
                                 post-date)))
        (concat title-link "<div class=\"top-post\">" date-link
         (format "<div class=\"taglist\">%s</div>" post-taglist)
         "</div>"
         preview-region
         post-ellipsis)))))

(defun org-static-blog-post-taglist-override (post-filename)
  (let ((taglist-content "")
        (tags (remove org-static-blog-rss-excluded-tag
                      (org-static-blog-get-tags post-filename))))
    (when (and tags org-static-blog-enable-tags)
      (dolist (tag tags)
        (setq taglist-content (concat taglist-content "<a href=\""
                                      (org-static-blog-get-absolute-url (concat "tag-" (downcase tag) ".html"))
                                      "\">:" tag ":</a> "))))
    taglist-content))

(advice-add  'org-static-blog-post-preamble :override #'org-static-blog-post-preamble-override)
(advice-add  'org-static-blog-post-postamble :override #'org-static-blog-post-postamble-override)
(advice-add  'org-static-blog-get-preview :override #'org-static-blog-get-preview-override)
(advice-add  'org-static-blog-post-taglist :override #'org-static-blog-post-taglist-override)

Org roam UI

(use-package! websocket
    :after org-roam)

(use-package! org-roam-ui
    :after org-roam
    :config
    (setq org-roam-ui-sync-theme t
          org-roam-ui-follow t
          org-roam-ui-update-on-save t
          org-roam-ui-open-on-start t))

(defun org-roam-node-find-noselect (title)
  "Get a node ID by its title, whether original title or alias"
  (caar (org-roam-db-query [:select id
                            :from [:select [(as node_id id)
                                            (as alias title)]
                                   :from aliases
                                   :union-all
                                   :select [id title]
                                   :from nodes]
                            :where (= title $s1)
                            :limit 1] title)))

;; Temporary added this function removed from org-roam but needed for org-roam-ui
(defun org-roam-node-find-noselect (node &optional force)
  "Navigate to the point for NODE, and return the buffer.
If NODE is already visited, this won't automatically move the
point to the beginning of the NODE, unless FORCE is non-nil."
  (unless (org-roam-node-file node)
    (user-error "Node does not have corresponding file"))
  (let ((buf (find-file-noselect (org-roam-node-file node))))
    (with-current-buffer buf
      (when (or force
                (not (equal (org-roam-node-id node)
                            (org-roam-id-at-point))))
        (goto-char (org-roam-node-point node))))
    buf))

Programming

Add mode for Jinko

(require 'jinko-mode)

Configure debugger DAP

(after! dap-mode
  (setq dap-python-debugger 'debugpy)
  (setq dap-python-executable "python3"))

Configure LSP, add keybindings from this config

(setq lsp-keymap-prefix "C-c l")

(add-hook 'python-mode #'hs-minor-mode)

(map! :leader :desc "Hide current block" "a h" #'hs-hide-block
      :leader :desc "Show current block" "a s" #'hs-show-block
      :leader :desc "Hide all blocks" "a e" #'hs-hide-all
      :leader :desc "Show all blocks" "a r" #'hs-show-all)

(require 'openapi-viewer-mode)
(use-package lsp-ui
  :commands lsp-ui-mode
  :config
  (setq lsp-ui-sideline-enable nil
        lsp-ui-peek-enable t
        lsp-ui-doc-max-height 8
        lsp-ui-doc-max-width 35
        lsp-ui-doc-show-with-mouse nil
        lsp-ui-doc-position 'at-point
        lsp-ui-sideline-ignore-duplicate t
        lsp-ui-sideline-show-hover nil
        lsp-ui-doc-enable nil)
  :general
  (:keymaps 'lsp-mode-map
   [remap xref-find-definitions] #'lsp-ui-peek-find-definitions
   [remap xref-find-references] #'lsp-ui-peek-find-references)
  (:keymaps 'lsp-ui-peek-mode-map
   "j"   #'lsp-ui-peek--select-next
   "k"   #'lsp-ui-peek--select-prev
   "C-j" #'lsp-ui-peek--select-next-file
   "C-k" #'lsp-ui-peek--select-prev-file))
;; forge
(with-eval-after-load 'forge
  (push '("git.gatewatcher.com" "git.gatewatcher.com/api/v4"
          "git.gatewatcher.com" forge-gitlab-repository)
        forge-alist)
)
(with-eval-after-load 'code-review
  (setq code-review-gitlab-host "git.gatewatcher.com/api"
        code-review-gitlab-graphql-host "git.gatewatcher.com/api")
)
(setq code-review-log-raw-request-responses t)

About

Doom Emacs config files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published