+;; * Hydra menus
+;; ** Hydra menu for bibtex entries
+;; hydra menu for actions on bibtex entries
+(defhydra jmax-bibtex-hydra (:color blue)
+ "
+_p_: Open pdf _y_: Copy key _n_: New entry _w_: WOS
+_b_: Open url _f_: Copy formatted entry _o_: Copy entry _c_: WOS citing
+_r_: Refile entry _k_: Add keywords _d_: delete entry _a_: WOS related
+_e_: Email entry _K_: Edit keywords _L_: clean entry _P_: Pubmed
+_U_: Update entry _N_: Open notes _R_: Crossref _g_: Google Scholar
+_s_: Sort entry _a_: Remove nonascii _h_: helm-bibtex _q_: quit
+_u_: Update field _f_: file funcs
+"
+ ("p" org-ref-open-bibtex-pdf)
+ ("P" jmax-bibtex-pubmed)
+ ("w" jmax-bibtex-wos)
+ ("c" jmax-bibtex-wos-citing)
+ ("a" jmax-bibtex-wos-related)
+ ("R" jmax-bibtex-crossref)
+ ("g" jmax-bibtex-google-scholar)
+ ("n" jmax-bibtex-new-entry/body)
+ ("N" org-ref-open-bibtex-notes)
+ ("o" bibtex-copy-entry-as-kill)
+ ("d" bibtex-kill-entry)
+ ("L" org-ref-clean-bibtex-entry)
+ ("y" (kill-new (bibtex-autokey-get-field "=key=")))
+ ("f" bibtex-copy-summary-as-kill)
+ ("k" helm-tag-bibtex-entry)
+ ("K" (lambda ()
+ (interactive)
+ (org-ref-set-bibtex-keywords
+ (read-input "Keywords: "
+ (bibtex-autokey-get-field "keywords"))
+ t)))
+ ("b" org-ref-open-in-browser)
+ ("r" (lambda () (interactive)
+ (bibtex-beginning-of-entry)
+ (bibtex-kill-entry)
+ (find-file (ido-completing-read
+ "Bibtex file: "
+ (f-entries "." (lambda (f) (f-ext? f "bib")))))
+ (goto-char (point-max))
+ (bibtex-yank)
+ (save-buffer)
+ (kill-buffer)))
+ ("e" email-bibtex-entry)
+ ("U" (doi-utils-update-bibtex-entry-from-doi (jmax-bibtex-entry-doi)))
+ ("u" doi-utils-update-field)
+ ("f" jmax-bibtex-file/body)
+ ("h" helm-bibtex)
+ ("a" jmax-replace-nonascii)
+ ("s" org-ref-sort-bibtex-entry)
+ ("q" nil))
+
+;; create key-chord and key binding for hydra
+(when jmax-bibtex-hydra-key-chord
+ (key-chord-define-global
+ jmax-bibtex-hydra-key-chord
+ 'jmax-bibtex-hydra/body))
+
+
+(when jmax-bibtex-hydra-key-binding
+ (global-set-key jmax-bibtex-hydra-key-binding 'jmax-bibtex-hydra/body))
+
+;; ** Hydra menu for new bibtex entries
+;; A hydra for adding new bibtex entries.
+(defhydra jmax-bibtex-new-entry (:color blue)
+ "New Bibtex entry:"
+ ("a" bibtex-Article "Article")
+ ("b" bibtex-Book "Book")
+ ("i" bibtex-InBook "In book")
+ ("l" bibtex-Booklet "Booklet")
+ ("P" bibtex-Proceedings "Proceedings")
+ ("p" bibtex-InProceedings "In proceedings")
+ ("m" bibtex-Misc "Misc.")
+ ("M" bibtex-Manual "Manual")
+ ("T" bibtex-PhdThesis "PhD Thesis")
+ ("t" bibtex-MastersThesis "MS Thesis")
+ ("R" bibtex-TechReport "Report")
+ ("u" bibtex-Unpublished "unpublished")
+ ("c" bibtex-InCollection "Article in collection")
+ ("q" nil "quit"))
+
+
+;; ** Hydra menu of functions to act on a bibtex file.
+(defhydra jmax-bibtex-file (:color blue)
+ "Bibtex file functions: "
+ ("v" bibtex-validate "Validate entries")
+ ("s" bibtex-sort-buffer "Sort entries")
+ ("r" bibtex-reformat "Reformat entries")
+ ("c" bibtex-count-entries "Count entries")
+ ("p" org-ref-build-full-bibliography "PDF bibliography"))
+
+
+;; * DEPRECATED bibtex menu