I am new to emacs, and org-mode pulled me away from vim. I am getting a hang of it. One thing I am missing a lot is a hierarchical search in emacs. I wrote a python script for that in vim, and I am looking for a solution in emacs (org-mode).
Let me explain. Let us say, here is the file:
* People
** Software related help
*** John
*** Amit
** Personal
*** John
*** Mike
* Project
** With Mike
*** Website development
When I am searching for a heading, I usually know I am searching for mike
, but once I see that there are too many search results (I use 'swiper-all), I want to narrow the search based what the child headings and parent headings contain. In this case, I might want to extend the search to mike people
or mike project
based on what kind of heading I am searching for.
In other words, if each heading is a node in the tree, I want to search not only in the node, but in the concatenation of all nodes up to the root. (See a couple other nice-to-haves below.)
Is there any solution or package avaiable for this? If not, can you point me to how to go about writing a script/package for this?
Nice to haves:
- Ideally, the file name would be considered as the level zero heading.
- Ideally, the order of words in the search term does not matter. I sometimes don't remember if I wrote
With Mike
belowProject
heading, or wroteProject
belowMike
heading. In either case, I want to just search formike project
and be able to find what I am looking for.
counsel-org-goto
and that lead me tocounsel-org-goto-all
, which does the search across all files. I am not sure which files it searches in. Probably all agenda files. Or open buffers (I need to check). I will look into ignoring the order of words.counsel-org-goto-all
andivy–regex-ignore-order
worked perfectly for me. The only thing missing is now the "Nice to have #1". Thanks for helping me. If you write this up quickly as an answer, I would definitely accept your answer.