Update README.md
This commit is contained in:
15
README.md
15
README.md
@@ -947,6 +947,21 @@ To configure **markdown-mode**, add the following to `~/.emacs.d/post-init.el`:
|
|||||||
|
|
||||||
This configuration sets up `markdown-mode` with deferred loading to improve startup performance. The `:commands` and `:mode` keywords ensure that the mode is loaded only when needed—for example, when opening `.md`, `.markdown`, or `README.md` files. Files named `README.md` are specifically associated with `gfm-mode`, which is for GitHub Flavored Markdown syntax. The `markdown-command` variable is set to `"multimarkdown"` to specify the Markdown processor used for previews and exports. Additionally, a keybinding (`C-c C-e`) is defined in `markdown-mode-map` to invoke `markdown-do`, which can be customized to perform common Markdown-related actions.
|
This configuration sets up `markdown-mode` with deferred loading to improve startup performance. The `:commands` and `:mode` keywords ensure that the mode is loaded only when needed—for example, when opening `.md`, `.markdown`, or `README.md` files. Files named `README.md` are specifically associated with `gfm-mode`, which is for GitHub Flavored Markdown syntax. The `markdown-command` variable is set to `"multimarkdown"` to specify the Markdown processor used for previews and exports. Additionally, a keybinding (`C-c C-e`) is defined in `markdown-mode-map` to invoke `markdown-do`, which can be customized to perform common Markdown-related actions.
|
||||||
|
|
||||||
|
**Table of contents:** To automatically generate a table of contents when editing Markdown files, add the following to your `~/.emacs.d/post-init.el`:
|
||||||
|
```elisp
|
||||||
|
;; Automatically generate a table of contents when editing Markdown files
|
||||||
|
(use-package markdown-toc
|
||||||
|
:ensure t
|
||||||
|
:commands (markdown-toc-generate-toc
|
||||||
|
markdown-toc-generate-or-refresh-toc
|
||||||
|
markdown-toc-delete-toc
|
||||||
|
markdown-toc--toc-already-present-p)
|
||||||
|
:custom
|
||||||
|
(markdown-toc-header-toc-title "**Table of Contents**"))
|
||||||
|
```
|
||||||
|
|
||||||
|
The author also recommends reading the following article: [Emacs: Automating Table of Contents Update for Markdown Documents (e.g., README.md)](https://www.jamescherti.com/emacs-markdown-table-of-contents-update-before-save/).
|
||||||
|
|
||||||
### Tree-sitter Integration (Better Syntax Highlighting)
|
### Tree-sitter Integration (Better Syntax Highlighting)
|
||||||
|
|
||||||
Tree-sitter is an incremental parsing system introduced in Emacs 29 that provides precise, high-performance syntax analysis and highlighting by constructing concrete syntax trees from source code. It supports a broad set of programming languages, including Bash, C, C++, C#, CMake, CSS, Dockerfile, Go, Java, JavaScript, JSON, Python, Rust, TOML, TypeScript, YAML, Elisp, Lua, Markdown, and many others. Unlike traditional font-lock, which relies on regular expressions, Tree-sitter uses formal grammar definitions to build real-time parse trees, enabling accurate syntax highlighting, structural navigation, code folding, and foundational support for advanced editing features like refactoring.
|
Tree-sitter is an incremental parsing system introduced in Emacs 29 that provides precise, high-performance syntax analysis and highlighting by constructing concrete syntax trees from source code. It supports a broad set of programming languages, including Bash, C, C++, C#, CMake, CSS, Dockerfile, Go, Java, JavaScript, JSON, Python, Rust, TOML, TypeScript, YAML, Elisp, Lua, Markdown, and many others. Unlike traditional font-lock, which relies on regular expressions, Tree-sitter uses formal grammar definitions to build real-time parse trees, enabling accurate syntax highlighting, structural navigation, code folding, and foundational support for advanced editing features like refactoring.
|
||||||
|
|||||||
Reference in New Issue
Block a user