Skip to content

Latest commit

 

History

History
157 lines (120 loc) · 3.54 KB

wal-windows.org

File metadata and controls

157 lines (120 loc) · 3.54 KB

Windows

Everything that has to do with windows.

Header

;;; wal-windows.el --- Windows. -*- lexical-binding: t -*-

;;; Commentary:
;;
;; Provide window packages.

;;; Code:

(eval-when-compile
  (require 'wal-useful nil t)
  (require 'wal-package nil t)
  (require 'wal-key-bindings nil t))

(require 'ring)
(require 'cl-macs)
(require 'subr-x)

(declare-function project-name "ext:project.el")
(declare-function wal-interesting-windows "wal-useful.el")
(declare-function wal-switch-to-other-buffer "wal-useful.el")

Packages

ace-window

Super-charged other-window.

(defun wal-aw-consult-buffer (window)
  "Switch to WINDOW and then `consult-buffer'."
  (aw-switch-to-window window)
  (call-interactively 'consult-buffer))

(use-package ace-window
  :config
  (setq aw-dispatch-alist
        `((?0 aw-delete-window "Delete window")
          (?, wal-aw-consult-buffer "Consult buffer")
          (?? aw-show-dispatch-help)))

  :custom
  (aw-keys '(?j ?k ?l ?\; ?h ?a ?s ?d ?f ?g))
  (aw-dispatch-always t)

  :wal-bind
  (("y" . ace-window)))

windmove

Start in windmove-mode. Allows moving to, swapping, deleting and pre-selecting the display of windows.

(use-package windmove
  :hook (emacs-startup . windmove-mode)

  :custom
  (windmove-default-keybindings (cons nil '(hyper)))
  (windmove-swap-states-default-keybindings (cons nil '(hyper shift)))
  (windmove-delete-default-keybindings (cons 'none '(hyper meta)))
  (windmove-display-default-keybindings (cons nil '(hyper control))))

winner

Start in winner-mode, allowing C-c <left/right> to undo/redo changes to the window configuration.

We add a regular expression for commands we configured vertico to use a buffer for.

(use-package winner
  :custom
  (winner-boring-buffers-regexp "\\*\\(Go to\\|Ripgrep\\).*")

  :hook (emacs-startup . winner-mode))

tab-bar

Start in tab-bar-mode but hide the tab bar itself. New tabs will show the dashboard buffer on creation. This config uses tabs only for workspace management powered by partial-recall.

(use-package tab-bar
  :hook ((emacs-startup . tab-bar-mode))

  :custom
  (tab-bar-show nil)

  (tab-bar-new-tab-choice #'wal-dashboard-get-buffer)
  (tab-bar-new-tab-group nil)

  :wal-bind
  ("o" . tab-switch)
  ("M-o" . tab-rename))

transpose-frame

Allow transposing frames.

(defvar-keymap transpose-frame-map
  :doc "Keymap for `transpose-frame' commands."
  :repeat t
  "t" 'transpose-frame
  "i" 'flip-frame
  "o" 'flop-frame
  "r" 'rotate-frame
  "c" 'rotate-frame-clockwise
  "a" 'rotate-frame-anticlockwise)

(use-package transpose-frame
  :bind-keymap
  ("C-c t" . transpose-frame-map))

Footer

(provide 'wal-windows)

;;; wal-windows.el ends here