Skip to content
Extraits de code Groupes Projets
Vérifiée Valider f774eda0 rédigé par Kubat's avatar Kubat
Parcourir les fichiers

Use the org thing to generate the configuration file without the comments

parent 3258df8c
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
#+TITLE: Doom's configuration
#+PROPERTY: header-args :tangle config.el
* Table of Contents :TOC_3:noexport:
- [[#description][Description]]
- [[#simple-configuration-rules][Simple configuration rules]]
- [[#font-settings][Font settings]]
- [[#packages-configuration][Packages configuration]]
- [[#custom-package-imports][Custom package imports]]
- [[#plain-text-file-configuration][Plain text file configuration]]
- [[#org-mode-configuration][Org mode configuration]]
- [[#custom-key-bindings][Custom key bindings]]
- [[#help][Help]]
* Description
My configuration of Doom Emacs.
Don't forget to =pip install cmake-language-server= before installing Emacs for
the CMake LSP thing to work.
** Simple configuration rules
This is done to ensure natural split and that mathematical things use radians
instead of degrees. The simple doom theme is used because it's pretty enough.
#+begin_src emacs-lisp
(setq user-full-name "Maël MARTIN"
user-mail-address "mael.martin@protonmail.com"
truncate-string-ellipsis "…"
evil-vsplit-window-right t
evil-split-window-below t
calc-angle-mode 'rad
calc-symbolic-mode t
display-line-numbers-type t
doom-theme 'doom-one
)
#+end_src
* Font settings
I prefer Fira Code, but ligatures are not handled correctly for now...
#+begin_src emacs-lisp
(setq doom-font (font-spec :family "Fira Code" :size 12 :weight 'medium)
doom-variable-pitch-font (font-spec :family "Fira Code" :size 12)
doom-big-font (font-spec :family "Fira Code" :size 14))
(after! doom-theme
(setq doom-themes-enable-bold t
doom-themes-enable-italic t))
(custom-set-faces!
'(font-lock-comment-face :slant italic)
'(font-lock-keyword-face :slant italic))
(custom-set-faces
'(org-level-1 ((t (:inherit outline-1 :height 1.2))))
'(org-level-2 ((t (:inherit outline-2 :height 1.0))))
'(org-level-3 ((t (:inherit outline-3 :height 1.0))))
'(org-level-4 ((t (:inherit outline-4 :height 1.0))))
'(org-level-5 ((t (:inherit outline-5 :height 1.0)))))
#+end_src
* Packages configuration
** Custom package imports
#+begin_src emacs-lisp
(load! "packages/porth-mode.el")
#+end_src
** Plain text file configuration
Even with plain text we can do some things.
#+begin_src emacs-lisp
(set-file-template! "\\.tex$" :trigger "__" :mode 'latex-mode)
(set-file-template! "\\.org$" :trigger "__" :mode 'org-mode)
(set-file-template! "/LICEN[CS]E$" :trigger '+file-templates/insert-license)
#+end_src
** Org mode configuration
Simply configure the org mode. Everything is placed inside =~/org/=. We also load
the custom bullets mode.
#+begin_src emacs-lisp
(add-hook 'org-mode-hook 'org-indent-mode)
(setq org-directory "~/org/"
org-agenda-files '("~/org/agenda.org")
org-default-notes-file (expand-file-name "notes.org" org-directory)
org-ellipsis " ▼ "
org-log-done 'time
org-journal-dir "~/org/journal/"
org-journal-date-format "%B %d, %Y (%A) "
org-journal-file-format "%Y-%m-%d.org"
org-hide-emphasis-markers t)
(setq org-src-preserve-indentation nil
org-src-tab-acts-natively t
org-edit-src-content-indentation 0)
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))
#+end_src
* Custom key bindings
#+begin_src emacs-lisp
(map! :leader "b o" #'org-mode :desc "Switch buffer type to 'org-mode'")
(global-set-key (kbd "C-=") 'text-scale-increase)
(global-set-key (kbd "C--") 'text-scale-decrease)
#+end_src
* Help
This help was found in the original =config.el= file.
- =load!= for loading external =*.el= files relative to this one
- =use-package!= for configuring packages
- =after!= for running code after a package has loaded
- =add-load-path!= for adding directories to the =load-path=, relative to this file.
Emacs searches the =load-path= when you load packages with =require= or =use-package=.
- =map!= for binding new keys
To get information about any of these functions/macros, move the cursor over the
highlighted symbol at press =K= (non-evil users must press =C-c c k=). This will
open documentation for it, including demos of how they are used.
You can also try =gd= (or =C-c c d=) to jump to their definition and see how they
are implemented.
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
;; Place your private configuration here! Remember, you do not need to run 'doom
;; sync' after modifying this file!
;; Notes:
;; * Don't forget to =pip install cmake-language-server=
;; Some functionality uses this to identify you, e.g. GPG configuration, email
;; clients, file templates and snippets.
(setq user-full-name "Maël MARTIN" (setq user-full-name "Maël MARTIN"
user-mail-address "mael.martin@protonmail.com" user-mail-address "mael.martin@protonmail.com"
truncate-string-ellipsis "…" ; replace '...' by the utf8 character truncate-string-ellipsis "…"
evil-vsplit-window-right t ; natural splits evil-vsplit-window-right t
evil-split-window-below t ; natural splits evil-split-window-below t
calc-angle-mode 'rad ; radians are rad calc-angle-mode 'rad
calc-symbolic-mode t ; keeps expressions like \sqrt{2} irrational for as long as possible calc-symbolic-mode t
display-line-numbers-type t
doom-theme 'doom-one
) )
;; Set Doom fonts
(setq doom-font (font-spec :family "Fira Code" :size 12 :weight 'medium) (setq doom-font (font-spec :family "Fira Code" :size 12 :weight 'medium)
doom-variable-pitch-font (font-spec :family "Fira Code" :size 12) doom-variable-pitch-font (font-spec :family "Fira Code" :size 12)
doom-big-font (font-spec :family "Fira Code" :size 14)) doom-big-font (font-spec :family "Fira Code" :size 14))
(after! doom-theme (after! doom-theme
(setq doom-themes-enable-bold t (setq doom-themes-enable-bold t
doom-themes-enable-italic t)) doom-themes-enable-italic t))
(custom-set-faces! (custom-set-faces!
'(font-lock-comment-face :slant italic) '(font-lock-comment-face :slant italic)
'(font-lock-keyword-face :slant italic)) '(font-lock-keyword-face :slant italic))
;; Set theme. Either `doom-theme' or `load-theme' (custom-set-faces
(setq doom-theme 'doom-one) '(org-level-1 ((t (:inherit outline-1 :height 1.2))))
'(org-level-2 ((t (:inherit outline-2 :height 1.0))))
'(org-level-3 ((t (:inherit outline-3 :height 1.0))))
'(org-level-4 ((t (:inherit outline-4 :height 1.0))))
'(org-level-5 ((t (:inherit outline-5 :height 1.0)))))
;; Line numbering: nil | relative | t (true) (load! "packages/porth-mode.el")
(setq display-line-numbers-type t)
;; Zoom key-bindings (set-file-template! "\\.tex$" :trigger "__" :mode 'latex-mode)
(global-set-key (kbd "C-=") 'text-scale-increase) (set-file-template! "\\.org$" :trigger "__" :mode 'org-mode)
(global-set-key (kbd "C--") 'text-scale-decrease) (set-file-template! "/LICEN[CS]E$" :trigger '+file-templates/insert-license)
(global-set-key (kbd "<C-wheel-up>") 'text-scale-increase)
(global-set-key (kbd "<C-wheel-down>") 'text-scale-decrease)
;; Things for the ORG mode
(add-hook 'org-mode-hook 'org-indent-mode) (add-hook 'org-mode-hook 'org-indent-mode)
(setq org-directory "~/org/" (setq org-directory "~/org/"
org-agenda-files '("~/org/agenda.org") org-agenda-files '("~/org/agenda.org")
...@@ -51,35 +43,13 @@ ...@@ -51,35 +43,13 @@
org-journal-date-format "%B %d, %Y (%A) " org-journal-date-format "%B %d, %Y (%A) "
org-journal-file-format "%Y-%m-%d.org" org-journal-file-format "%Y-%m-%d.org"
org-hide-emphasis-markers t) org-hide-emphasis-markers t)
(setq org-src-preserve-indentation nil (setq org-src-preserve-indentation nil
org-src-tab-acts-natively t org-src-tab-acts-natively t
org-edit-src-content-indentation 0) org-edit-src-content-indentation 0)
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))
;; Custom font sizes for the headings (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))
(custom-set-faces
'(org-level-1 ((t (:inherit outline-1 :height 1.2))))
'(org-level-2 ((t (:inherit outline-2 :height 1.0))))
'(org-level-3 ((t (:inherit outline-3 :height 1.0))))
'(org-level-4 ((t (:inherit outline-4 :height 1.0))))
'(org-level-5 ((t (:inherit outline-5 :height 1.0)))))
;; Custom packages
(load! "packages/porth-mode.el")
;; Here are some additional functions/macros that could help you configure Doom: (map! :leader "b o" #'org-mode :desc "Switch buffer type to 'org-mode'")
;; (global-set-key (kbd "C-=") 'text-scale-increase)
;; - `load!' for loading external *.el files relative to this one (global-set-key (kbd "C--") 'text-scale-decrease)
;; - `use-package!' for configuring packages
;; - `after!' for running code after a package has loaded
;; - `add-load-path!' for adding directories to the `load-path', relative to
;; this file. Emacs searches the `load-path' when you load packages with
;; `require' or `use-package'.
;; - `map!' for binding new keys
;;
;; To get information about any of these functions/macros, move the cursor over
;; the highlighted symbol at press 'K' (non-evil users must press 'C-c c k').
;; This will open documentation for it, including demos of how they are used.
;;
;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how
;; they are implemented.
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter