;; 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-") 'tab-bar-switch-to-next-tab) (global-set-key (kbd "C-") '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)