/doom

My Doom Emacs config

Primary LanguageEmacs Lisp

Emacs Config

Table of contents

Apperance

Adjusting theme, fonts and other utils.

(setq doom-theme 'modus-vivendi-tinted)
(setq display-line-numbers-type 'relative)
(setq doom-font (font-spec :family "Iosevka" :size 25 :weight 'medium))
(setq org-pretty-entities t)

Keybindings

Most of the keybindings I use are default ones, but there are some exceptions.

COMMANDDESCRIPTIONKEYBINDING
eshellOpen terminalSPC o t
next-bufferSwitch to next buffer[tab]
previous-bufferSwitch to prev buffer[backtab]
poetry run current_fileRun current python file in poetry envSPC c p
window-downSelect window downCTRL-j
window-upSelect window upCTRL-k
window-leftSelect window leftCTRL-l
window-rightSelect window rightCTRL-r
show-moonlander-layoutOpen keyboard layoutSPC k h
(map! :leader
      :desc "Terminal" "o t" #'eshell)

(map! :n [tab] #'next-buffer
      :n [backtab] #'previous-buffer)

(map! :leader
      :desc "Run Python script with Poetry" "c p" #'my/run-python-script-with-poetry)

(map! :g "C-j" #'evil-window-down
      :g "C-k" #'evil-window-up
      :g "C-h" #'evil-window-left
      :g "C-l" #'evil-window-right)

(map! :after rustic
      :map rustic-mode-map
      :localleader
      "b" #'rustic-cargo-build
      "c" #'rustic-cargo-clippy
      "t" #'rustic-cargo-test
      "r" #'rustic-cargo-run)

Python

Setting ipython3 as default REPL and some extra settings for poetry

(use-package! poetry
  :hook (python-mode . poetry-tracking-mode))

(defun my/run-python-script-with-poetry ()
  "Run current buffer's Python script with Poetry."
  (interactive)
  (compile (concat "poetry run python " (shell-quote-argument (buffer-file-name)))))

(map! :leader
      :desc "Run Python script with Poetry" "c p" #'my/run-python-script-with-poetry)



(after! python
  (setq python-shell-interpreter "ipython3"
        python-shell-interpreter-args "-i --simple-prompt"))

Rust

Mostly making rustic buffers to my taste

(after! rustic
(set-popup-rule! "*rustic-compilation*" :ignore nil :actions: nil :side 'right :width 0.4 :quit 'current :select t :slot -1)
(set-popup-rule! "*cargo-run*" :ignore nil :actions: nil :side 'right :width 0.4 :quit 'current :select t :slot -1)
(set-popup-rule! "*cargo-build*" :ignore nil :actions: nil :side 'right :width 0.4 :quit 'current :select t :slot -1)
(set-popup-rule! "*cargo-test*" :ignore nil :actions: nil :side 'right :width 0.4 :quit 'current :select t :slot -1)
(set-popup-rule! "*cargo-clippy*" :ignore nil :actions: nil :side 'right :width 0.4 :quit 'current :select t :slot -1)
)

Wakatime

If I live 3 times longer than @sunsided, maybe I can catch up

(use-package! wakatime-mode
  :config
  (global-wakatime-mode))

Dashboard

Just setting a dashboard image

(setq fancy-splash-image (concat doom-private-dir "banners/banner.svg"))

Clippy

(map! :leader
      (:prefix ("c h" . "Help info from Clippy")
       :desc "Clippy describes function under point" "f" #'clippy-describe-function
       :desc "Clippy describes variable under point" "v" #'clippy-describe-variable))

Cursor

(setq evil-normal-state-cursor '(box "light blue")
      evil-insert-state-cursor '(box "medium sea green")
      evil-visual-state-cursor '(hollow "orange"))

Moonlander Layout

(defun show-moonlander-layout()
  "Display my current moonlander keyboard layout"
  (interactive)
  (find-file-read-only-other-window "/home/philipp/Pictures/util/moonlander_layout.png")
  )
(set-popup-rule! "^moonlander-layout\\.jpg$" :ignore nil :actions nil :quit 'current :select t)

(map! :leader
      (:prefix ("k" . "Keyboard")
       :desc "Show Moonlander Layout" "h" #'show-moonlander-layout))