2025-12-20 15:13:13 +11:00
|
|
|
;; -*- lexical-binding: t; -*-
|
|
|
|
|
|
2025-12-21 12:57:53 +11:00
|
|
|
|
2026-02-05 21:48:27 +11:00
|
|
|
(use-package project)
|
2026-01-30 03:52:15 +11:00
|
|
|
|
2026-02-22 20:50:59 +11:00
|
|
|
(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))
|
2026-02-22 20:44:07 +11:00
|
|
|
|
2026-02-22 20:50:59 +11:00
|
|
|
(setq tab-bar-tab-hints t))
|
2026-02-22 20:44:07 +11:00
|
|
|
|
2026-02-22 20:50:59 +11:00
|
|
|
(global-set-key (kbd "C-x C-b") #'ibuffer)
|
2026-02-22 20:44:07 +11:00
|
|
|
|
2026-02-22 20:50:59 +11:00
|
|
|
(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)
|
2026-02-22 23:29:18 +11:00
|
|
|
(tabspaces-keymap-prefix "C-c o")
|
2026-02-22 20:50:59 +11:00
|
|
|
(tab-bar-new-tab-choice "default")
|
2026-02-22 04:13:33 +11:00
|
|
|
|
2026-02-22 20:50:59 +11:00
|
|
|
(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)))
|
2026-02-22 20:44:07 +11:00
|
|
|
|
2026-02-22 20:50:59 +11:00
|
|
|
"Set workspace buffer list for consult-buffer.")
|
|
|
|
|
(add-to-list 'consult-buffer-sources 'consult--source-workspace)))
|
2026-02-22 20:44:07 +11:00
|
|
|
|
2026-02-22 20:50:59 +11:00
|
|
|
;; (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)))
|
2026-02-08 20:12:13 +11:00
|
|
|
|
2025-12-20 15:13:13 +11:00
|
|
|
(provide 'init-workspace)
|