From e8fb39c36d60a9879db053303b44138f16e3319f Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 25 Nov 2023 02:29:24 +0300 Subject: feat(tazjin/emacs): initial tab-bar-mode configuration Sets up tab-bar-mode for EXWM, and adds simple initial configuration and shortcuts to make it behave sanely. I had to assign tab switching shortcuts myself, as the EXWM input key stuff doesn't work correctly with the built-in way of setting these shortcuts in tab-bar-mode. Change-Id: Icd96f03ae7bd2bd5f7c2d59f9aca7a1ca2e7f788 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10116 Tested-by: BuildkiteCI Reviewed-by: tazjin Autosubmit: tazjin --- users/tazjin/emacs/config/desktop.el | 24 ++++++++++++++++++++++-- users/tazjin/emacs/config/init.el | 2 +- 2 files changed, 23 insertions(+), 3 deletions(-) (limited to 'users/tazjin') diff --git a/users/tazjin/emacs/config/desktop.el b/users/tazjin/emacs/config/desktop.el index 28f0b59088..368e773c75 100644 --- a/users/tazjin/emacs/config/desktop.el +++ b/users/tazjin/emacs/config/desktop.el @@ -108,6 +108,15 @@ (add-hook 'exwm-update-title-hook titlef)) (fringe-mode 3) + +;; tab-bar related config +(setq tab-bar-show 1) +(setq tab-bar-tab-hints t) +(setq tab-bar-new-tab-choice + (lambda () (get-buffer-create "*scratch*"))) + +(tab-bar-mode 1) + (exwm-enable) (exwm-randr-enable) @@ -193,13 +202,24 @@ ring." (exwm-input-set-key (kbd "C-c j") #'exwm-jump-to-buffer) +;; Tab-management shortcuts + +(dotimes (i 8) + (exwm-input-set-key (kbd (format "s-%d" (+ 1 i))) #'tab-bar-select-tab)) + +(exwm-input-set-key (kbd "s-9") #'tab-last) +(exwm-input-set-key (kbd "s-f") #'tab-next) +(exwm-input-set-key (kbd "s-b") #'tab-recent) +(exwm-input-set-key (kbd "s-w") #'tab-close) +(exwm-input-set-key (kbd "s-n") #'tab-new) + ;; Launch applications / any command with completion (dmenu style!) (exwm-input-set-key (kbd "s-d") #'run-xdg-app) (exwm-input-set-key (kbd "s-x") #'run-external-command) (exwm-input-set-key (kbd "s-p") #'password-store-lookup) -;; Add X11 terminal selector to a key -(exwm-input-set-key (kbd "C-x t") #'ts/switch-to-terminal) +;; Add vterm selector to a key +(exwm-input-set-key (kbd "s-v") #'ts/switch-to-terminal) ;; Toggle between line-mode / char-mode (exwm-input-set-key (kbd "C-c C-t C-t") #'exwm-input-toggle-keyboard) diff --git a/users/tazjin/emacs/config/init.el b/users/tazjin/emacs/config/init.el index f3a6c55581..3f9acd8463 100644 --- a/users/tazjin/emacs/config/init.el +++ b/users/tazjin/emacs/config/init.el @@ -178,7 +178,7 @@ (setq common-lisp-hyperspec-root "file:///home/tazjin/docs/lisp/")) (use-package telega - :bind (:map global-map ("s-t" . (lambda (p) (interactive "P") + :bind (:map global-map ("s-c" . (lambda (p) (interactive "P") (if p (call-interactively #'telega-chat-with) (telega)))) :map telega-chat-button-map ("a" . ignore)) -- cgit 1.4.1