Skip to content

Commit

Permalink
layouts: Port persp-close[kill]-other to use ivy
Browse files Browse the repository at this point in the history
There are no remaining layouts functions that use helm without ivy
equivalents.
  • Loading branch information
justbur committed Feb 8, 2016
1 parent 308ad64 commit ba6deea
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions layers/+completion/spacemacs-ivy/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -449,10 +449,29 @@ perspectives does."
(with-persp-buffer-list ()
(call-interactively 'ivy-switch-buffer))))

(setq spacemacs-layouts-transient-state-remove-bindings '("l" "b"))
(defun spacemacs/ivy-persp-close-other ()
"Kills perspectives without killing the buffers"
(interactive)
(ivy-read (format "Close perspective [current %s]: "
(spacemacs//current-layout-name))
(persp-names)
:action 'persp-kill-without-buffers))

(defun spacemacs/ivy-persp-kill-other ()
"Kills perspectives with all their buffers"
(interactive)
(ivy-read (format "Kill perspective [current %s]: "
(spacemacs//current-layout-name))
(persp-names)
:action 'persp-kill))

(setq spacemacs-layouts-transient-state-remove-bindings
'("b" "l" "C" "X"))
(setq spacemacs-layouts-transient-state-add-bindings
'(("l" spacemacs/ivy-perspectives)
("b" spacemacs/ivy-persp-buffer))))))
'(("b" spacemacs/ivy-persp-buffer)
("l" spacemacs/ivy-perspectives)
("C" spacemacs/ivy-persp-close-other :exit t)
("X" spacemacs/ivy-persp-kill-other :exit t))))))

(defun spacemacs-ivy/init-smex ()
(use-package smex
Expand Down

0 comments on commit ba6deea

Please sign in to comment.