# How to get org-roam keybindings working after an emacs restart

**URL:** <https://org-roam.discourse.group/t/how-to-get-org-roam-keybindings-working-after-an-emacs-restart/3857>\
**Category:** Troubleshooting\
**Created:** [September 1, 2025, 6:56am UTC](https://org-roam.discourse.group/t/how-to-get-org-roam-keybindings-working-after-an-emacs-restart/3857 "2025-09-01T06:56:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChuckSneed](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/chucksneed/32/1379_2.png) [@ChuckSneed](https://org-roam.discourse.group/u/ChuckSneed)\
**Post date:** [September 1, 2025, 6:56am UTC](https://org-roam.discourse.group/t/how-to-get-org-roam-keybindings-working-after-an-emacs-restart/3857/1 "2025-09-01T06:56:53Z")

</div>

Here’s the portion of my org-roam config where I define keybindings:

```lisp
(use-package org-roam
  :ensure nil
  :after org
  :bind (("C-c n l" . org-roam-buffer-toggle)
         ("C-c n f" . org-roam-node-find)
         ("C-c n g" . org-roam-graph)
         ("C-c n i" . org-roam-node-insert)
         ("C-c n c" . org-roam-capture)
		 ("C-c n j" . org-roam-dailies-capture-today))
  :bind-keymap (("C-c n d" . org-roam-dailies-map))
  :custom
  (org-roam-directory (expand-file-name "~/Documents/org/roam/"))

```

However, after an emacs restart, the `C-c n` keychord is not available to me, emacs says `C-c n` is undefined. I can use `M-x org-roam-node-find` **and only then** my `C-c n ` keychord become available to me. How can I get it available to me even after a fresh emacs start?

* * *

Edit: I have `use-package-always-defer` enabled, if it matters:

```lisp
(use-package use-package
  :demand t
  :custom
  (use-package-hook-name-suffix nil)
  (use-package-compute-statistics t)
  (use-package-always-defer t))

```

---

<div class="post-metadata">

**Author:** ![ChuckSneed](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/chucksneed/32/1379_2.png) [@ChuckSneed](https://org-roam.discourse.group/u/ChuckSneed)\
**Post date:** [September 1, 2025, 7:01am UTC](https://org-roam.discourse.group/t/how-to-get-org-roam-keybindings-working-after-an-emacs-restart/3857/2 "2025-09-01T07:01:47Z")

</div>

I noticed that my deferring of org mode was a contributing factor. And once I visit a single org file (and hence load the org mode in my emacs), the `C-c n` keychord becomes available to me.

---

<div class="post-metadata">

**Author:** ![ChuckSneed](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/chucksneed/32/1379_2.png) [@ChuckSneed](https://org-roam.discourse.group/u/ChuckSneed)\
**Post date:** [September 1, 2025, 7:13am UTC](https://org-roam.discourse.group/t/how-to-get-org-roam-keybindings-working-after-an-emacs-restart/3857/3 "2025-09-01T07:13:13Z")

</div>

Is there something like `org-roam-prefix-map`? Grepping the source code got me zero hits.

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [September 1, 2025, 10:11am UTC](https://org-roam.discourse.group/t/how-to-get-org-roam-keybindings-working-after-an-emacs-restart/3857/4 "2025-09-01T10:11:46Z")

</div>

`org-roam` comes with one major mode and one minor mode, both of which should create a keymap. But… I have a feeling that’s not what you are after.

If you want to use these keybindings after init, and yet defer the loading of commands for quicker init, I think all you need is to remove `:after org`. You can try, relaunch Emacs, and see what happens. I have a feeling that’s what you wish to do?

```auto
  :after org
  :bind (("C-c n l" . org-roam-buffer-toggle)
         ("C-c n f" . org-roam-node-find)
         ("C-c n g" . org-roam-graph)
         ("C-c n i" . org-roam-node-insert)
         ("C-c n c" . org-roam-capture)
		 ("C-c n j" . org-roam-dailies-capture-today))

```

With `:after org`, your whole `(use-package org-roam ...)` form gets evaluated only after org is loaded, so the keybindings are undefined after init.

Without `:after org`, `(use-package org-roam ...)`should get evaluated when your init is evaluated, so keybindings can be used after init. But because of how `:bind` works in `use-package` it will defer loading of these org-roam commands.

I could be wrong, but you can try this and let us know if I am mistaken.

If I am mistaken about `:bind` you can still directly define keybindings and defer loading of the comands.

---

<div class="post-metadata">

**Author:** ![ChuckSneed](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/chucksneed/32/1379_2.png) [@ChuckSneed](https://org-roam.discourse.group/u/ChuckSneed)\
**Post date:** [September 1, 2025, 1:51pm UTC](https://org-roam.discourse.group/t/how-to-get-org-roam-keybindings-working-after-an-emacs-restart/3857/5 "2025-09-01T13:51:13Z")

</div>

You were right about `:after`. I removed it. It now works.
