Questions tagged [web-mode]

web-mode.el is a major mode for editing HTML templates containing parts (CSS, JavaScript) and blocks (server/client side engines)

2
votes
1answer
467 views

Migrate php-mode configuration to web-mode

I currently have my php-mode configuration like so: (require 'php-mode) (add-hook 'php-mode-hook (lambda () (require 'ac-php-company) (company-mode t) ...
1
vote
1answer
388 views

How to use web-mode to edit multiline HTML inside backticks?

I often work with Angular and Typescript, and I'm fond of putting my Angular templates directly into my Typescript files. The resulting code is essentially Javascript with HTML snippets in it, like ...
0
votes
1answer
90 views

How to auto highlight buffer or region in web-mode?

I'm using web-mode 13.1.25, but was until today on 12.x with the same issue. It seems I need to continually choose Highlight buffer (C-c C-h) as otherwise, certain functions misbehave. These steps ...
0
votes
1answer
441 views

Enable JSX folding in web-mode

I'm using web-mode to edit jsx files and I'm wondering what minor-mode can I use to add folding support. Is there anything out there that works? Thanks
4
votes
0answers
360 views

Web mode -indentation is misaligned on skipping semicolons

When i indent javascript code (inside html - web mode) that has no semicolons in it, the next statements are indented right with two extra spaces, <script> function processTemplates(){ ...
2
votes
0answers
84 views

How to set web-mode to use single-line comment style instead of multi-line for JavaScript

When commenting C-style code like C++, JavaScript etc., I use single-line comments to be able to uncomment a previously commented region selectively, i.e // This // is // a single-line style // ...
2
votes
0answers
623 views

Web-Mode + Yasnippets + Autocomplete, error before create-php-snippet

I am trying to use auto-complete + php-auto-yasnippets with web-mode, but I can't get the snippets to work correctly. If I start typing imp, I correctly get auto-completion to implode but if I press ...
2
votes
0answers
371 views

web-mode django custom block indentions

The official style of the project I'm working on is to indent after template control statements. We're using jinja2 templates with altered open/closing tags too... <ul> {% for category in ...
1
vote
0answers
149 views

Correct web-mode syntax-highlighting in org-mode src blocks

When adding source blocks in a org-mode document (usually with the shortcut <s TAB), it usually works fine, but specifically with web-mode, if I edit any snippet with the special editor (C-c-'), it ...
1
vote
0answers
785 views

spacemacs, web-mode, cannot indent

I am using spacemacs. When writing .html file, it shows that it is in web-mode. I want to indent, press TAB, but nothing happened. So I can only use SPC to indent. I added (setq web-mode-markup-...
1
vote
0answers
135 views

Web-mode javascript indentation for “if” and “for”

When writing Javascript, I always put curly brackets after if in a new line, like this: if(a == 0) { .... But when I do that in web-mode, the default is like this: if(a == 0) { .... ...
1
vote
0answers
244 views

Delete opening and closing tag in web-mode

Is there a way to delete opening and closing html tags in web-mode? I have tried using sgml-delete-tag from within web-mode but can't get it to work properly (I get an error message sgml-lexical-...
1
vote
0answers
43 views

web-mode sql detection doesn't activate syntax highlighting

we edit freemarker template engine files with web-mode. The files also contain a lot of SQL. I added (defun my-web-mode-hook () "Hooks for Web mode." (setq web-mode-enable-sql-detection t)...
1
vote
0answers
442 views

Autocomple not working with yasnippet

I have configured yasnippet and auto-complete bindings so it won't collide, auto complete uses <tab> and yasnippet uses <backtab>: (add-to-list 'load-path "~/.emacs.d/plugins/...
1
vote
0answers
766 views

syntax highlighting and auto-completion for CSS?

How can I set up css-mode for syntax highlighting and autocompletion? I installed web-mode, but it doesn't seem to be giving me any of those features.
0
votes
0answers
12 views

Configuring web-mode for Vue.js (.vue) files

It seems that web-mode is ready for Vue.js (extension .vue) files by simply throwing in (add-to-list 'auto-mode-alist '("\\.vue\\'" . web-mode)) in one's .emacs file. But web-mode does not like the ...
0
votes
0answers
18 views

How do I disable full-buffer indentation after each yank in web-mode?

In editing html/php mix in web-mode, I inserted a single line by a yank 'C-y' and the full buffer (it says region) is re-indented. It takes a large amount of time. It even throws a warning: "Warning (...
0
votes
0answers
23 views

What is a good setup for programming with Vue.js?

I'm trying to set up a good and powerful Emacs for Vue.js, but no setup worked well for me. I tried: vue-mode with lsp-mode and lsp-vue web-mode with indirect-buffer and js2-mode and tern in the ...
0
votes
0answers
44 views

web-mode didn't work properly under Emacs

I am using Emacs 25.3.1 under MS Windows 64-bit, Everything seems working fine except the web-mode. If I try to edit an HTML file there is no syntax highlighting, when mixing PHP and HTML only the PHP ...
0
votes
0answers
22 views

unexpected long indent after colon in web-mode

I have some trouble locating the source of 8 tabs and 3 spaces more than the previous indentation when I'm inside js inside web-mode. These appear after a line that ends with a colon. Example (note ...
0
votes
0answers
161 views

web-mode-indentation wrong

Using web-mode and evil I get a really strange behaviour when pressing return after curly braces: let StubMapsService = Ember.Service.extend({ getMapElement(location) { (RET) } }); let f ...
0
votes
0answers
41 views

bug with web-mode and paredit

I have paredit configured to work on javascript files. I also have web-mode enabled It seems to cause a bug in certain situations. Here is a stack trace I got by trying to clear all the text in an ...
0
votes
0answers
279 views

web-mode javascript auto-indenting without semicolons

I'm editing JSX files with web-mode and our project doesn't use semicolons at the end of the line. Whenever I press enter at the end of the line, web-mode is auto-indenting two spaces because the ...
0
votes
0answers
214 views

Strange tabbing behaviour in .erb files

Note that I use spaces for tabs. When I am working in erb files for rails such as example.js.erb or example2.html.erb, I am getting some very odd (and annoying) auto-tabbing behaviour, which I can't ...
0
votes
0answers
66 views

web-mode comment function doesn't work well in php codes

In web-mode, when it comes to HTML file, press M-; will comment the selected region very well. But in PHP file, it does not work correctly, the following is the screenshot: Any more config work ...