diff options
Diffstat (limited to '.emacs.d/rul-lisp/packages')
-rw-r--r-- | .emacs.d/rul-lisp/packages/rul-wm.el | 40 |
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) |