This commit is contained in:
Zelong Kuang
2026-02-22 20:50:59 +11:00
parent b1cc14a607
commit 32501941a1
3 changed files with 57 additions and 56 deletions

View File

@@ -15,6 +15,5 @@
(global-set-key (kbd "C-c q r") #'restart-emacs) (global-set-key (kbd "C-c q r") #'restart-emacs)
(global-set-key (kbd "C-c C-c") #'compile) (global-set-key (kbd "C-c C-c") #'compile)
;; (global-set-key (kbd "C-x C-b") #'ibuffer)
(provide 'init-bindings) (provide 'init-bindings)

View File

@@ -37,7 +37,7 @@
(pdf-tools-install)) (pdf-tools-install))
(use-package keycast (use-package keycast
:hook (elpaca-after-init . keycast-mode-line-mode) :hook (elpaca-after-init . keycast-tab-bar-mode)
:config :config
(setq keycast-mode-line-remove-tail-elements nil)) (setq keycast-mode-line-remove-tail-elements nil))

View File

@@ -3,65 +3,67 @@
(use-package project) (use-package project)
;; (use-package tab-bar (use-package tab-bar
;; :ensure nil :ensure nil
;; :init :init
;; (tab-bar-mode t) (tab-bar-mode t)
;; (setq tab-bar-new-tab-choice "*scratch*") ;; buffer to show in new tabs (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-close-button-show nil) ;; hide tab close / X button
;; (setq tab-bar-show 1) ;; hide bar if <= 1 tabs open (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-format '(tab-bar-format-tabs tab-bar-separator))
;; (setq tab-bar-tab-hints t)) (setq tab-bar-tab-hints t))
;; (use-package tabspaces (global-set-key (kbd "C-x C-b") #'ibuffer)
;; :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 (use-package tabspaces
;; (tabspaces-use-filtered-buffers-as-default t) :functions tabspaces-mode
;; (tabspaces-default-tab "Default") :commands (tabspaces-switch-or-create-workspace
;; (tabspaces-remove-to-default t) tabspaces-open-or-create-project-and-workspace)
;; (tabspaces-include-buffers '("*scratch*" "*Messages*")) :hook (elpaca-after-init . tabspaces-mode)
;; (tabspaces-exclude-buffers '("*eat*" "*vterm*" "*shell*" "*eshell*")) :bind (:map tabspaces-mode-map
;; ;; sessions ([remap project-switch-project] . tabspaces-project-switch-project-open-file))
;; (tabspaces-session t) :bind (:map tabspaces-command-map
;; ;; (tabspaces-session-auto-restore t) ("l" . tabspaces-restore-session)
;; (tabspaces-keymap-prefix "C-c TAB") ("s" . tabspaces-save-session)
;; (tab-bar-new-tab-choice "default") ("TAB" . tabspaces-switch-or-create-workspace))
;; (with-eval-after-load 'consult :custom
;; ;; hide full buffer list (still available with "b" prefix) (tabspaces-use-filtered-buffers-as-default t)
;; (consult-customize consult--source-buffer :hidden nil :default nil) (tabspaces-default-tab "Default")
;; ;; set consult-workspace buffer list (tabspaces-remove-to-default t)
;; (defvar consult--source-workspace (tabspaces-include-buffers '("*scratch*" "*Messages*"))
;; (list :name "Workspace Buffers" (tabspaces-exclude-buffers '("*eat*" "*vterm*" "*shell*" "*eshell*"))
;; :narrow ?w ;; sessions
;; :history 'buffer-name-history (tabspaces-session t)
;; :category 'buffer ;; (tabspaces-session-auto-restore t)
;; :state #'consult--buffer-state (tabspaces-keymap-prefix "C-c TAB")
;; :default t (tab-bar-new-tab-choice "default")
;; :items (lambda () (consult--buffer-query
;; :predicate #'tabspaces--local-buffer-p
;; :sort 'visibility
;; :as #'buffer-name)))
;; "Set workspace buffer list for consult-buffer.") (with-eval-after-load 'consult
;; (add-to-list 'consult-buffer-sources 'consult--source-workspace))) ;; 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)))
(use-package beframe "Set workspace buffer list for consult-buffer.")
:hook elpaca-after-init (add-to-list 'consult-buffer-sources 'consult--source-workspace)))
:bind (("C-x b" . beframe-switch-buffer)
("C-x C-b" . beframe-buffer-menu)) ;; (use-package beframe
:config ;; :hook elpaca-after-init
(setq beframe-functions-in-frames '(project-prompt-project-dir))) ;; :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) (provide 'init-workspace)