Obsidian Emacs Bindings

unlisted

by kaz8096

Emacs bindings for Obsidian

3 starsUpdated 12d ago
View on GitHub

Obsidian Emacs Bindings

This is Emacs Key Bindings plugin for Obsidian (https://obsidian.md)

Usage

Simple emacs keys are supported, including selection and yank.
These key mappings don't appear in Obsidian HotKeys.

C- means Control, M- means Alt (Option on macOS), and S- means Shift. These refer to the modifiers received by Obsidian after any Karabiner or other keyboard remapping. This plugin also recognizes Command as Meta on macOS, provided the corresponding Obsidian shortcut has been cleared (see below).

Here's some informative table for the key bindings (not fully listed)

Movement

keyfunction
C-pprevious-line
C-nnext-line
C-bbackward-char
C-fforward-char
M-bbackward-word
M-fforward-word
C-abeginning-of-line
C-eend-of-line
S-M-,beginning-of-buffer
S-M-.end-of-buffer
C-vscroll-up-command
M-vscroll-down-command

Selection

Shift + movement except S-M-, and S-M-. (instead you may use S-C-Home and S-C-End for the selection)

keyfunction
C-x C-p/C-x hmark-whole-buffer

Basic Editing

keyfunction
C-hdelete-backward-char
C-ddelete-char
C-menter-key
M-dkill-word
C-kkill-line
M-hmark-paragraph
M-@mark-word
C-yyank
M-yyank-pop
C-gkeyboard-quit
C-wkill-region
M-wkill-ring-save
C-Spaceset-mark-command
C-x C-xexchange-point-and-mark
C-/undo
S-C-/undo-redo

Find and Search

keyfunction
C-sopen search panel (not isearch-forward)
C-ropen search panel (not isearch-backward)
M-C-sfind next
M-C-rfind previous
S-M-5query-replace via the search/replace panel

Note

This plugin doesn't use HotKeys of Obsidian. Therefore some keys might conflict with the hotkey configurations.
If you want to enable emacs keybindings binding, you must delete your hot key assignment for the key combination on HotKeys.

Heads-up : C-a and C-y are forcibly overwritten in this plugin.

For example, C-Space, movement, then M-w copies the selected region. If Command+w reaches Obsidian, its default Close current tab shortcut takes precedence and can replace the last open note with an empty tab. Clear that assignment in Settings → Hotkeys to use Command+w for kill-ring-save, or use the key that sends Option+w. Karabiner can make the physical key labels differ from these logical modifiers. The E2E fixture clears these conflicts explicitly; see TESTING.md.

How to use

yarn install
yarn build

and then copy over main.js, styles.css, manifest.json to your vault VaultFolder/.obsidian/plugins/obsidian-emacs-bindings/.

Development

Automated checks and tests require Node.js 24 and Yarn 1.22.22:

yarn install --frozen-lockfile
yarn check
yarn build
yarn test:e2e

GitHub Actions runs static checks, unit tests, and real Obsidian operation tests on macOS and Linux. Every Usage binding above, including aliases and Shift selection, has an E2E scenario; a coverage check detects missing scenarios when the tables change. See TESTING.md for the test environment, coverage, local setup, and failure artifacts.

Dev Server

yarn run dev

Format

yarn format:check
yarn format:fix

Lint

yarn lint
yarn lint:fix

License

This software is distributed under the MIT License. For more details, please see the LICENSE file.

Third-Party Component License Information

This software includes the following components, each subject to its respective license terms:

  • [codemirror-emacs]: For detailed licensing information and usage conditions of this component, please refer to the original source here.

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.