Files
emacs.d/elisp/ivy-setup.el

46 lines
1.4 KiB
EmacsLisp

;; Enable ivy completion everywhere
(ivy-mode 1)
;; Begginer configuration
(setq ivy-count-format "(%d/%d) ")
;; keybindings
(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)
(global-set-key (kbd "<f2>") 'ivy-bibtex)
;; ivy-bibtex
(setq bibtex-completion-bibliography
'("~/repos/research/bibliography.bib"))
;; where are the pdfs
(setq bibtex-completion-library-path
'("~/repos/research/papers"))
;; where are the notes
(setq bibtex-completion-notes-path "~/repos/research/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)))
;add actions to end of default actions list
(ivy-add-actions
'ivy-bibtex
'(("c" ivy-bibtex-insert-citation "Insert reference" ivy-bibtex-insert-citation)))
;; use firefox as default browser
(setq bibtex-completion-browser-function
(lambda (url _) (start-process "firefox" "*firefox*" "firefox" url)))