feat(emacs): search project

This commit is contained in:
2025-11-05 05:04:40 -07:00
parent ac6e2aaf12
commit b0347ff995

View File

@@ -34,13 +34,6 @@ directory itself."
"Change the working directory to the root of the current project." "Change the working directory to the root of the current project."
(cd (syd-project-root))) (cd (syd-project-root)))
(defun syd-project-search ()
(interactive)
(require 'syd-file)
;; TODO: Prompt for path project root is not found.
;; TODO: Respect gitignore.
(syd-search-directory (syd-project-root)))
(with-eval-after-load 'project ; Built-in (with-eval-after-load 'project ; Built-in
;; Stay out of my config directory! ;; Stay out of my config directory!
(setq project-list-file (file-name-concat syd-cache-dir "known-projects")) (setq project-list-file (file-name-concat syd-cache-dir "known-projects"))
@@ -64,6 +57,16 @@ directory itself."
(add-to-list 'project-switch-commands (add-to-list 'project-switch-commands
(funcall switch-cmd #'syd-project-root-find-file "Browse")))) (funcall switch-cmd #'syd-project-root-find-file "Browse"))))
(defun syd-project-search ()
(interactive)
;; TODO: Prompt for path project root is not found.
;; TODO: Respect gitignore.
(syd-search-directory (syd-project-root)))
(general-def
:prefix-map 'syd-leader-map
"/" `("Search project" . ,#'syd-project-search))
;; Projection provides a Projectile-like project management library atop ;; Projection provides a Projectile-like project management library atop
;; Emacs built-in project.el. It's more lightweight, while still featureful. ;; Emacs built-in project.el. It's more lightweight, while still featureful.
(use-package projection (use-package projection