2021-08-17 11:49:19 +00:00
|
|
|
;;; init-windows.el --- Window/Buffer Configuration File -*- lexical-binding: t -*-
|
|
|
|
;;; Commentary:
|
|
|
|
;;; Code:
|
|
|
|
|
|
|
|
(use-package emacs
|
2022-08-11 13:43:36 +00:00
|
|
|
:custom
|
|
|
|
(switch-to-buffer-obey-display-actions t)
|
2021-08-18 14:07:44 +00:00
|
|
|
:bind
|
|
|
|
("C-x C-M-b" . ibuffer)
|
2021-08-17 11:49:19 +00:00
|
|
|
:config
|
|
|
|
;; From EmacsWiki
|
|
|
|
(defun toggle-window-split ()
|
|
|
|
(interactive)
|
|
|
|
(if (= (count-windows) 2)
|
|
|
|
(let* ((this-win-buffer (window-buffer))
|
|
|
|
(next-win-buffer (window-buffer (next-window)))
|
|
|
|
(this-win-edges (window-edges (selected-window)))
|
|
|
|
(next-win-edges (window-edges (next-window)))
|
|
|
|
(this-win-2nd (not (and (<= (car this-win-edges)
|
|
|
|
(car next-win-edges))
|
|
|
|
(<= (cadr this-win-edges)
|
|
|
|
(cadr next-win-edges)))))
|
|
|
|
(splitter
|
|
|
|
(if (= (car this-win-edges)
|
|
|
|
(car (window-edges (next-window))))
|
|
|
|
'split-window-horizontally
|
|
|
|
'split-window-vertically)))
|
|
|
|
(delete-other-windows)
|
|
|
|
(let ((first-win (selected-window)))
|
|
|
|
(funcall splitter)
|
|
|
|
(if this-win-2nd (other-window 1))
|
|
|
|
(set-window-buffer (selected-window) this-win-buffer)
|
|
|
|
(set-window-buffer (next-window) next-win-buffer)
|
|
|
|
(select-window first-win)
|
|
|
|
(if this-win-2nd (other-window 1))))))
|
|
|
|
(define-key ctl-x-4-map "t" 'toggle-window-split))
|
|
|
|
|
2022-08-18 14:03:31 +00:00
|
|
|
(use-package winner
|
2022-08-30 11:53:46 +00:00
|
|
|
:defer 5
|
2022-08-18 14:03:31 +00:00
|
|
|
:config
|
|
|
|
(winner-mode +1)
|
|
|
|
(defvar winner-repeat-map
|
|
|
|
(let ((map (make-sparse-keymap)))
|
|
|
|
(define-key map (kbd "<left>") #'winner-undo)
|
|
|
|
(define-key map (kbd "<right>") #'winner-redo)
|
|
|
|
map))
|
|
|
|
(dolist (cmd '(winner-undo winner-redo))
|
|
|
|
(put cmd 'repeat-map 'winner-repeat-map)))
|
2021-08-17 11:49:19 +00:00
|
|
|
|
|
|
|
(use-package windmove
|
|
|
|
:init (windmove-default-keybindings))
|
|
|
|
|
|
|
|
(use-package buffer-move
|
|
|
|
:bind (("C-S-<up>" . buf-move-up)
|
|
|
|
("C-S-<down>" . buf-move-down)
|
|
|
|
("C-S-<left>" . buf-move-left)
|
|
|
|
("C-S-<right>" . buf-move-right)))
|
|
|
|
|
2022-10-10 15:28:16 +00:00
|
|
|
(use-feature uniquify
|
2021-08-23 16:01:31 +00:00
|
|
|
:custom
|
|
|
|
(uniquify-buffer-name-style 'forward))
|
|
|
|
|
2021-08-17 11:49:19 +00:00
|
|
|
(use-package fullframe
|
2022-10-05 19:11:01 +00:00
|
|
|
:defer 8
|
2021-08-17 11:49:19 +00:00
|
|
|
:config
|
2022-10-05 19:11:01 +00:00
|
|
|
(fullframe magit-status magit-mode-bury-buffer)
|
2021-08-19 13:31:52 +00:00
|
|
|
(fullframe vc-annotate quit-window))
|
2021-08-17 11:49:19 +00:00
|
|
|
|
|
|
|
(use-package ace-window
|
|
|
|
:diminish
|
2021-08-18 14:07:44 +00:00
|
|
|
:bind
|
|
|
|
([remap other-window] . ace-window)
|
|
|
|
("C-<tab>" . ace-window)
|
2021-08-17 11:49:19 +00:00
|
|
|
:custom-face
|
|
|
|
(aw-leading-char-face
|
|
|
|
((t (:foreground "white" :background "red"
|
|
|
|
:weight bold :height 2.5 :box (:line-width 10 :color "red"))))))
|
|
|
|
|
2022-08-26 15:04:11 +00:00
|
|
|
(use-package popper
|
|
|
|
:bind (("<f5>" . popper-toggle-latest)
|
|
|
|
("<f6>" . popper-cycle)
|
|
|
|
("<f7>" . popper-toggle-type))
|
2022-10-12 15:45:41 +00:00
|
|
|
:custom
|
|
|
|
(popper-reference-buffers
|
|
|
|
'("\\*Messages\\*"
|
|
|
|
"\\*HTTP Response\\*"
|
|
|
|
"Output\\*$"
|
|
|
|
"\\*Async Shell Command\\*"
|
|
|
|
help-mode
|
|
|
|
helpful-mode
|
|
|
|
compilation-mode))
|
|
|
|
:hook (emacs-startup . (lambda ()
|
|
|
|
(popper-mode +1)
|
|
|
|
(popper-echo-mode +1))))
|
2021-08-17 11:49:19 +00:00
|
|
|
|
|
|
|
(provide 'init-windows)
|
|
|
|
;;; init-windows.el ends here
|