diff options
Diffstat (limited to '.config/emacs/modules/bd--tabs.el')
-rw-r--r-- | .config/emacs/modules/bd--tabs.el | 81 |
1 files changed, 34 insertions, 47 deletions
diff --git a/.config/emacs/modules/bd--tabs.el b/.config/emacs/modules/bd--tabs.el index f8ceab1..3bdf282 100644 --- a/.config/emacs/modules/bd--tabs.el +++ b/.config/emacs/modules/bd--tabs.el @@ -3,53 +3,40 @@ ;;; Code: -;;;; time and date -(require 'time) -(setq display-time-format " %m/%d %H:%M" - display-time-default-load-average nil) -(display-time) - -(defun bd/get-mode-line-modes (buffer) - (with-current-buffer buffer - (format-mode-line (remove '(t erc-modified-channels-object) mode-line-modes)))) - -;;;; turn tabs on, undo/redo mode -(setq tab-bar-show t) -(tab-bar-history-mode) -(tab-bar-select-tab 1) -(tab-bar-mode) - - -;;;; remove useless gui elements -(setopt tab-bar-format - '(tab-bar-format-tabs - tab-bar-format-align-right - tab-bar-format-global) - - tab-bar-close-button-show nil - - ;; size - tab-bar-auto-width-max nil) - -;;;; add useless text elements -(setopt tab-bar-tab-hints nil) - -(defun bd/tab-bar-name-function () - (concat (tab-bar-tab-name-current) - " " - (bd/get-mode-line-modes (window-buffer (minibuffer-selected-window))))) - -(setopt project-switch-commands - '((project-find-file "Find file") - (project-find-regexp "Find regexp") - (project-find-dir "Find directory") - (magit-project-status "Magit") - (project-shell "Shell"))) - -(keymap-global-set "C-x p v" 'magit-project-status) - - -(setq tab-bar-tab-name-function #'bd/tab-bar-name-function) +(use-package time + :init + (display-time) + :custom + (display-time-format " %m/%d %H:%M") + (display-time-default-load-average nil)) + +(use-package tab-bar + :config + (defun bd/get-mode-line-modes (buffer) + (with-current-buffer buffer + (format-mode-line (remove '(t erc-modified-channels-object) mode-line-modes)))) + (defun bd/tab-bar-name-function () + (concat (tab-bar-tab-name-current) + " " + (bd/get-mode-line-modes (window-buffer (minibuffer-selected-window))))) + + (tab-bar-select-tab 1) + (tab-bar-mode) + (tab-bar-history-mode) + :custom + (tab-bar-tab-name-function #'bd/tab-bar-name-function) + (tab-bar-show t) + + ;; remove useless gui elements + (tab-bar-format + '(tab-bar-format-tabs + tab-bar-format-align-right + tab-bar-format-global)) + (tab-bar-close-button-show nil) + (tab-bar-auto-width-max nil) + + ;; add useless text elements + (tab-bar-tab-hints nil)) (provide 'bd--tabs) |