From 55136714eaa77aeed751253ed453bc71ba7a6003 Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Wed, 30 Mar 2022 16:57:23 +0200 Subject: [PATCH 1/6] Relative line numbers --- config.org | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config.org b/config.org index 105a798..cb26a66 100644 --- a/config.org +++ b/config.org @@ -348,6 +348,12 @@ And disable this for some modes. (add-hook 'eww-mode-hook (lambda () (display-line-numbers-mode -1))) #+end_src +But when Emacs shows line numbers, they should be relative. Why? Ever tried =20j= in Evil mode or =C-u 20 C-p= in Emacs? + +#+begin_src emacs-lisp +(setq display-line-numbers-type 'relative) +#+end_src + ** Replace selected text by typing #+begin_src emacs-lisp From 66b7f9b05efa491b6b32064ac480e4e938a7cd89 Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Wed, 30 Mar 2022 16:57:54 +0200 Subject: [PATCH 2/6] [JS] Set indent to two --- config.org | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/config.org b/config.org index cb26a66..4eaaa1f 100644 --- a/config.org +++ b/config.org @@ -1609,6 +1609,13 @@ Source: [[https://github.com/ksjogo/typoscript-mode][GitHub: ksjogo/typoscript-m :mode "\\.typoscript\\'") #+end_src + +#+begin_src emacs-lisp +(use-package js + :config + (setq js-indent-level 2)) +#+end_src + ** YAML YAML major mode for Emacs. From f5260d33bf705276c61349bac288901a1c605a4b Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Wed, 30 Mar 2022 16:58:28 +0200 Subject: [PATCH 3/6] [work/mu4e] Set signature file --- config.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.org b/config.org index 4eaaa1f..d75ae7b 100644 --- a/config.org +++ b/config.org @@ -2132,7 +2132,7 @@ Now define the contexts. (string-prefix-p "/work" (mu4e-message-field msg :maildir)))) :vars '( ( user-mail-address . "m.kapfer@emplify-software.de" ) ( user-full-name . "Marcel Kapfer" ) - ( message-signature-file . nil) + ( message-signature-file . "~/dotfiles/dot-work/signature/mu4e") ( mu4e-sent-folder . "/work/Sent Items" ) ( mu4e-drafts-folder . "/work/Drafts" ) ( mu4e-trash-folder . "/work/Trash" ) From 576d74050e249cea8fd78db3946e0ca6c2df90e6 Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Wed, 30 Mar 2022 16:58:49 +0200 Subject: [PATCH 4/6] Add org-mime for HTML mails (needed for work signature) --- config.org | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/config.org b/config.org index d75ae7b..13d198b 100644 --- a/config.org +++ b/config.org @@ -2182,6 +2182,14 @@ Now define the contexts. ** Other settings +The [[https://github.com/org-mime/org-mime][org-mime]] package thankfully allows sending HTML mails from mu4e. Not that I like HTML mails but I need to have a special HTML message signature for work. + +#+begin_src emacs-lisp +(use-package org-mime + :after (org mu4e) + :config (setq org-mime-library 'mml)) +#+end_src + Mu4e displays a message in the minibuffer after refreshing. And since I run mbsync and mu index (through emacsclient) automatically every few minutes these messages can get quite distracting. Luckily mu4e provides an option to disable these index messages. #+begin_src emacs-lisp From f8e5e602d668ca903d3b2ec362396ca83d02324a Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Wed, 30 Mar 2022 16:59:46 +0200 Subject: [PATCH 5/6] [web-mode] Set indentation values --- config.org | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config.org b/config.org index 13d198b..54cf2dc 100644 --- a/config.org +++ b/config.org @@ -1595,7 +1595,11 @@ Source: [[https://github.com/fxbois/web-mode][GitHub: fxbois/web-mode]] ("\\.mustache\\'" . web-mode) ("\\.djhtml\\'" . web-mode) ("\\.vue\\'" . web-mode) - ("\\.blade\\.php\\'" . web-mode))) + ("\\.blade\\.php\\'" . web-mode)) + :config + (setq web-mode-script-padding 0) + (setq web-mode-code-indent-offset 2) + (setq web-mode-markup-indent-offset 2)) #+end_src ** TypoScript From cf47b7f750f92af60ecad793dd99ba538e5dbcff Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Wed, 30 Mar 2022 17:01:27 +0200 Subject: [PATCH 6/6] [org] Move font size adjustments to functions This makes it possible to re-apply the adjustments after a theme switch which resets font adjustmenst. --- config.org | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/config.org b/config.org index 54cf2dc..c1bdd2e 100644 --- a/config.org +++ b/config.org @@ -473,7 +473,9 @@ During the last weeks I got used to using a light theme during daytime and a dar (defun mmk2410/switch-theme (theme) (mapcar 'disable-theme custom-enabled-themes) - (load-theme theme t)) + (load-theme theme t) + (mmk2410/org-font-adjust-headlines) + (mmk2410/org-font-adjust-variable-pitch)) (defun mmk2410/switch-theme-night () (interactive) @@ -874,7 +876,8 @@ Hide emphasis markers. While this sometimes is very distracting it mostly looks I like to have larger headlines in Org for better identifying them. The configuration of [[https://config.daviwil.com/emacs#fonts-and-bullets][David Wilson]] was a large help in this regard. #+begin_src emacs-lisp -(with-eval-after-load 'org +(defun mmk2410/org-font-adjust-headlines () + "Adjust headline sizes, font family and weight" (dolist (face '((org-level-1 . 1.4) (org-level-2 . 1.3) (org-level-3 . 1.2) @@ -885,12 +888,15 @@ I like to have larger headlines in Org for better identifying them. The configur (org-level-8 . 1.1))) (set-face-attribute (car face) nil :font "Open Sans" :weight 'bold :height (cdr face)))) +(with-eval-after-load 'org + (mmk2410/org-font-adjust-headlines)) #+end_src When using a variable-pitch font this also applies to stuff like code blocks. The following block resets this change for these unwanted faces. #+begin_src emacs-lisp -(with-eval-after-load 'org +(defun mmk2410/org-font-adjust-variable-pitch () + "Re-delare certain org font as fixed pitch when using variable pitch mode." (org-indent-mode) (set-face-attribute 'org-block nil :foreground nil :inherit 'fixed-pitch) (set-face-attribute 'org-code nil :inherit '(shadow fixed-pitch)) @@ -899,6 +905,9 @@ When using a variable-pitch font this also applies to stuff like code blocks. Th (set-face-attribute 'org-special-keyword nil :inherit '(font-lock-comment-face fixed-pitch)) (set-face-attribute 'org-meta-line nil :inherit '(font-lock-comment-face fixed-pitch)) (set-face-attribute 'org-checkbox nil :inherit 'fixed-pitch)) + +(with-eval-after-load 'org + (mmk2410/org-font-adjust-variable-pitch)) #+end_src ** Org Superstar Mode