VS Code keymap for Obsidian

Posted Sep 24, 2021

I recently got the chance to try out Obsidian, and while it’s still in dire need of some UX polish, it strikes me as a very promising project that aligns well with my personal philosophy of what a notes app should do. Perhaps one day it will replace Bear as my favorite notes app.

While the editor looks superficially like the one in Visual Studio Code it differs quite a bit in its default keyboard shortcuts, which is annoying if you use both apps regularly. Obsidian’s shortcut system is not quite as sophisticated as Code’s (for instance, key sequences are not supported) but I’ve done what I can to make Obsidian behave more Code-like. In particular, remapping the quick switcher and command palette to Cmd+P and Cmd+Shift+P, respectively, is a small change that makes a big difference.

Here’s my current Obsidian keymap customizations. You can copy some or all of them into .obsidian/hotkeys.json inside each vault.

{
  "editor:swap-line-down": [
    {
      "modifiers": ["Alt"],
      "key": "ArrowDown"
    }
  ],
  "editor:swap-line-up": [
    {
      "modifiers": ["Alt"],
      "key": "ArrowUp"
    }
  ],
  "command-palette:open": [
    {
      "modifiers": ["Mod", "Shift"],
      "key": "P"
    }
  ],
  "switcher:open": [
    {
      "modifiers": ["Mod"],
      "key": "P"
    }
  ],
  "editor:delete-paragraph": [
    {
      "modifiers": ["Mod", "Shift"],
      "key": "K"
    }
  ],
  "workspace:close-others": [
    {
      "modifiers": ["Alt", "Mod"],
      "key": "T"
    }
  ],
  "workspace:copy-path": [
    {
      "modifiers": ["Alt", "Mod"],
      "key": "C"
    }
  ],
  "file-explorer:open": [
    {
      "modifiers": ["Mod", "Shift"],
      "key": "E"
    }
  ],
  "editor:toggle-bold": [
    {
      "modifiers": ["Mod", "Shift"],
      "key": "B"
    }
  ],
  "app:toggle-left-sidebar": [
    {
      "modifiers": ["Mod"],
      "key": "B"
    }
  ],
  "editor:focus-left": [
    {
      "modifiers": ["Mod"],
      "key": "1"
    }
  ],
  "editor:focus-right": [
    {
      "modifiers": ["Mod"],
      "key": "2"
    }
  ],
  "app:go-back": [
    {
      "modifiers": ["Ctrl"],
      "key": "-"
    }
  ],
  "app:go-forward": [
    {
      "modifiers": ["Ctrl", "Shift"],
      "key": "-"
    }
  ]
}

hotkeys.json on GitHub