;; Enable ivy completion everywhere
(ivy-mode 1)

;; Begginer configuration
(setq ivy-use-virtual-buffers t)
(setq ivy-count-format "(%d/%d) ")

(global-set-key (kbd "C-s") 'swiper)
(global-set-key (kbd "M-x") 'counsel-M-x)
(global-set-key (kbd "C-x C-f") 'counsel-find-file)
;(global-set-key (kbd "<f1> f") 'counsel-describe-function)
;(global-set-key (kbd "<f1> v") 'counsel-describe-variable)
;(global-set-key (kbd "<f1> l") 'counsel-find-library)
;(global-set-key (kbd "<f2> i") 'counsel-info-lookup-symbol)
;(global-set-key (kbd "<f2> u") 'counsel-unicode-char)

;; ivy-bibtex
(setq bibtex-completion-bibliography
      '("~/repos/notabug/pesquisa/memory.bib"))
;; where are the pdfs
(setq bibtex-completion-library-path
      '("~/repos/notabug/pesquisa/memory"))
;; where are the notes
(setq bibtex-completion-notes-path "~/repos/notabug/pesquisa/paper_notes.org")
;; some handy visual markers
(setq bibtex-completion-pdf-symbol "⌘")
(setq bibtex-completion-notes-symbol "✎")
;; open pdfs in mupdf
(setq bibtex-completion-pdf-open-function
  (lambda (fpath)
    (call-process "mupdf" nil 0 nil fpath)))
