Search

Search   tutorial

Once you are familiar with the basics, basic commands and link concepts, it is time to learn about search.

You can use the standard search for a tag with M-x org-tags-view

You can search for text using M-x org-search-view.

From either of these results pages, you can use C-c l to store links, which you can then add to a document using C-c C-l. You can store multiple links, and you can insert all stored links using C-c C-M-l.

You can also search for test using M-x org-occur-in-agenda-files. This will be faster than org-search-view but you cannot easily extract links from it in the same way.

If you use org-ql, the following code snippet might be useful. Out of the box, org-ql-search will not search org-agenda-files-text-search-files. This method will

(defun zorg-ql-search (query narrow)
  "Search `org-agenda-text-search-extra-files' with `org-ql-search'."
  (interactive (list (read-string "Query: " (when org-ql-view-query
                                              (format "%S" org-ql-view-query)))
                     (or org-ql-view-narrow (eq current-prefix-arg '(4)))))
  (org-ql-search org-agenda-text-search-extra-files query :sort '(date) :super-groups nil :narrow narrow))

Created: 2020-11-28 Sat 17:59

Validate