Tuto Emacs
Table of Contents
Installation on MacOS
Installation de Homebrew
bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" echo >> /Users/xavier.zprofile echo 'eval "$(opt/homebrew/bin/brew shellenv)"' >> /Users/xavier.zprofile
Installation des librairies et soft utils
brew install gnutls brew install gcc brew install libgccjit brew install texinfo brew install guile-gnutls
Caractère spéciaux
Commencer par mettre en place les fonctions suivantes:
;; ----------------------------------------------------------------------------- ;; Special characters ;; ----------------------------------------------------------------------------- ;; To use right "Option" Key for special characters ;; Example: "Right Option + Shift + L gives |"" (setq mac-option-modifier 'meta) ;; La touche Option gauche devient Meta (setq mac-right-option-modifier nil) ;; La touche Option droite reste Alt (define-key key-translation-map (kbd "M-5") (kbd "[")) (define-key key-translation-map (kbd "M-S-)") (kbd "]")) (define-key key-translation-map (kbd "M-(") (kbd "{")) (define-key key-translation-map (kbd "M-)") (kbd "}")) (define-key key-translation-map (kbd "M-/") (kbd "\\")) (define-key key-translation-map (kbd "M-L") (kbd "|"))
| Key | Binding |
|---|---|
| M-S-n | ~ |
| M-S-( | [ |
| M-S-) | ] |
| M-S-/ | \ |
| Fn+BackSuppr | |
commandes Emacs:
Key bindings related to cursor in a texte
| Keys | Description |
|---|---|
| C-a | Move to beginning of line. |
| M-m | Move to first non-whitespace character on the line. |
| C-e | Move to end of line. |
| C-f | Move forward one character. |
| C-b | Move backward one character. |
| M-f | Move forward one word (I use this a lot). |
| M-b | Move backward one word (I use this a lot, too). |
| C-s | Regex search for text in current buffer and move to it. Press C-s again to move to next match. |
| C-r | Same as C-s, but search in reverse. |
| M-< | Move to beginning of buffer. |
| M-> | Move to end of buffer. |
| M-g g | Go to line. |
Key bindings related to Killing and yanking text
| Keys | Description |
|---|---|
| C-w | Kill region. |
| M-w | Copy region to kill ring. |
| C-y | Yank. |
| M-y | Cycle through kill ring after yanking. |
| M-d | Kill word. |
| C-k | Kill line. |
Key bindings related to help
| Keys | Description |
|---|---|
| C-h k | key-binding Describe the function bound to the key binding. To get this to work, you actually perform the key sequence after typing C-h k. |
| C-h f | Describe function. |
| C-h m | Qquels sont les raccourcis claviers disponibles pour ce mode? |
| C-h w | Quel est le raccourci clavier pour une fonction? |
| C-h a | Quelle commande correspond à une chaine de caractères? |
Key bindings related to Window
| Keys | Description |
|---|---|
| C-x o | Switch cursor to another window. |
| C-x 1 | Delete all other windows, leaving only the current window |
| C-x 2 | Split frame above and below. |
| C-x 3 | Split frame side by side. |
| C-x 0 | Delete current window. |
Commandes Magit:
{{< highlight python >}} To be definded {{< /highlight >}}
Comandes org-mode:
| Action | Command | Shortcut | Alternative |
| Move a subtree up | org-metaup / org-move-subtree-up | M-up | C-c C-x u |
| Move a subtree down | org-metadown / org-move-subtree-down | M-down | C-c C-x d |
| Demote a subtree | org-shiftmetaright / org-demote-subtree | S-M-right | C-c C-x r |
| Promote a subtree | org-shiftmetaleft / org-promote-subtree | S-M-left | C-c C-x l |
| Demote a head | lineorg-metaright / org-do-demote | M-right | C-c C-x <right> |
| Promote a head | lineorg-metaleft / org-do-promote | M-leftC-c C-x <left> | |
| Collapse or expand a subtree | org-cycle (while on headline) | TAB | |
| Collapse or expand everything | org-shifttab (org-cycle) | S-TABC-u | TAB |
persp-mode Minor Mode Bindings Starting With C-c:
| Key | Binding |
|---|---|
| C-c M-p C-l | persp-state-load |
| C-c M-p C-s | persp-state-save |
| C-c M-p 0 | [%s] |
| byte-codeC-c M-p 1 | [%s] |
| byte-codeC-c M-p 2 | [%s] |
| byte-codeC-c M-p 3 | [%s] |
| byte-codeC-c M-p 4 | [%s] |
| byte-codeC-c M-p 5 | [%s] |
| byte-codeC-c M-p 6 | [%s] |
| byte-codeC-c M-p 7 | [%s] |
| byte-codeC-c M-p 8 | [%s] |
| byte-codeC-c M-p 9 | [%s] |
| byte-codeC-c M-p A | persp-set-buffer |
| C-c M-p B | persp-switch-to-scratch-buffer |
| C-c M-p ` | persp-switch-by-number |
| C-c M-p a | persp-add-buffer |
| C-c M-p b | persp-switch-to-buffer |
| C-c M-p c | persp-kill |
| C-c M-p g | persp-add-buffer-to-frame-global |
| C-c M-p i | persp-import |
| C-c M-p k | persp-remove-buffer |
| C-c M-p m | persp-merge |
| C-c M-p n | persp-next |
| C-c M-p p | persp-prev |
| C-c M-p r | persp-rename |
| C-c M-p s | persp-switch |
| C-c M-p u | persp-unmerge |
| C-c M-p <left> | persp-prev |
| C-c M-p <right> | persp-next |
markdown-mode Major Mode Bindings Starting With C-c:
| Key | Binding |
|---|---|
| C-c C-b | markdown-outline-previous-same-level |
| C-c C-d | markdown-do |
| C-c C-f | markdown-outline-next-same-level |
| C-c TAB | markdown-insert-image |
| C-c C-j | markdown-insert-list-item |
| C-c C-k | markdown-kill-thing-at-point |
| C-c C-l | markdown-insert-link |
| C-c C-n | markdown-outline-next |
| C-c C-o | markdown-follow-thing-at-point |
| C-c C-p | markdown-outline-previous |
| C-c C-u | markdown-outline-up |
| C-c C-] | markdown-complete |
| C-c ' | markdown-edit-code-block |
| C-c - | markdown-insert-hr |
| C-c < | markdown-outdent-region |
| C-c > | markdown-indent-region |
| C-c C-- | markdown-promote |
| C-c C-= | markdown-demote |
| C-c S-<down> | markdown-table-insert-row |
| C-c S-<left> | markdown-table-delete-column |
| C-c S-<right> | markdown-table-insert-column |
| C-c S-<up> | markdown-table-delete-row |
| C-c <down> | markdown-move-down |
| C-c <left> | markdown-promote |
| C-c <right> | markdown-demote |
| C-c <up> | markdown-move-up |
| C-c C-t ! | markdown-insert-header-setext-1 |
| C-c C-t 1 | markdown-insert-header-atx-1 |
| C-c C-t 2 | markdown-insert-header-atx-2 |
| C-c C-t 3 | markdown-insert-header-atx-3 |
| C-c C-t 4 | markdown-insert-header-atx-4 |
| C-c C-t 5 | markdown-insert-header-atx-5 |
| C-c C-t 6 | markdown-insert-header-atx-6 |
| C-c C-t @ | markdown-insert-header-setext-2 |
| C-c C-t H | markdown-insert-header-setext-dwim |
| C-c C-t h | markdown-insert-header-dwim |
| C-c C-t s | markdown-insert-header-setext-2 |
| C-c C-t t | markdown-insert-header-setext-1 |
| C-c C-a L | markdown-insert-link |
| C-c C-a f | markdown-insert-footnote |
| C-c C-a l | markdown-insert-link |
| C-c C-a r | markdown-insert-link |
| C-c C-a u | markdown-insert-uri |
| C-c C-a w | markdown-insert-wiki-link |
| C-c C-x C-e | markdown-toggle-math |
| C-c C-x C-f | markdown-toggle-fontify-code-blocks-natively |
| C-c C-x TAB | markdown-toggle-inline-images |
| C-c C-x C-l | markdown-toggle-url-hiding |
| C-c C-x RET | markdown-toggle-markup-hiding |
| C-c C-x C-x | markdown-toggle-gfm-checkbox |
| C-c C-x d | markdown-move-down |
| C-c C-x l | markdown-promote |
| C-c C-x m | markdown-insert-list-item |
| C-c C-x r | markdown-demote |
| C-c C-x u | markdown-move-up |
| C-c C-M-h | markdown-mark-subtree |
| C-c M-h | markdown-mark-block |
| C-c C-c ] | markdown-complete-buffer |
| C-c C-c ^ | markdown-table-sort-lines |
| C-c C-c c | markdown-check-refs |
| C-c C-c e | markdown-export |
| C-c C-c l | markdown-live-preview-mode |
| C-c C-c m | markdown-other-window |
| C-c C-c n | markdown-cleanup-list-numbers |
| C-c C-c o | markdown-open |
| C-c C-c p | markdown-preview |
| C-c C-c t | markdown-table-transpose |
| C-c C-c u | markdown-unused-refs |
| C-c C-c v | markdown-export-and-preview |
| C-c C-c w | markdown-kill-ring-save |
| C-c C-c I | markdown-table-convert-region |
| C-c C-s ! | markdown-insert-header-setext-1 |
| C-c C-s - | markdown-insert-hr |
| C-c C-s 1 | markdown-insert-header-atx-1 |
| C-c C-s 2 | markdown-insert-header-atx-2 |
| C-c C-s 3 | markdown-insert-header-atx-3 |
| C-c C-s 4 | markdown-insert-header-atx-4 |
| C-c C-s 5 | markdown-insert-header-atx-5 |
| C-c C-s 6 | markdown-insert-header-atx-6 |
| C-c C-s @ | markdown-insert-header-setext-2 |
| C-c C-s C | markdown-insert-gfm-code-block |
| C-c C-s F | markdown-insert-foldable-block |
| C-c C-s H | markdown-insert-header-setext-dwim |
| C-c C-s P | markdown-pre-region |
| C-c C-s Q | markdown-blockquote-region |
| C-c C-s [ | markdown-insert-gfm-checkbox |
| C-c C-s b | markdown-insert-bold |
| C-c C-s c | markdown-insert-code |
| C-c C-s e | markdown-insert-italic |
| C-c C-s f | markdown-insert-footnote |
| C-c C-s h | markdown-insert-header-dwim |
| C-c C-s i | markdown-insert-italic |
| C-c C-s k | markdown-insert-kbd |
| C-c C-s l | markdown-insert-link |
| C-c C-s p | markdown-insert-pre |
| C-c C-s q | markdown-insert-blockquote |
| C-c C-s s | markdown-insert-strike-through |
| C-c C-s t | markdown-insert-table |
| C-c C-s w | markdown-insert-wiki-link |
Global Bindings Starting With C-c:
| Key | Binding |
|---|---|
| C-c a | org-agenda |
| C-c c | org-capture |
| C-c e | hledger-capture |
| C-c j | hledger-run-command |
| C-c l | org-store-link |
| C-c o | clm/toggle-command-log-buffer |
| C-c p | [lambda] |
| C-c s | org-schedule |
| C-c M-g | magit-file-dispatch |
| C-c h o | hydra-origami/body |
| C-c n f | org-roam-node-find |
| C-c n i | org-roam-node-insert |
| C-c n l | org-roam-buffer-toggle |
Internal web browser
Access url with key binding M-x eww
Interactive Lisp mode
Alt-X ielm : enter in interactive list mode
Scatch buffer : after an expression type C-j to execute last expression.