aboutsummaryrefslogtreecommitdiff
path: root/.emacs.d/rul-lisp
diff options
context:
space:
mode:
authorRaúl Benencia <id@rbenencia.name>2023-07-31 09:39:53 -0700
committerRaúl Benencia <id@rbenencia.name>2023-07-31 09:39:53 -0700
commitf8d48cc50badb8a98f4fd6e0dfaf0beeb9f30eef (patch)
tree9886378b6c8b164895e33af19aa4d7900c9cd030 /.emacs.d/rul-lisp
parentc8b9bb82012b00c0c1c498fedbb2aa4a85eeab8c (diff)
emacs: tab-bar revamp in rul-wm
Diffstat (limited to '.emacs.d/rul-lisp')
-rw-r--r--.emacs.d/rul-lisp/packages/rul-wm.el40
1 files changed, 40 insertions, 0 deletions
diff --git a/.emacs.d/rul-lisp/packages/rul-wm.el b/.emacs.d/rul-lisp/packages/rul-wm.el
new file mode 100644
index 0000000..7b44163
--- /dev/null
+++ b/.emacs.d/rul-lisp/packages/rul-wm.el
@@ -0,0 +1,40 @@
+;; Inspiration: https://christiantietze.de/posts/2022/12/updated-org-mode-agenda-display-buffer-alist/
+(defun rul/display-buffer-org-agenda-managed-p (buffer-name action)
+ "Determine whether BUFFER-NAME is an org-agenda managed buffer."
+ (with-current-buffer buffer-name
+ (or (derived-mode-p 'org-mode 'org-agenda-mode)
+ (member (buffer-file-name) (org-agenda-files)))))
+
+(add-to-list 'display-buffer-alist
+ `("\\*Org Agenda\\*"
+ (display-buffer-in-tab ;; Make sure to use the "Org Files" tab
+ display-buffer-reuse-mode-window)
+ (ignore-current-tab . t)
+ (tab-name . "Org")
+ (dedicated . side) ;; Make the Agenda a dedicated side-window
+ (side . left) ;; to the left so it always stays open.
+ (inhibit-same-window . nil)))
+
+(add-to-list 'display-buffer-alist
+ '(rul/display-buffer-org-agenda-managed-p
+ (display-buffer-reuse-mode-window ;; Prioritize reuse of current window
+ display-buffer-in-tab) ;; over switching to the Org tab.
+ (tab-name . "Org")))
+
+; tab-bar configuration
+(global-set-key (kbd "C-<next>") 'tab-bar-switch-to-next-tab)
+(global-set-key (kbd "C-<prior>") 'tab-bar-switch-to-prev-tab)
+
+;(setq switch-to-buffer-obey-display-actions nil)
+
+(setq tab-bar-format
+ '(tab-bar-format-tabs
+ tab-bar-format-align-right
+ tab-bar-format-global
+ ))
+
+(setq tab-bar-new-tab-to 'rightmost)
+(setq tab-bar-close-button-show nil)
+(set-face-attribute 'tab-bar nil :height 0.8)
+(tab-bar-mode 1)
+(provide 'rul-wm)
nihil fit ex nihilo