org-roam / org-roam-bibtex

Org Roam integration with bibliography management software
GNU General Public License v3.0
572 stars 47 forks source link

Bind orb-note-actions #260

Closed albertfgu closed 1 year ago

albertfgu commented 1 year ago

I apologize for the basic question. The documentation says to "bind the orb-note-actions command to a key such as C-c n a", but I'm not sure the proper way to do this. It's hard to find example configs online, and there was one that I saw that did

(define-key org-roam-bibtex-mode-map (kbd "C-c n a") #'orb-note-actions)

However this gives me an error as the variable org-roam-bibtex-mode-map doesn't exist. What's the proper way to create this binding?

myshevchuk commented 1 year ago

There are multiple ways of doing it. If you use use-package, you could use its :bind section. In your case, you are using a basic low-level command, which is also fine. But with most low-level commands, you need to understand a bit about what you are doing or like read a little bit more to understand. It's very easy to find good Emacs documentation online, the Emacs and Elisp reference manuals being excellent starting points. Alternatively, press C-h i or type M-x info in Emacs.

That said, you are most likely setting the key before ORB has been loaded and therefore the variable is not defined yet. However, you do not need to use org-roam-bibtex-mode-map, you can use any other reasonable keymap, e.g. org-mode-map: (define-key org-mode-map (kbd "C-c n a") #'orb-note-actions)

I'm closing this because I don't see any issues here.