diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-11 15:16:56 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-11 15:16:56 -0500 |
| commit | f837e5f7464932fc49c10a7442dc1a23af61b257 (patch) | |
| tree | 62a21072c37f44d4daf1657d7d2589177173747c /modules/custom-buffer-file.el | |
| parent | c14d6c8d0f669d694dd765d6f592ce6eb72c50f5 (diff) | |
| download | dotemacs-f837e5f7464932fc49c10a7442dc1a23af61b257.tar.gz dotemacs-f837e5f7464932fc49c10a7442dc1a23af61b257.zip | |
feat(window): resize the split with C-; b <arrow>
`C-; b <left>/<right>/<up>/<down>' moves the active window's divider that way (via `windsize'), then keeps `cj/window-resize-map' active so bare arrows keep nudging until any other key (or `C-g'/`<escape>'). `C-u N C-; b <right>' resizes by N.
windsize was on `C-s-<arrow>' (Ctrl+Super), which a tiling WM intercepts, so those keys were useless. I dropped that binding. The package is now `:commands'-deferred, and `windsize-cols'/`windsize-rows' drop to 2 (8/4 overshoots in a held nudge loop). `cj/window-resize-sticky' dispatches on the arrow that triggered it and arms the loop.
Diffstat (limited to 'modules/custom-buffer-file.el')
| -rw-r--r-- | modules/custom-buffer-file.el | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/modules/custom-buffer-file.el b/modules/custom-buffer-file.el index 7fe412ee..f4401d1f 100644 --- a/modules/custom-buffer-file.el +++ b/modules/custom-buffer-file.el @@ -17,6 +17,9 @@ ;; ;; Keybindings under ~C-; b~: ;; - ~C-; b k~ kill buffer and window (delete window, kill/bury buffer) +;; - ~C-; b <arrow>~ move the active window's divider that way (via windsize); +;; bare arrows keep nudging until any other key (cj/window-resize-sticky in +;; ui-navigation.el) ;; - Copy buffer content submenu at ~C-; b c~ ;; - ~C-; b c w~ copy whole buffer ;; - ~C-; b c t~ copy from beginning to point @@ -37,6 +40,9 @@ ;; cj/kill-buffer-and-window defined in undead-buffers.el (declare-function cj/kill-buffer-and-window "undead-buffers") +;; cj/window-resize-sticky (C-; b <arrow>) defined in ui-navigation.el +(declare-function cj/window-resize-sticky "ui-navigation") + ;; ------------------------- Print Buffer As Postscript ------------------------ (defvar cj/print-spooler-command 'auto @@ -454,7 +460,14 @@ Signals an error if: "w" #'cj/view-buffer-in-eww "E" #'cj/view-email-in-buffer "o" #'cj/xdg-open - "O" #'cj/open-this-file-with) + "O" #'cj/open-this-file-with + ;; Window resize (cj/window-resize-sticky in ui-navigation.el, on `windsize'): + ;; the arrow moves the active window's divider that way, then bare arrows + ;; keep nudging until any other key. + "<left>" #'cj/window-resize-sticky + "<right>" #'cj/window-resize-sticky + "<up>" #'cj/window-resize-sticky + "<down>" #'cj/window-resize-sticky) (when (boundp 'cj/custom-keymap) (keymap-set cj/custom-keymap "b" cj/buffer-and-file-map)) @@ -484,7 +497,11 @@ Signals an error if: "C-; b w" "view in EWW" "C-; b E" "view email" "C-; b o" "open with default app" - "C-; b O" "open with program...")) + "C-; b O" "open with program..." + "C-; b <left>" "resize divider left" + "C-; b <right>" "resize divider right" + "C-; b <up>" "resize divider up" + "C-; b <down>" "resize divider down")) (provide 'custom-buffer-file) |
