Skip to content

Commit

Permalink
fixup! Add (optional) ebib support to bibtex layer
Browse files Browse the repository at this point in the history
  • Loading branch information
dalanicolai committed Jul 6, 2021
1 parent cf1e33d commit 81fb4e6
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 11 deletions.
6 changes: 3 additions & 3 deletions layers/+lang/bibtex/README.org
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,6 @@ key binding added:
| ~q~ | quit entry buffer |

*Biblio selection buffer*
| ~e~ | import entry to current database |
| ~C-j~ | Next entry |
| ~C-k~ | Previous entry |
| ~e~ | import entry to current database (requires 'active' database in ebib index buffer) |
| ~C-j~ | Next entry |
| ~C-k~ | Previous entry |
26 changes: 26 additions & 0 deletions layers/+lang/bibtex/config.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
;;; config.el --- Org configuration File for Spacemacs
;;
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.

;;; Variables

(defvar bibtex-enable-ebib-support nil
"If non-nil, the ebib database manager will be installed.")
5 changes: 5 additions & 0 deletions layers/+lang/bibtex/funcs.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(defun spacemacs/bibtex-find-bib-file ()
(interactive)
(pop-to-buffer
(find-file-noselect
(completing-read "Select file for opening: " ebib-preload-bib-files))))
17 changes: 9 additions & 8 deletions layers/+lang/bibtex/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,13 @@
(evilified-state-evilify-map ebib-log-mode-map
:mode ebib-log-mode)

(use-package ebib-biblio
:after (ebib biblio)
:config
(evilified-state-evilify-map biblio-selection-mode-map
:mode biblio-selection-mode
:bindings
"e" 'ebib-biblio-selection-import))))
(require 'ebib-biblio)
(evilified-state-evilify-map biblio-selection-mode-map
:mode biblio-selection-mode
:bindings
"e" 'ebib-biblio-selection-import
(kbd "C-j") 'biblio--selection-next
(kbd "C-k") 'biblio--selection-previous)))

(defun bibtex/init-biblio()
(use-package biblio
Expand All @@ -160,4 +160,5 @@
:mode biblio-selection-mode
:bindings
(kbd "C-j") 'biblio--selection-next
(kbd "C-k") 'biblio--selection-previous)))
(kbd "C-k") 'biblio--selection-previous)
(require 'ebib-biblio)))

0 comments on commit 81fb4e6

Please sign in to comment.