-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from ndegruchy/main
Add Emacs configuration
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Adding SuperHTML to Emacs via Eglot | ||
|
||
With `eglot` being included with the core Emacs distribution since | ||
version 29, you can add various language servers, including SuperHTML, | ||
to Emacs fairly simply. Just ensure that `superhtml` is somewhere in | ||
your `$PATH` and you should be able to use one of the forms below with | ||
minimal modification. | ||
|
||
## With `use-package` | ||
|
||
```elisp | ||
(use-package eglot | ||
:defer t | ||
:hook ((web-mode . eglot-ensure) | ||
;; Add more modes as needed | ||
) | ||
:config | ||
;; ... | ||
(add-to-list 'eglot-server-programs '((web-mode :language-id "html") . ("superhtml" "lsp")))) | ||
``` | ||
|
||
## Without `use-package` | ||
|
||
```elisp | ||
(require 'eglot) | ||
(with-eval-after-load 'eglot | ||
(add-to-list 'eglot-server-programs | ||
`((web-mode :language-id "html") . ("superhtml" "lsp")))) | ||
``` | ||
|
||
You can modify the `superhtml` path here as well. If you're not using | ||
`web-mode` then you'll also want to substitute your preferred | ||
mode. The `:language-id` property ensures that HTML is the | ||
content-type passed to the language server, as `eglot` will send the | ||
mode name (minus `-mode`) by default. |