"The best editor is Emacs, not Vim, even though I use Doom."
This is my cross-platform (macOS + Ubuntu) Doom Emacs configuration.
It combines Emacs Lisp extensibility, Vim's editing efficiency, and Doom Emacs's streamlined keybinding system.
- Evil-mode: Modal editing with full Vim keybindings.
-
Space-leader control: High-level command access via
SPC, Doom's minimalistic keybinding philosophy. -
LSP support: Built-in support for
clangdandpyrightvialsp-mode. -
Org: organize, and
$\LaTeX$ size setting. - Magit: Full Git porcelain within Emacs.
- Treemacs: Project drawer for easy navigation.
- Cross-platform: Custom macOS keyboard mapping included, compatible with Linux.
-
Custom Escape key:
jjacts as Escape in insert/visual modes (via thekey-chordpackage).
- Completion:
vertico,corfu +orderless - UI:
doom,treemacs,modeline,vc-gutter,workspaces - Editor:
evil +everywhere,fold,snippets,file-templates - Emacs Core:
dired,undo,vc - LSP Tools:
lsp,magit,lookup,eval +overlay - Language Support:
cc +lsp(C/C++)python +lspemacs-lisp,sh,markdown,org
- App:
everywhere(allows embedding Emacs windows across system) - Config:
default +bindings +smartparens
| Command | Key |
|---|---|
| Find file | SPC f f |
| Recent files | SPC f r |
| Save file | SPC f s |
| Project switch | SPC p p |
| Project grep | SPC / |
| Command | Key |
|---|---|
| Open Magit | SPC g g |
| Git blame | SPC g b |
| Command | Key |
|---|---|
| Reload config | SPC h r r |
| Describe keybinding | SPC h m |
| Open Doom docs | SPC h d h |
| Restart Emacs | SPC q r |
| Command | Key | Purpose |
|---|---|---|
| Execute command | M-x |
Always available fallback |
| Cancel command | C-g |
Universal cancel/abort |
Use vim-key setting at most.
- On macOS,
Right Optionis mapped toMeta,Left Optionis disabled. jjacts as Escape in insert/visual modes (via thekey-chordpackage).- Compatible with Ubuntu.
.doom.d/can be versioned via Git for portability.
First, make sure your emacs is installed by following the official getting started guide. You should install the correct version.
After that, install the basic doom emacs.
git clone https://github.com/hlissner/doom-emacs ~/.emacs.d
~/.emacs.d/bin/doom installIt's recommended to add ~/.emacs.d/bin/ into your $PATH, so that you can directly use doom command instead of running ~/.emacs.d/bin/doom. Here is an example on zsh.
echo 'export PATH="$HOME/.emacs.d/bin:$PATH"' >> ~/.zshrc
source ~/.zshrcThen remove your original .doom.d/, clone this repository, and run doom sync.
rm -rf ~/.doom.d
git clone git@github.com:hanbinzheng/.doom.d.git ~/.doom.d
doom sync