cp-find-dir: Add actions to visit dir externally / as root

This commit is contained in:
Eric Danan 2018-06-21 16:55:53 +02:00
parent 9660cf8434
commit 5aa8a0bc8e
2 changed files with 20 additions and 4 deletions

View file

@ -404,6 +404,10 @@ The sorting function can be modified by adding an entry for
"current window")
("j" counsel-projectile-find-dir-action-other-window
"other window")
("x" counsel-projectile-find-dir-action-extern
"open externally")
("r" counsel-projectile-find-dir-action-root
"open as root")
("m" counsel-projectile-find-file-action-find-file-manually
"find file manually")
("p" (lambda (_) (counsel-projectile-switch-project))
@ -427,6 +431,16 @@ The sorting function can be modified by adding an entry for
(dired-other-window (projectile-expand-root dir))
(run-hooks 'projectile-find-dir-hook))
(defun counsel-projectile-find-dir-action-extern (dir)
"Visit DIR externally and run `projectile-find-dir-hook'."
(counsel-find-file-extern (projectile-expand-root dir))
(run-hooks 'projectile-find-dir-hook))
(defun counsel-projectile-find-file-action-root (dir)
"Visit DIR as root and run `projectile-find-dir-hook'."
(counsel-find-file-as-root (projectile-expand-root dir))
(run-hooks 'projectile-find-dir-hook))
;;;###autoload
(defun counsel-projectile-find-dir (&optional arg)
"Jump to a directory in the current project.