Helm: Add Magit action to find-files

master
Pierre Neidhardt 2019-02-21 18:28:47 +01:00
parent ac3233cb8a
commit 6175c6e8e4
1 changed files with 13 additions and 0 deletions

View File

@ -299,4 +299,17 @@ With prefix argument, UPDATE the databases with custom uptions thanks to the
(global-set-key (kbd "C-<f4>") 'helm-execute-kmacro)
;; From https://github.com/thierryvolpiatto/emacs-tv-config/blob/master/init-helm.el:
(defmethod helm-setup-user-source ((source helm-source-ffiles))
(helm-source-add-action-to-source-if
"Magit status"
(lambda (_candidate)
(magit-status helm-ff-default-directory))
source
(lambda (candidate)
(and (not (string-match-p ffap-url-regexp candidate))
helm-ff-default-directory
(locate-dominating-file helm-ff-default-directory ".git")))
1))
(provide 'init-helm)