Add helm-based org searching commands

This commit is contained in:
Henrik Lissner 2015-11-21 19:26:17 -05:00
parent 31291af29d
commit a1b57eda3a
5 changed files with 36 additions and 15 deletions

1
Cask
View file

@ -155,6 +155,7 @@
(depends-on "ob-http") (depends-on "ob-http")
(depends-on "ob-go" :git "https://github.com/pope/ob-go") (depends-on "ob-go" :git "https://github.com/pope/ob-go")
(depends-on "org-download") (depends-on "org-download")
(depends-on "helm-deft" :git "https://github.com/dfeich/helm-deft")
;; PlantUML -- modules/module-plantuml.el ;; PlantUML -- modules/module-plantuml.el
(depends-on "puml-mode") (depends-on "puml-mode")

View file

@ -149,5 +149,7 @@
(use-package helm-command :commands helm-M-x) (use-package helm-command :commands helm-M-x)
(use-package helm-descbinds :commands helm-descbinds) (use-package helm-descbinds :commands helm-descbinds)
(use-package helm-deft :defer t)
(provide 'core-helm) (provide 'core-helm)
;;; core-helm.el ends here ;;; core-helm.el ends here

View file

@ -90,5 +90,19 @@
(interactive "<a><!>") (interactive "<a><!>")
(if bang (helm-multi-swoop-all search) (helm-swoop :$query search))) (if bang (helm-multi-swoop-all search) (helm-swoop :$query search)))
;;;###autoload
(defun narf/helm-org-search (&optional directory)
(interactive)
(require 'helm-ag)
(require 'helm-deft)
(let ((dir (or directory org-directory)))
(let ((helm-deft-dir-list `(,dir))
(default-directory dir)
(helm-ag--default-directory dir))
(helm :sources `(,(if directory
'helm-source-deft-fn
'helm-source-projectile-files-list)
helm-source-do-ag)))))
(provide 'defuns-helm) (provide 'defuns-helm)
;;; defuns-helm.el ends here ;;; defuns-helm.el ends here

View file

@ -39,23 +39,21 @@
;;; Deft ;;; Deft
;;;###autoload ;;;###autoload
(defun narf/deft-projects () (defun narf/helm-org-projects ()
(interactive) (interactive)
(require 'deft) (narf/helm-org-search org-directory-projects))
(let ((deft-directory org-directory-projects))
(deft)))
;;;###autoload ;;;###autoload
(defun narf/deft-contact () (defun narf/helm-org-contacts ()
(interactive) (interactive)
(require 'deft) (narf/helm-org-search org-directory-contacts))
(let ((deft-directory org-directory-contacts))
(deft)))
;;;###autoload ;;;###autoload
(defun narf/deft-invoices ()) (defun narf/helm-org-invoices ()
(interactive)
(narf/helm-org-search org-directory-invoices))
;;;###autoload ;;;###autoload
(defun narf/deft-writing ()) (defun narf/helm-org-writing ()
(interactive)
(narf/helm-org-search (expand-file-name "writing/" org-directory)))
(provide 'defuns-org-custom) (provide 'defuns-org-custom)
;;; defuns-org-custom.el ends here ;;; defuns-org-custom.el ends here

View file

@ -124,8 +124,6 @@
:nv "]" 'helm-etags-select :nv "]" 'helm-etags-select
:nv "a" 'helm-projectile-find-other-file :nv "a" 'helm-projectile-find-other-file
:nv "E" (λ (in! narf-emacs-dir (helm-projectile-find-file))) :nv "E" (λ (in! narf-emacs-dir (helm-projectile-find-file)))
:nv "n" (λ (in! org-directory (helm-projectile-find-file)))
:nv "N" 'narf:org-search-files-or-headers
:nv "m" 'helm-recentf :nv "m" 'helm-recentf
:nv "M" 'helm-projectile-recentf ; recent PROJECT files :nv "M" 'helm-projectile-recentf ; recent PROJECT files
:nv "p" 'helm-projectile-switch-project :nv "p" 'helm-projectile-switch-project
@ -144,7 +142,15 @@
:n "ol" (λ (narf-open-with "LaunchBar")) :n "ol" (λ (narf-open-with "LaunchBar"))
:n "oL" (λ (narf-open-with "LaunchBar" default-directory)) :n "oL" (λ (narf-open-with "LaunchBar" default-directory))
:n "ot" (λ (narf:tmux-chdir nil t)) :n "ot" (λ (narf:tmux-chdir nil t))
:n "oT" 'narf:tmux-chdir) :n "oT" 'narf:tmux-chdir
;; Org
:nv "n." (λ (in! org-directory (let ((helm-ff-skip-boring-files t)) (helm-find-files-1 org-directory))))
:nv "n/" 'narf/helm-org-search
:nv "np" 'narf/helm-org-projects
:nv "nc" 'narf/helm-org-contacts
:nv "ni" 'narf/helm-org-invoices
:nv "nw" 'narf/helm-org-writing)
;; <localleader> ;; <localleader>
(:prefix "\\" (:prefix "\\"