diff --git a/init.d/basics/ui.el b/init.d/basics/ui.el index d34b495..f0e31d5 100644 --- a/init.d/basics/ui.el +++ b/init.d/basics/ui.el @@ -1,6 +1,6 @@ ;;; ui.el --- Configure user interfaces. -*- lexical-binding: t; -*- -;; Time-stamp: <2020-02-11T17:45:47+0100> +;; Time-stamp: <2020-02-11T18:35:21+0100> ;;; Commentary: ;; * treemacs @@ -132,6 +132,18 @@ :custom (counsel-projectile-mode t) ; Turn on projectile-mode and enable keybindings. + (projectile-switch-project-action 'my/switch-project) + + :config + (defun my/counsel-projectile-switch-project-action (project) + "Call `my/switch-project'." + (let ((projectile-switch-project-action 'my/switch-project)) + (counsel-projectile-switch-project-by-name project))) + + (counsel-projectile-modify-action + 'counsel-projectile-switch-project-action + '((add ("Y" my/counsel-projectile-switch-project-action + "open project in treemacs") 1))) ) ;; Switch between named persistent window configurations. diff --git a/init.d/programming/common.el b/init.d/programming/common.el index 4984ceb..96c193c 100644 --- a/init.d/programming/common.el +++ b/init.d/programming/common.el @@ -1,6 +1,6 @@ ;;; common.el --- Common programming settings. -*- lexical-binding: t; -*- -;; Time-stamp: <2020-02-11T17:47:01+0100> +;; Time-stamp: <2020-02-11T18:31:37+0100> ;;; Commentary: @@ -132,7 +132,7 @@ (substring (shell-command-to-string "nproc --ignore=1") 0 -1))) (defun my/switch-project () - "Add project to treemacs." + "Open `treemacs' and add project to workspace." (treemacs-add-and-display-current-project) (treemacs-collapse-other-projects) (treemacs-toggle-node))