Currently, opening Nunjucks (.njk
) files will not start web-mode.
In order to add Nunjucks support, user must edit 'auto-mode-alist
like so:
(add-to-list 'auto-mode-alist '("\\.njk\\'" . web-mode))
and, though, it works, it is inconvenient to do by hand.
Another problem is that lsp-mode cannot recognize Nunjucks files.
A snippet out of *Messages*
buffer:
LSP :: There are no language servers supporting current mode `web-mode' registered with `lsp-mode'.
This issue might be caused by:
1. The language you are trying to use does not have built-in support in `lsp-mode'. You must install the required support manually. Examples of this are `lsp-java' or `lsp-metals'.
2. The language server that you expect to run is not configured to run for major mode `web-mode'. You may check that by checking the `:major-modes' that are passed to `lsp-register-client'.
3. `lsp-mode' doesn't have any integration for the language behind `web-mode'. Refer to https://emacs-lsp.github.io/lsp-mode/page/languages and https://langserver.org/ .
4. You are over `tramp'. In this case follow https://emacs-lsp.github.io/lsp-mode/page/remote/.
5. You have disabled the `lsp-mode' clients for that file. (Check `lsp-enabled-clients' and `lsp-disabled-clients').
You can customize `lsp-warn-no-matched-clients' to disable this message.
I should note that currently, there is no lsp for Nunjucks (yet).
le dump:
Loading data dump...