       ;;; <leader> and <localleader>
       :m ";" 'evil-ex
       (:leader
-        :nv ","   'doom/switch-to-project-buffer
-        :nv "<"   'ivy-switch-buffer
-        :nv "."   'counsel-find-file
+        :nv ","   'doom/ivy-switch-project-buffer
+        :nv "<"   'doom/ivy-switch-buffer
+        :nv "."   (@find-file-in default-directory)
+        :nv "/"   (@find-file-in (doom/project-root) t)
         :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"   'doom/find-file-in-emacsd
        :nv "\\"  'doom/find-file-in-dotfiles
        ;; Alternative to C-h (used as window shortcut)
        :n  "h"   'help-command
        (:prefix "d" ; <diff>

;;; 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
