Doom Emacs Memento

Tps de lecture estimé:4 minutes 38 secondes
outils développement emacs

Doom Emacs Memento

Voici une liste des principales notions et commandes utilisées par Emacs avec la configuration spécifique proposé par son extension nommée Doom.
Ce fichier est un canevas qui s'étoffera au fur et à mesure de mes expérimentations sur cet outil et son éco système .


DistroTube Reference


  • Installing dependencies : + Git 2.23+

    • Emacs 26.1+ (27.x is recommended)
    • ripgrep 11.0+
    • GNU Find
    • (Optional) fd 7.3.0+ (known as fd-find on Debian, Ubuntu & derivatives) – improves performance for many file indexing commands
  • Installing Doom Emacs : git clone ~/.emacs.d

    • ~/.emacs.d/bin/doom install: doom install will set up your DOOMDIR at ~/.doom.d (if it doesn’t already exist) and will work you through the first-time setup of Doom Emacs. Carefully follow any instructions it puts out.
    • If this is your first time, you should run doom doctor. This will diagnose common issues with your system or config.

Utilities found in bin/doom

  • doom sync: Synchronizes your config with Doom Emacs. It ensures that needed packages are installed, orphaned packages are removed and necessary metadata correctly generated. Run this whenever you modify your doom! block or packages.el file. You’ll need doom sync -u if you override the recipe of package installed by another module.
  • doom upgrade: Updates Doom Emacs (if available) and all its packages. Doom is an active project and many of its 300+ packages are in active development as well. It is wise to occasionally update
  • doom upgrade --packages : To update only your packages (and not Doom itself)
  • doom doctor: If Doom misbehaves, the doc will diagnose common issues with your installation, system and environment.
  • doom purge: Over time, the repositories for Doom’s plugins will accumulate. Run this command from time to time to delete old, orphaned packages, and with the -g switch to compact existing package repos.
  • doom env: (Re)generates an “envvar file”, which is a snapshot of your shell environment that Doom loads at startup. If your app launcher or OS launches Emacs in the wrong environment you will need this. This is required for GUI Emacs users on MacOS.
  • doom help: An overview of the available commands that doom provides. Use /doom help COMMAND/ to display documentation for a particular COMMAND.


  • I recommend you add your .emacs.d/bin to your PATH so you can call doom directly and from anywhere. Accomplish this by adding this to your .bashrc or .zshrc file: ~export PATH="$HOME/.emacs.d/bin:$PATH"
  • DOOMDIR: You can configure Doom by tweaking the files found in your DOOMDIR. Doom expects this directory to be found in one of:
    • ~/.config/doom (respects $XDG_CONFIG_HOME):
    • ~/.doom.d: This directory is referred to as your DOOMDIR. Only one of these directories should exist (Doom will only recognize one).

Configuration Files

  • init.el : Where you’ll find your doom! block, which controls what Doom modules are enabled and in what order they will be loaded. This file is evaluated early when Emacs is starting up; before any other module has loaded. You generally shouldn’t add code to this file unless you’re targeting Doom’s CLI or something that needs to be configured very early in the startup process.
  • config.el : Here is where 99.99% of your private configuration should go. Anything in here is evaluated after all other modules have loaded, when starting up Emacs.
  • packages.el : Package management is done from this file; where you’ll declare what packages to install and where from.

Package management

Doom Emacs does not use package.el (the package manager built into Emacs). Packages are declared in packages.el files (in DOOMDIR).

  • To install a package, add a package! declaration for it to DOOMDIR/packages.el
;; Install a package named "example" from ELPA, MELPA, or Emacsmirror
(package! example)

IMPORTANT: New packages won’t be installed until you run doom sync.
DO NOT configure packages here (definitely no use-package! or after! in here!). This file is read in an isolated environment and will have no lasting effect.

Key Bindings

Vanilla Emacs (no evil mode)


SPC: start highlight text
C-x C-f: find/open file. You can type full path to a file or create a new document. You could also just open the path to a directory and find the file.
C-x C-+, C-x C--: Zoom In/Out
C-h v: kill-ring
C-x 0: close the kill-ring window
C-x C-s Save
C-x C-c Quit

Basic Navigation

C-p, C-n, C-f, C-b: Move cursor up/down/forwards/backwards
M-f, M-b: move forward/back by words
C-a, C-e: move to beginning/end of line
M-a, M-e: move backwards/forwards by sentence
M-{, M-}: move backwards/forwards by paragraph
M-<, M->: move beginning/end of file
M-g g: goto line number
ESC- C-n/p/f/b: perform move that of times

Cut, Copy and Paste

C-space: select text to copy/cut
C-w: cut highlighted
M-w: copy highlighted
C-y: paste
C-k: cut to end of line?
C-x: backspace, M-k (backwards/forwards) delete the current line
M-z: character cuts to that character
ESC-number ESC-d: delete that number of words
C-x u: undo
C-y Esc-y: to cycle through kill-ring for paste


M-c: capitalizes a word
M-u: uppercase word
M-l: lowercase word
M-$: Spell Check current word


C-x b: select another buffer
C-x C-b: list all buffers
C-x k: kill a buffer


C-s to search forward
C-r to search backward
M-% (shift-5) : Query replace. Will only look forward in the file!. RET exits the query replace

Splits Windows

C-x 2 Horizontal Split
C-x 3 Vertical Split
C-x 0 Close window
C-x 4f Opens file in other window
C-x o moves cursor to next frame

DOOM Emacs

  • see file

Article précédent