diff options
Diffstat (limited to '.config/emacs/init.el')
| -rw-r--r-- | .config/emacs/init.el | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 3fe49c6..1d3f1e7 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -158,6 +158,20 @@ left-margin))) (set-window-margins window left-margin right-margin)))) +(defun my/auto-hscroll-toggle () + (interactive) + ;; Use indices to avoid confusing `if-let*' with nil. + (if-let* ((values '(nil t current-line)) + (prev (seq-position values auto-hscroll-mode)) + (next (% (1+ prev) (length values)))) + (progn + (message (concat + (propertize (format "%s" (nth prev values)) 'face 'shadow) + " → " + (propertize (format "%s" (nth next values)) 'face 'bold))) + (setopt auto-hscroll-mode (nth next values))) + (error "Unknown value for auto-hscroll-mode: %s" auto-hscroll-mode))) + (defun my/kill (stuff) (kill-new stuff) (message "%s" stuff)) @@ -280,6 +294,7 @@ list and require no escaping." (my/define-prefix-command my/display-map "Keymap for display-related commands." '(("c" my/centered-mode) + ("h" my/auto-hscroll-toggle) ("l" hl-line-mode) ("n" display-line-numbers-mode) ("t" toggle-truncate-lines) @@ -751,6 +766,10 @@ UPSTREAMS is a list of fetch URLs." (my/setopt-update-list package-archives '(("melpa" . "https://melpa.org/packages/")))) +(use-package emacs + :custom + (auto-hscroll-mode 'current-line)) + (use-package calendar :custom (calendar-intermonth-text '(my/calendar-iso-week year month day)) |
