diff options
| -rw-r--r-- | .emacs | 35 | ||||
| -rw-r--r-- | .emacs-custom.el | 1 | ||||
| -rw-r--r-- | .gnus | 2 | ||||
| -rwxr-xr-x | .local/bin/emacs-build | 2 |
4 files changed, 36 insertions, 4 deletions
@@ -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 @@ -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} "$@" |
