2

How can I bind C-x C-f to invoke projectile-find-file when inside a project, and ido-find-file when not in a project?

1 Answer 1

7

Write your own command that checks:

(defun maybe-projectile-find-file ()
  (interactive)
  (call-interactively
   (if (projectile-project-p)
       #'projectile-find-file
       #'ido-find-file)))

(global-set-key (kbd "C-x C-f") 'maybe-projectile-find-file)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.