Comments (3)
Did you try adding these extensions to auto-mode-alist
?
See also web-mode-content-types-alist
.
from web-mode.
auto-mode-alist will not help since this only triggers the major mode of different file types. This is the same as triggering the mode manually. The mode is enabled, only everything is white (in dark mode).
Not sure how to use the second one, there is only a default value that I don't understand:
(setq web-mode-content-types-alist
’(("json" . "/some/path/.*\.api\’")
("jsx" . "/some/react/path/.*\.js[x]?\’")))
I've found this variable web-mode-engines-alist
and used this code:
(add-to-list 'auto-mode-alist '("\\.mjs\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.cjs\\'" . web-mode))
(dolist (spec '(("js" . "\\.mjs\\'")
("js" . "\\.cjs\\'")))
(add-to-list 'web-mode-engines-alist spec))
But this doesn't work. Also tried:
(dolist (spec '(("javascript" . "\\.mjs\\'")
("javascript" . "\\.cjs\\'")))
(add-to-list 'web-mode-engines-alist spec))
That also doesn't work.
from web-mode.
This seems to work:
(add-to-list 'auto-mode-alist '("\\.mjs\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.cjs\\'" . web-mode))
(dolist (spec '(("javascript" . "\\.mjs\\'")
("javascript" . "\\.cjs\\'")))
(add-to-list 'web-mode-content-types-alist spec))
from web-mode.
Related Issues (20)
- No highlighting in .blade.php file using engine blade HOT 2
- A problem with electric-pair-mode HOT 3
- Not included in Emacs by default HOT 1
- Doesn't handle PHP in blade templates HOT 1
- HTML attributes misaligned on different lines HOT 3
- Need to constantly use `web-mode-dom-normalize` HOT 5
- Is there a variable to set the color of left fringe HOT 3
- Incorrect indentation in blade templates HOT 4
- use of save-mark-and-excursion requires more recent version of emacs than declared HOT 1
- After latest changes cannot apply web-mode HOT 11
- You can't use atomic group in PHP regex HOT 1
- Underlines break Ruby code indentation for parenthesis-less method calls HOT 1
- Keybinding for django template comment HOT 2
- Weird error in JSX when using a comma after a tag HOT 2
- Incorrect indentention and highlight in blade templates HOT 2
- Custom variables marked as :safe are considered unsafe when loading file local variables on startup HOT 1
- Feature support: freemarker [=expression] interpolation syntax
- RFE: support Pandoc HTML template syntax
- Indent offset not respected when pressing `tab` on a marked region
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from web-mode.