blob: 239d022473490cb8d94ff7c29d0396d1863c81c8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
;;; init-windows.el --- Window management -*- lexical-binding: t; -*-
;; Copyright (C) 2026 Richard Qin
;; SPDX-License-Identifier: GPL-3.0-or-later
;; Author: Richard Qin
;; This file is not part of GNU Emacs.
;;; Commentary:
;; Configure Emacs window and tab management.
;; Enable tab-bar-mode and winner-mode.
;;; Code:
;; ------------------------------------------------------------
;; Tab Bar
;; ------------------------------------------------------------
(require 'tab-bar)
;; Show the tab bar when multiple tabs exist.
(setq tab-bar-show 1)
;; Hide additional tab control buttons.
(setq tab-bar-new-button-show nil)
(setq tab-bar-close-button-show nil)
;; Enable tab management.
(tab-bar-mode 1)
;; ------------------------------------------------------------
;; Winner Mode
;; ------------------------------------------------------------
(require 'winner)
;; Enable window layout history.
(winner-mode 1)
;; ------------------------------------------------------------
;; Keybindings
;; ------------------------------------------------------------
;; Create a new tab.
(define-key my/command-map
(kbd "t")
#'tab-new)
;; Switch tabs.
(define-key my/command-map
(kbd "n")
#'tab-next)
(define-key my/command-map
(kbd "p")
#'tab-previous)
;; Restore window layouts.
(define-key my/command-map
(kbd "u")
#'winner-undo)
(define-key my/command-map
(kbd "U")
#'winner-redo)
(provide 'init-windows)
;;; init-windows.el ends here
|