summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKévin Le Gouguec <kevin.legouguec@gmail.com>2021-03-17 12:48:00 +0100
committerKévin Le Gouguec <kevin.legouguec@gmail.com>2021-03-17 12:48:00 +0100
commit5d5060a5da9eee99cdd50bc477e70d3c1d0ef38f (patch)
treeddba2c25292dac572003acf1a74af5a779a72a9f
parent60e7992b11b6f41229af105035d1a04da716d732 (diff)
downloaddotfiles-5d5060a5da9eee99cdd50bc477e70d3c1d0ef38f.tar.xz
Commit a collection of tweaks to Emacs config
-rw-r--r--.emacs35
-rw-r--r--.emacs-custom.el1
-rw-r--r--.gnus2
-rwxr-xr-x.local/bin/emacs-build2
4 files changed, 36 insertions, 4 deletions
diff --git a/.emacs b/.emacs
index 7d3e54d..2b6c443 100644
--- a/.emacs
+++ b/.emacs
@@ -96,6 +96,22 @@
(set-variable 'tab-width new-width)
(message "changed from %s to %s" old-width new-width)))
+(defun my/center-window (text-width)
+ (interactive
+ (list (cond
+ ;; Explicit length.
+ ((integerp current-prefix-arg)
+ current-prefix-arg)
+ ;; C-u.
+ ((and (listp current-prefix-arg) current-prefix-arg)
+ nil)
+ ;; Default.
+ (80))))
+ (let ((margin-width (when text-width
+ (/ (- (window-width) text-width) 2))))
+ ;; Only set left margin, so that long lines are not truncated.
+ (set-window-margins nil margin-width)))
+
(defun my/kill (stuff)
(kill-new stuff)
(message stuff))
@@ -149,7 +165,8 @@
(my/define-prefix-command my/display-map
"Keymap for display-related commands."
- '(("t" toggle-truncate-lines)
+ '(("c" my/center-window)
+ ("t" toggle-truncate-lines)
("v" visual-line-mode)))
(my/define-prefix-command my/editing-map
@@ -177,7 +194,8 @@
(my/define-prefix-command my/manual-map
"Keymap for reading manuals."
'(("i" info-display-manual)
- ("m" man)))
+ ("m" man)
+ ("s" shortdoc-display-group)))
(my/define-prefix-command my/project-map
"Keymap for project-related commands."
@@ -274,6 +292,8 @@
;; in stone, and I would miss out on future updates by Magit.
(add-hook 'git-commit-setup-hook 'git-commit-turn-on-flyspell)
+(setq magit-process-finish-apply-ansi-colors t)
+
(defun my/revision-at-point ()
(cond
((derived-mode-p 'magit-mode)
@@ -490,4 +510,15 @@
(setq-default paragraph-start (concat "[ ]*- \\|" paragraph-start))
+(defun my/screenshot (output)
+ (interactive
+ (list
+ (let ((default (format-time-string "/tmp/Emacs-Screenshot-%F-%T.pdf")))
+ (read-file-name (format-prompt "Output?" default) nil default))))
+ (let ((data (x-export-frames))
+ (buf (find-file output)))
+ (insert data)
+ (save-buffer)
+ (kill-buffer buf)))
+
;; TODO: decruftify mode-line (e.g. remove superflous parens)
diff --git a/.emacs-custom.el b/.emacs-custom.el
index bc23047..de7a8b0 100644
--- a/.emacs-custom.el
+++ b/.emacs-custom.el
@@ -93,6 +93,7 @@
'(tool-bar-mode nil)
'(truncate-lines t)
'(visual-line-fringe-indicators '(left-curly-arrow right-curly-arrow))
+ '(what-cursor-show-names t)
'(which-key-idle-delay 0.5)
'(which-key-mode t)
'(whitespace-style
diff --git a/.gnus b/.gnus
index bc0d5e7..64ed762 100644
--- a/.gnus
+++ b/.gnus
@@ -51,7 +51,7 @@
"aw" "Aw" "AW"
(seq "bug#" (+ digit))
(seq "[" (+ word) "]"))
- (? (* space) ":" (* space)))))
+ (? (* space) (? ":") (* space)))))
(let* ((initials (mapconcat (lambda (s) (substring s 0 1))
(split-string user-full-name)
diff --git a/.local/bin/emacs-build b/.local/bin/emacs-build
index c367bfe..20b9fba 100755
--- a/.local/bin/emacs-build
+++ b/.local/bin/emacs-build
@@ -26,4 +26,4 @@ then
./configure ${configure_flags}
fi
-${make}
+${make} "$@"