dotfiles

My personal shell configs and stuff
git clone git://git.alex.balgavy.eu/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

commit 8734af60533610ee27f496da02bbe01d28531729
parent 5bbd9ae1d2be7ff2205fde498194b9908743e7f2
Author: Alex Balgavy <alex@balgavy.eu>
Date:   Sat,  3 Jul 2021 19:37:53 +0200

emacs: add some settings from better-defaults

This repo here https://git.sr.ht/~technomancy/better-defaults

Diffstat:
Mdot.map | 1+
Memacs/config.org | 59+++++++++++++++++++++++++++++++++++++++++++++++++++++------
Aemacs/custom.el | 19+++++++++++++++++++
Memacs/init.el | 19-------------------
4 files changed, 73 insertions(+), 25 deletions(-)

diff --git a/dot.map b/dot.map @@ -73,6 +73,7 @@ Xresources: ~/.Xresources emacs: - config.org: ~/.emacs.d/config.org - init.el: ~/.emacs.d/init.el +- custom.el: ~/.emacs.d/custom.el # Config: shell shell: diff --git a/emacs/config.org b/emacs/config.org @@ -246,8 +246,8 @@ #+end_src Maybe at some point I'll customize the modeline too. - -* Auto-Save files +* File locations +** Auto-Save files By default, auto-save files ("#file#") are placed in the same directory as the file itself. I want to put this all in some unified place: @@ -256,7 +256,7 @@ `((".*" "~/.local/share/emacs/saves/" t))) #+end_src -* Backup files +** Backup files By default, backup files (those with a tilde) are saved in the same directory as the currently edited file. This setting puts them in ~/.local/share/emacs/backups. @@ -265,6 +265,16 @@ (setq backup-by-copying t) #+end_src +** Custom settings file +Both commands are necessary. +First one tells Emacs where to save customizations. +The second one actually loads them. + +#+begin_src emacs-lisp + (setq custom-file (expand-file-name "~/.emacs.d/custom.el")) + (load custom-file) +#+end_src + * Editor ** Strip trailing whitespace You can show trailing whitespace by setting show-trailing-whitespace to 't'. @@ -275,10 +285,26 @@ (add-hook 'before-save-hook 'delete-trailing-whitespace) #+end_src ** Auto-formatting - Disable fill mode in Markdown +Disable fill mode in Markdown + +#+begin_src emacs-lisp + (add-hook 'markdown-mode-hook (lambda () (auto-fill-mode 0) (flyspell-mode 1))) +#+end_src + +Never insert tabs with indentation: + +#+begin_src emacs-lisp + (setq-default indent-tabs-mode nil) +#+end_src - #+begin_src elisp - (add-hook 'markdown-mode-hook (lambda () (auto-fill-mode 0) (flyspell-mode 1))) +** Wrapping + I want to wrap text at window boundary for some modes: + + #+begin_src emacs-lisp + (add-hook 'org-mode-hook (lambda () + (visual-line-mode) + (org-indent-mode))) + (add-hook 'markdown-mode-hook (lambda () (visual-line-mode))) #+end_src ** Pulse line @@ -319,6 +345,23 @@ #+begin_src emacs-lisp (add-to-list 'auto-mode-alist '("/neomutt-" . mail-mode)) #+end_src +** Zap up to char +It's more useful for me to be able to delete up to a character instead of to and including a character: + +#+begin_src emacs-lisp + (global-set-key (kbd "M-z") 'zap-up-to-char) +#+end_src +** Expand +Use hippie expand instead of dabbrev-expand: + +#+begin_src emacs-lisp + (global-set-key (kbd "M-/") 'hippie-expand) +#+end_src + +** Prefer newer file loading +#+begin_src emacs-lisp +(setq load-prefer-newer t) +#+end_src * Misc settings ** Enable all commands @@ -328,6 +371,10 @@ #+begin_src emacs-lisp (setq disabled-command-function nil) #+end_src +** More extensive apropos +#+begin_src emacs-lisp +(setq apropos-do-all t) +#+end_src * References Here's a list of good articles I encountered about configging emacs: diff --git a/emacs/custom.el b/emacs/custom.el @@ -0,0 +1,19 @@ +(custom-set-variables + ;; custom-set-variables was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(custom-safe-themes + '("8f5a7a9a3c510ef9cbb88e600c0b4c53cdcdb502cfe3eb50040b7e13c6f4e78e" "4bca89c1004e24981c840d3a32755bf859a6910c65b829d9441814000cf6c3d0" "f2927d7d87e8207fa9a0a003c0f222d45c948845de162c885bf6ad2a255babfd" "e3c64e88fec56f86b49dcdc5a831e96782baf14b09397d4057156b17062a8848" "f4876796ef5ee9c82b125a096a590c9891cec31320569fc6ff602ff99ed73dca" default)) + '(package-hidden-regexps '("^I")) + '(package-selected-packages + '(vterm notmuch magit lean-mode markdown-mode anki-connect anki-editor doom-themes all-the-icons use-package-ensure which-key use-package org-bullets helm exec-path-from-shell))) +(custom-set-faces + ;; custom-set-faces was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(helm-buffer-file ((t (:inherit default)))) + '(helm-ff-file-extension ((t (:inherit default)))) + '(helm-non-file-buffer ((t (:inherit font-lock-comment-face)))) + '(pulse-highlight-start-face ((t (:background "CadetBlue2"))))) diff --git a/emacs/init.el b/emacs/init.el @@ -3,22 +3,3 @@ (org-babel-load-file (expand-file-name "config.org" user-emacs-directory)) - -(custom-set-variables - ;; custom-set-variables was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - '(custom-safe-themes - '("8f5a7a9a3c510ef9cbb88e600c0b4c53cdcdb502cfe3eb50040b7e13c6f4e78e" "4bca89c1004e24981c840d3a32755bf859a6910c65b829d9441814000cf6c3d0" "f2927d7d87e8207fa9a0a003c0f222d45c948845de162c885bf6ad2a255babfd" "e3c64e88fec56f86b49dcdc5a831e96782baf14b09397d4057156b17062a8848" "f4876796ef5ee9c82b125a096a590c9891cec31320569fc6ff602ff99ed73dca" default)) - '(package-selected-packages - '(vterm notmuch magit lean-mode markdown-mode anki-connect anki-editor doom-themes all-the-icons use-package-ensure which-key use-package org-bullets helm exec-path-from-shell))) -(custom-set-faces - ;; custom-set-faces was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - '(helm-buffer-file ((t (:inherit default)))) - '(helm-ff-file-extension ((t (:inherit default)))) - '(helm-non-file-buffer ((t (:inherit font-lock-comment-face)))) - '(pulse-highlight-start-face ((t (:background "CadetBlue2")))))