 ;;; my-bindings.el
 
 (eval-when-compile (require 'core-defuns))
+
+(defmacro @find-file-in (path &optional project-p)
+  "Returns a interactive function for searching files"
+  `(lambda () (interactive)
+     (let ((default-directory ,path))
+       (,@(if project-p
+              '(projectile-find-file)
+            '(call-interactively 'find-file))))))
 
 (map! "<f9>" 'what-face
       ;; Essential

      ;;; <leader> and <localleader>
      :m ";" 'evil-ex
      (:leader
        :nv ","   'doom/switch-to-project-buffer
        :nv "<"   'ivy-switch-buffer
        :nv "."   'counsel-find-file
        :nv ">"   'projectile-find-file-in-known-projects
        :nv "/"   'counsel-projectile-find-file
        :n  ":"   'imenu-list-minor-mode
        :nv ";"   'counsel-imenu
        :v  "="   'align-regexp

        :nv "Q"   'evil-save-and-quit
        :nv "C-q" 'doom/kill-all-buffers-do-not-remember
        ;; Quick access to config files
        :nv "E"   (@find-file-in doom-emacs-dir t)
        :nv "\\"  (@find-file-in (f-expand ".dotfiles" "~") t)
        ;; Alternative to C-h (used as window shortcut)
        :n  "h"   'help-command
        (:prefix "d" ; <diff>
