Add ivy-persp-switch-project
This commit is contained in:
parent
b0ee301845
commit
c7008108f5
|
@ -809,13 +809,11 @@ Example: (evil-map visual \"<\" \"<gv\")"
|
|||
"pT" 'projectile-find-test-file
|
||||
"py" 'projectile-find-tag)
|
||||
(when (configuration-layer/package-usedp 'persp-mode)
|
||||
(if (configuration-layer/layer-usedp 'spacemacs-helm)
|
||||
(spacemacs/set-leader-keys
|
||||
"pl" 'spacemacs/helm-persp-switch-project)
|
||||
(spacemacs/set-leader-keys
|
||||
"pl" 'spacemacs/ivy-persp-switch-project)
|
||||
)
|
||||
))
|
||||
(if (configuration-layer/layer-usedp 'spacemacs-helm)
|
||||
((spacemacs/set-leader-keys
|
||||
"pl" 'spacemacs/helm-persp-switch-project)
|
||||
(spacemacs/set-leader-keys
|
||||
"pl" 'spacemacs/ivy-persp-switch-project)))))
|
||||
:config
|
||||
(progn
|
||||
(projectile-global-mode)
|
||||
|
|
|
@ -118,6 +118,22 @@ perspectives does."
|
|||
(projectile-switch-project-by-name project)))))))
|
||||
:buffer "*Projectile Layouts*"))
|
||||
|
||||
(defun spacemacs/ivy-persp-switch-project (arg)
|
||||
(interactive "P")
|
||||
(ivy-read "Switch to Project Perspective:"
|
||||
(if (projectile-project-p)
|
||||
(cons (abbreviate-file-name (projectile-project-root))
|
||||
(projectile-relevant-known-projects))
|
||||
projectile-known-projects)
|
||||
:action (lambda (project)
|
||||
(let ((persp-reset-windows-on-nil-window-conf t))
|
||||
(persp-switch project)
|
||||
(let ((projectile-completion-system 'ivy))
|
||||
(projectile-switch-project-by-name project))))
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
;; Autosave ----------------------------------------------------------------
|
||||
|
||||
(defun spacemacs//layout-autosave ()
|
||||
|
|
Loading…
Reference in a new issue