diff options
author | bd <bdunahu@gmail.com> | 2024-01-05 20:52:16 -0700 |
---|---|---|
committer | bd <bdunahu@gmail.com> | 2024-01-05 20:52:16 -0700 |
commit | 553a287b4ff7d8129870075acfb8422882dc3395 (patch) | |
tree | 6d0c5ba518bb4f813fd2e34c33021786beed15b1 /.config/emacs/bd-default.el | |
parent | b05329a5092fa19e69fd623548e83dd43eb18e5e (diff) |
Eshell correct path, auto-cleanup files, and more
Diffstat (limited to '.config/emacs/bd-default.el')
-rw-r--r-- | .config/emacs/bd-default.el | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/.config/emacs/bd-default.el b/.config/emacs/bd-default.el index 7d86347..8891822 100644 --- a/.config/emacs/bd-default.el +++ b/.config/emacs/bd-default.el @@ -15,6 +15,12 @@ ;;;; functions +(defun cleanup-buffer () + (interactive) + (delete-trailing-whitespace) + (untabify (point-min) (point-max)) + (indent-region (point-min) (point-max))) + (defun clamp (lower-bound upper-bound value) (max lower-bound (min value upper-bound))) @@ -59,6 +65,10 @@ open URL at point." (global-auto-revert-mode 1) (winner-mode 1) +;; messy editing + cleanup buffers on save +(setopt next-line-add-newlines t) +(add-hook 'before-save-hook 'cleanup-buffer) + ;; prompts (setopt use-short-answers t) (setopt vc-follow-symlinks t) |