I'm very new to customizing Emacs, and haven't written Elisp commands before. I'm struggling to find a command and key binding that combines
find-file-in-project (or similar), perhaps a:
such that given a file/folder structure:
├── main.txt ├── file1.txt └── somepath └── file2.txt
where I'm editing
% cat main.txt line 1 file1.txt line 2 file2.txt
and a shortcut will find
file2.txt when my cursor is somewhere on the text of
file2.txt - despite it being located in
./somepath/file2.txt. It would be safe to assume to start the search relative to
main.txt. Ideally, open the file if only 1 match is found, otherwise list possible choices in minibuffer.
I have had success opening
main.txt OK, even w/o confirmation with this pretty neat command.
I'm typically not dealing with a "project" (.git) folder structures, & folder/file structure isn't that large where an overly complex package is needed (where it might to run/index in background).
My apologies if I missed an obvious solution.
Other commands & packages functions that appear useful, but I don't have the expertise to combine them in the way I want:
- Macro to open the file path under cursor without confirmation.
- FFAP: find-file-at-point
- FFIP: find-file-in-project
- ivy, swipe, counsel