Add :oag and :oagr for searching org files

This commit is contained in:
Henrik Lissner 2016-03-10 23:55:40 -05:00
parent 515171b957
commit de509ab31e
2 changed files with 23 additions and 0 deletions

View file

@ -120,5 +120,25 @@
to-delete)
(setq narf-org-attachments-list attachments)))
;;
;; Easy searching
;;
;; Ex-mode interface for `helm-ag'. If `bang', then `search' is interpreted as
;; regexp.
;;;###autoload (autoload 'narf:org-helm-ag-search "defuns-org-notebook" nil t)
(evil-define-operator narf:org-helm-ag-search (beg end &optional search hidden-files-p regex-p)
:type inclusive :repeat nil
(interactive "<r><a><!>")
(in! org-directory
(narf:helm-ag-search beg end search bang t t)))
;;;###autoload (autoload 'narf:org-helm-ag-regex-search "defuns-org-notebook" nil t)
(evil-define-operator narf:org-helm-ag-regex-search (beg end &optional search bang)
:type inclusive :repeat nil
(interactive "<r><a><!>")
(narf:org-helm-ag-search beg end search bang t))
(provide 'defuns-org-notebook)
;;; defuns-org-notebook.el ends here

View file

@ -74,6 +74,9 @@
;; Org-mode
(exmap "att[ach]" 'narf:org-attach)
(exmap "link" 'narf:org-link)
;; ag-powered search for org-files
(exmap "oag" 'narf:org-helm-ag-search)
(exmap "oagr" 'narf:org-helm-ag-regex-search)
;; Plugins
(after! flycheck