summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tab-conf.el27
1 files changed, 23 insertions, 4 deletions
diff --git a/tab-conf.el b/tab-conf.el
index de04d73..6062abc 100644
--- a/tab-conf.el
+++ b/tab-conf.el
@@ -4,9 +4,10 @@
(setq tab-bar-format nil)
-(define-key tab-switcher-mode-map (vector ?n) 'tab-switcher-next-or-first)
-(define-key tab-switcher-mode-map (vector ?p) 'tab-switcher-prev-or-last)
-(define-key tab-prefix-map (vector 'tab) 'tab-switcher)
+(define-key tab-switcher-mode-map (vector ?n) #'tab-switcher-next-or-first)
+(define-key tab-switcher-mode-map (vector ?p) #'tab-switcher-prev-or-last)
+(define-key tab-prefix-map (vector 'tab) #'tab-switcher)
+(define-key tab-prefix-map (vector ?c) #'durand-tab-list)
(define-key global-map (vector ?\s-t) #'durand-switch-tab-dwim)
(define-key global-map (vector ?\s-T) #'tab-switcher)
@@ -130,5 +131,23 @@ then go to the last configuration line."
(t (skip-chars-forward "[:space:]")
(forward-char -1))))
-
+(defun durand-tab-list ()
+ "List all tabs in the echo area."
+ (interactive)
+ (let* ((tabs (tab-bar-tabs))
+ (str (mapconcat
+ (lambda (tab)
+ (propertize
+ (cdr (assoc 'name (cdr tab)))
+ 'face
+ (cond ((eq (car tab) 'current-tab)
+ 'success)
+ ('default))))
+ tabs
+ " | ")))
+ (message "%d tab%s: %s"
+ (length tabs)
+ (cond ((> (length tabs) 1) "s")
+ (""))
+ str)))