all repos — nixfiles @ 7ea5b52b7ad8f36f7d46796ba581aa1314a5fb25

System and user configuration, managed by nix and home-manager

emacs: find file in project if in project

Alan Pearce
commit

7ea5b52b7ad8f36f7d46796ba581aa1314a5fb25

parent

437486d687e653167f96e1315a5cadf3d9e6014c

1 file changed, 7 insertions(+), 1 deletion(-)

changed files
M user/emacs/init.eluser/emacs/init.el
@@ -1056,6 +1056,12 @@ (evil-ex-define-cmd "pesh[ell]" #'project-eshell)
(evil-ex-define-cmd "pb" #'project-switch-to-buffer) (evil-ex-define-cmd "psw[itch]" #'project-switch-project)))) +(defun my/project-or-not-find-file (&optional include-all) + (interactive "P") + (if (project-current nil) + (call-interactively #'project-find-file) + (call-interactively #'find-file))) + (defun ap/consult-ghq-switch-project (dir) "Append a slash to avoid project.el remembering two different paths for the same project."
@@ -1350,7 +1356,7 @@ "dd" #'dired
"D" #'consult-dir "e" '(:keymap envrc-command-map :package envrc) "fs" #'save-buffer - "ff" #'find-file + "ff" #'my/project-or-not-find-file "fw" #'write-file "fd" #'my/delete-file-and-buffer "fr" #'crux-rename-file-and-buffer