From aec6fe61aca37317eb024a894a676695fa7de0ee Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 24 Aug 2021 20:15:53 -0500 Subject: Fix long-standing eshell binding bug --- init.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.el b/init.el index 3266f92..3d15c05 100644 --- a/init.el +++ b/init.el @@ -372,7 +372,7 @@ Most customizations must go in this function since `eshell' loads like a dumbass." ;; Define keys (dolist (spec '(("C-d" . eshell-quit-or-delete-char))) - (define-key eshell-mode-map (kbd (car spec)) (function (cdr spec)))) + (define-key eshell-mode-map (kbd (car spec)) (cdr spec))) ;; Fix modeline (when (boundp 'simple-modeline--mode-line) (setq mode-line-format '(:eval simple-modeline--mode-line))) -- cgit 1.4.1-21-gabe81 From 28a900fe2a74dd737dd2ed2222a24ee15eafe523 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 24 Aug 2021 20:16:11 -0500 Subject: Define page-delimiter in eshell --- init.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/init.el b/init.el index 3d15c05..caa5c51 100644 --- a/init.el +++ b/init.el @@ -376,8 +376,9 @@ like a dumbass." ;; Fix modeline (when (boundp 'simple-modeline--mode-line) (setq mode-line-format '(:eval simple-modeline--mode-line))) - ;; Set outline-regexp for consult-outline - (setq outline-regexp eshell-prompt-regexp)) + ;; Make navigating amongst prompts easier + (setq-local outline-regexp eshell-prompt-regexp + page-delimiter eshell-prompt-regexp)) (defun eshell-buffer-name () (rename-buffer (concat "*eshell*<" (eshell/pwd) ">") t)) -- cgit 1.4.1-21-gabe81 From e7437b1f7035baf9825778446efd05c6cc407470 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 24 Aug 2021 21:24:43 -0500 Subject: Fix ibuffer hook --- init.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.el b/init.el index caa5c51..9f4b570 100644 --- a/init.el +++ b/init.el @@ -508,6 +508,7 @@ like a dumbass." (add-hook 'prog-mode-hook #'goto-address-prog-mode)) (setup ibuffer + (:also-load ibuf-ext) (:option ibuffer-saved-filter-groups '(("default" ("dired" (mode . dired-mode)) @@ -544,11 +545,10 @@ like a dumbass." (interactive "P") (if arg (ibuffer) (electric-buffer-list nil)))) - (add-hook 'ibuffer-mode + (add-hook 'ibuffer-mode-hook (defun ibuffer@filter-to-default () (ibuffer-switch-to-saved-filter-groups "default"))) - (:also-load ibuf-ext) (:option ibuffer-show-empty-filter-groups nil ibuffer-expert t)) -- cgit 1.4.1-21-gabe81 From 8d9ebc1b86f7b3cbdf2086fec9f92e5ad277e182 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 24 Aug 2021 21:24:52 -0500 Subject: Change helpful-switch-to-buffer-function about to use popper.el..... --- init.el | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/init.el b/init.el index 9f4b570..5d601a8 100644 --- a/init.el +++ b/init.el @@ -1199,14 +1199,15 @@ successive invocations." (setup (:straight helpful) (:option helpful-max-buffers 5 - ;;helpful-switch-buffer-function #'pop-to-buffer - helpful-switch-buffer-function - (lambda (buf) - (pop-to-buffer buf - '((display-buffer-reuse-mode-window - display-buffer-pop-up-window) - (mode . helpful-mode)) - :norecord))) + helpful-switch-buffer-function #'pop-to-buffer + ;; helpful-switch-buffer-function + ;; (lambda (buf) + ;; (pop-to-buffer buf + ;; '((display-buffer-reuse-mode-window + ;; display-buffer-pop-up-window) + ;; (mode . helpful-mode)) + ;; :norecord)) + ) (:global " f" helpful-callable " v" helpful-variable " k" helpful-key -- cgit 1.4.1-21-gabe81 From da40526c8a93895b20bf7f8f292a1ace9bf9df07 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 24 Aug 2021 23:01:20 -0500 Subject: Setup `repeat-mode' real nice like --- init.el | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- lisp/acdw.el | 13 ++++++++++ 2 files changed, 93 insertions(+), 3 deletions(-) diff --git a/init.el b/init.el index 5d601a8..967be23 100644 --- a/init.el +++ b/init.el @@ -676,7 +676,12 @@ like a dumbass." (recentf-mode +1)) (setup repeat + ;; new for Emacs 28! (:only-if (fboundp #'repeat-mode)) + + (:option repeat-exit-key "g" + repeat-exit-timeout 5) + (repeat-mode +1)) (setup (:require savehist) @@ -819,9 +824,69 @@ like a dumbass." (acdw/system :home))) recenter-positions '(top middle bottom)) - (tooltip-mode -1) + (tooltip-mode -1)) + +(setup winner + ;; see https://lists.gnu.org/archive/html/emacs-devel/2021-08/msg00888.html + (:global "C-x 4 C-/" winner-undo + "C-x 4 /" winner-undo + "C-x 4 C-?" winner-redo + "C-x 4 ?" winner-redo) + + ;; add `winner-undo' and `winner-redo' to `repeat-mode' + (when (fboundp 'repeat-mode) + (defvar winner-mode-repeat-map + (let ((map (make-sparse-keymap))) + (define-key map "/" #'winner-undo) + (define-key map "?" #'winner-redo) + map) + "Keymap to repeat `winner-mode' sequences. Used in `repeat-mode'.") + + (put 'winner-undo 'repeat-map 'winner-mode-repeat-map) + (put 'winner-redo 'repeat-map 'winner-mode-repeat-map)) + (winner-mode +1)) +(setup windmove + (:option windmove-wrap-around t) + (:global + ;; moving + "C-x 4 " windmove-left + "C-x 4 " windmove-right + "C-x 4 " windmove-up + "C-x 4 " windmove-down + ;; swapping + "C-x 4 S-" windmove-swap-states-left + "C-x 4 S-" windmove-swap-states-right + "C-x 4 S-" windmove-swap-states-up + "C-x 4 S-" windmove-swap-states-down) + + (when (fboundp 'repeat-mode) + (defvar windmove-repeat-map + (let ((map (make-sparse-keymap))) + ;; moving + (define-key map [left] #'windmove-left) + (define-key map [right] #'windmove-right) + (define-key map [up] #'windmove-up) + (define-key map [down] #'windmove-down) + ;; swapping + (define-key map [S-left] #'windmove-swap-states-left) + (define-key map [S-right] #'windmove-swap-states-right) + (define-key map [S-up] #'windmove-swap-states-up) + (define-key map [S-down] #'windmove-swap-states-down) + map) + "Keymap to repeat various `windmove' sequences. Used in `repeat-mode'.") + + (dolist (sym '(windmove-left + windmove-right + windmove-up + windmove-down + windmove-swap-states-left + windmove-swap-states-right + windmove-swap-states-up + windmove-swap-states-down)) + (put sym 'repeat-map 'windmove-repeat-map)))) + (setup w32 (:option w32-allow-system-shell t w32-pass-lwindow-to-system nil @@ -1028,13 +1093,25 @@ like a dumbass." (funcall #'vertico-exit))))) (setup (:straight crux) - - (:global "M-`" crux-other-window-or-switch-buffer + + (:global "C-x o" acdw/other-window-or-switch-buffer "C-o" crux-smart-open-line "M-o" crux-smart-open-line-above "C-M-\\" crux-cleanup-buffer-or-region "C-x 4 t" crux-transpose-windows) + (when (fboundp 'repeat-mode) + (define-key other-window-repeat-map "o" + #'acdw/other-window-or-switch-buffer) + (define-key other-window-repeat-map "O" + (defun acdw/other-window-or-switch-buffer-backward () + (interactive) + (setq repeat-map 'other-window-repeat-map) + (acdw/other-window-or-switch-buffer -1))) + + (put 'acdw/other-window-or-switch-buffer + 'repeat-map 'other-window-repeat-map)) + (crux-reopen-as-root-mode +1)) ;; requires extension: diff --git a/lisp/acdw.el b/lisp/acdw.el index 7e82a9a..bd64af3 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el @@ -566,5 +566,18 @@ It's called 'require-private' for historical reasons." (forward-sexp 2) ('scan-error (end-of-buffer)))) + +;;; Crux tweaks + +;; `crux-other-window-or-switch-buffer' doesn't take an argument. +(defun acdw/other-window-or-switch-buffer (&optional arg) + "Call `other-window' or switch buffers, depending on window count." + (interactive "P") + (if (one-window-p) + (switch-to-buffer nil) + (other-window (or arg 1)))) + + + (provide 'acdw) ;;; acdw.el ends here -- cgit 1.4.1-21-gabe81