Update README.md

This commit is contained in:
James Cherti
2025-06-07 13:25:35 -04:00
parent cc03bf5536
commit 066a6d84e7

View File

@@ -71,7 +71,8 @@ In addition to *minimal-emacs.d*, startup speed is influenced by your computer's
- [Configuring LSP Servers with Eglot (built-in)](#configuring-lsp-servers-with-eglot-built-in) - [Configuring LSP Servers with Eglot (built-in)](#configuring-lsp-servers-with-eglot-built-in)
- [Session Management](#session-management) - [Session Management](#session-management)
- [Configuring org-mode](#configuring-org-mode) - [Configuring org-mode](#configuring-org-mode)
- [Configuring `markdown-mode` (e.g., README.md syntax)](#configuring-markdown-mode-eg-readmemd-syntax) - [Configuring markdown-mode (e.g., README.md syntax)](#configuring-markdown-mode-eg-readmemd-syntax)
- [Tree-sitter Integration (Better Syntax Highlighting)](#tree-sitter-integration-better-syntax-highlighting)
- [Inhibit the mouse](#inhibit-the-mouse) - [Inhibit the mouse](#inhibit-the-mouse)
- [Spell checker](#spell-checker) - [Spell checker](#spell-checker)
- [Asynchronous code formatting without cursor disruption](#asynchronous-code-formatting-without-cursor-disruption) - [Asynchronous code formatting without cursor disruption](#asynchronous-code-formatting-without-cursor-disruption)
@@ -795,7 +796,7 @@ To configure **org-mode**, add the following to `~/.emacs.d/post-init.el`:
(org-fontify-quote-and-verse-blocks t)) (org-fontify-quote-and-verse-blocks t))
``` ```
### Configuring `markdown-mode` (e.g., README.md syntax) ### Configuring markdown-mode (e.g., README.md syntax)
The [markdown-mode](https://github.com/jrblevin/markdown-mode) package provides a major mode for Emacs for syntax highlighting, editing commands, and preview support for Markdown documents. It supports core Markdown syntax as well as extensions like GitHub Flavored Markdown (GFM). The [markdown-mode](https://github.com/jrblevin/markdown-mode) package provides a major mode for Emacs for syntax highlighting, editing commands, and preview support for Markdown documents. It supports core Markdown syntax as well as extensions like GitHub Flavored Markdown (GFM).
@@ -819,6 +820,24 @@ 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.
### Tree-sitter Integration (Better Syntax Highlighting)
Tree-sitter in Emacs 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.
The configuration below enables Tree-sitter support using the [treesit-auto](https://github.com/renzmann/treesit-auto) package. Setting `treesit-auto-add-to-auto-mode-alist` to `'all` ensures that all available Tree-sitter modes are automatically activated for their corresponding file types. Enabling `global-treesit-auto-mode` applies this behavior globally, improving syntax accuracy and consistency across supported languages.
To enable Tree-sitter, add the following to your `~/.emacs.d/post-init.el`:
```elisp
(use-package treesit-auto
:ensure t
:custom
(treesit-auto-install 'prompt)
:config
(treesit-auto-add-to-auto-mode-alist 'all)
(global-treesit-auto-mode))
```
### Inhibit the mouse ### Inhibit the mouse
The [inhibit-mouse](https://github.com/jamescherti/inhibit-mouse.el) package disables mouse input in Emacs. The [inhibit-mouse](https://github.com/jamescherti/inhibit-mouse.el) package disables mouse input in Emacs.