mirror of
https://github.com/pestctrl/emacs-config.git
synced 2026-06-14 12:21:20 +00:00
Automatically switch tabs for certain projectile projects
This commit is contained in:
parent
43b96fd362
commit
f987e2dbb7
1 changed files with 15 additions and 1 deletions
|
|
@ -76,6 +76,20 @@
|
|||
(define-key *root-map* (kbd "n") 'toggle-notifications)
|
||||
|
||||
(when (<= 27 emacs-major-version)
|
||||
(require 'switch-tabs))
|
||||
(require 'switch-tabs)
|
||||
|
||||
(defun projectile-switch-switch-tab (project arg)
|
||||
(let* ((dir-name (-> project
|
||||
(directory-file-name)
|
||||
(file-name-nondirectory)))
|
||||
(tab-name
|
||||
(cond ((member dir-name '("emacs-config" ".emacs.d")) "emacs-devel")
|
||||
((member dir-name '("agenda" "org" "work")) "org"))))
|
||||
(when tab-name
|
||||
(switch-or-create-tab tab-name))))
|
||||
|
||||
(advice-add #'projectile-switch-project-by-name
|
||||
:before
|
||||
#'projectile-switch-switch-tab))
|
||||
|
||||
(provide 'keymap)
|
||||
|
|
|
|||
Loading…
Reference in a new issue