From 32501941a1d4eb5d86623b7979410790ed92f447 Mon Sep 17 00:00:00 2001 From: Zelong Kuang Date: Sun, 22 Feb 2026 20:50:59 +1100 Subject: [PATCH] Update --- lisp/init-bindings.el | 1 - lisp/init-utils.el | 2 +- lisp/init-workspace.el | 110 +++++++++++++++++++++-------------------- 3 files changed, 57 insertions(+), 56 deletions(-) diff --git a/lisp/init-bindings.el b/lisp/init-bindings.el index 39c2689..1155532 100644 --- a/lisp/init-bindings.el +++ b/lisp/init-bindings.el @@ -15,6 +15,5 @@ (global-set-key (kbd "C-c q r") #'restart-emacs) (global-set-key (kbd "C-c C-c") #'compile) -;; (global-set-key (kbd "C-x C-b") #'ibuffer) (provide 'init-bindings) diff --git a/lisp/init-utils.el b/lisp/init-utils.el index e728ce1..6305066 100644 --- a/lisp/init-utils.el +++ b/lisp/init-utils.el @@ -37,7 +37,7 @@ (pdf-tools-install)) (use-package keycast - :hook (elpaca-after-init . keycast-mode-line-mode) + :hook (elpaca-after-init . keycast-tab-bar-mode) :config (setq keycast-mode-line-remove-tail-elements nil)) diff --git a/lisp/init-workspace.el b/lisp/init-workspace.el index ef21703..5348d49 100644 --- a/lisp/init-workspace.el +++ b/lisp/init-workspace.el @@ -3,65 +3,67 @@ (use-package project) -;; (use-package tab-bar -;; :ensure nil -;; :init -;; (tab-bar-mode t) -;; (setq tab-bar-new-tab-choice "*scratch*") ;; buffer to show in new tabs -;; (setq tab-bar-close-button-show nil) ;; hide tab close / X button -;; (setq tab-bar-show 1) ;; hide bar if <= 1 tabs open -;; (setq tab-bar-format '(tab-bar-format-tabs tab-bar-separator)) +(use-package tab-bar + :ensure nil + :init + (tab-bar-mode t) + (setq tab-bar-new-tab-choice "*scratch*") ;; buffer to show in new tabs + (setq tab-bar-close-button-show nil) ;; hide tab close / X button + (setq tab-bar-show 1) ;; hide bar if <= 1 tabs open + (setq tab-bar-format '(tab-bar-format-tabs tab-bar-separator)) -;; (setq tab-bar-tab-hints t)) + (setq tab-bar-tab-hints t)) -;; (use-package tabspaces -;; :functions tabspaces-mode -;; :commands (tabspaces-switch-or-create-workspace -;; tabspaces-open-or-create-project-and-workspace) -;; :hook (elpaca-after-init . tabspaces-mode) -;; :bind (:map tabspaces-mode-map -;; ([remap project-switch-project] . tabspaces-project-switch-project-open-file)) -;; :bind (:map tabspaces-command-map -;; ("l" . tabspaces-restore-session) -;; ("s" . tabspaces-save-session) -;; ("TAB" . tabspaces-switch-or-create-workspace)) +(global-set-key (kbd "C-x C-b") #'ibuffer) -;; :custom -;; (tabspaces-use-filtered-buffers-as-default t) -;; (tabspaces-default-tab "Default") -;; (tabspaces-remove-to-default t) -;; (tabspaces-include-buffers '("*scratch*" "*Messages*")) -;; (tabspaces-exclude-buffers '("*eat*" "*vterm*" "*shell*" "*eshell*")) -;; ;; sessions -;; (tabspaces-session t) -;; ;; (tabspaces-session-auto-restore t) -;; (tabspaces-keymap-prefix "C-c TAB") -;; (tab-bar-new-tab-choice "default") +(use-package tabspaces + :functions tabspaces-mode + :commands (tabspaces-switch-or-create-workspace + tabspaces-open-or-create-project-and-workspace) + :hook (elpaca-after-init . tabspaces-mode) + :bind (:map tabspaces-mode-map + ([remap project-switch-project] . tabspaces-project-switch-project-open-file)) + :bind (:map tabspaces-command-map + ("l" . tabspaces-restore-session) + ("s" . tabspaces-save-session) + ("TAB" . tabspaces-switch-or-create-workspace)) + + :custom + (tabspaces-use-filtered-buffers-as-default t) + (tabspaces-default-tab "Default") + (tabspaces-remove-to-default t) + (tabspaces-include-buffers '("*scratch*" "*Messages*")) + (tabspaces-exclude-buffers '("*eat*" "*vterm*" "*shell*" "*eshell*")) + ;; sessions + (tabspaces-session t) + ;; (tabspaces-session-auto-restore t) + (tabspaces-keymap-prefix "C-c TAB") + (tab-bar-new-tab-choice "default") -;; (with-eval-after-load 'consult -;; ;; hide full buffer list (still available with "b" prefix) -;; (consult-customize consult--source-buffer :hidden nil :default nil) -;; ;; set consult-workspace buffer list -;; (defvar consult--source-workspace -;; (list :name "Workspace Buffers" -;; :narrow ?w -;; :history 'buffer-name-history -;; :category 'buffer -;; :state #'consult--buffer-state -;; :default t -;; :items (lambda () (consult--buffer-query -;; :predicate #'tabspaces--local-buffer-p -;; :sort 'visibility -;; :as #'buffer-name))) + (with-eval-after-load 'consult + ;; hide full buffer list (still available with "b" prefix) + (consult-customize consult--source-buffer :hidden nil :default nil) + ;; set consult-workspace buffer list + (defvar consult--source-workspace + (list :name "Workspace Buffers" + :narrow ?w + :history 'buffer-name-history + :category 'buffer + :state #'consult--buffer-state + :default t + :items (lambda () (consult--buffer-query + :predicate #'tabspaces--local-buffer-p + :sort 'visibility + :as #'buffer-name))) -;; "Set workspace buffer list for consult-buffer.") -;; (add-to-list 'consult-buffer-sources 'consult--source-workspace))) + "Set workspace buffer list for consult-buffer.") + (add-to-list 'consult-buffer-sources 'consult--source-workspace))) -(use-package beframe - :hook elpaca-after-init - :bind (("C-x b" . beframe-switch-buffer) - ("C-x C-b" . beframe-buffer-menu)) - :config - (setq beframe-functions-in-frames '(project-prompt-project-dir))) +;; (use-package beframe +;; :hook elpaca-after-init +;; :bind (("C-x b" . beframe-switch-buffer) +;; ("C-x C-b" . beframe-buffer-menu)) +;; :config +;; (setq beframe-functions-in-frames '(project-prompt-project-dir))) (provide 'init-workspace)