From f8d48cc50badb8a98f4fd6e0dfaf0beeb9f30eef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Benencia?= Date: Mon, 31 Jul 2023 09:39:53 -0700 Subject: emacs: tab-bar revamp in rul-wm --- .emacs.d/rul-lisp/packages/rul-wm.el | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .emacs.d/rul-lisp/packages/rul-wm.el (limited to '.emacs.d/rul-lisp/packages') 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-") '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) -- cgit v1.2.3