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)

31 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
0answers
477 views

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

It seems that web-mode has supported Vue.js since May 2017, the "Venora Release". Configuring Emacs to handle Vue.js files (extension .vue) is as easy as writing (add-to-list 'auto-mode-alist '("\\....
4
votes
1answer
616 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 ...
4
votes
0answers
374 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
1answer
138 views

Web-mode left arrow without the right closing angle bracket

When using Elixir html template (.eex) in web-mode, I sometimes need to type code like <%= for bid <- @bids do %> . At the moment because the opening left angled bracked is closed immediately ...
2
votes
0answers
169 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
167 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) { .... ...
2
votes
1answer
605 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) ...
2
votes
0answers
730 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
496 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
3answers
121 views

The global value of a variable I set with setq in my config differs from the local value. How can I get my value to be what I want in every buffer?

I want web-mode-script-padding to be set to 0 at all times. In my config, I have tried both (with-eval-after-load 'web-mode (setq web-mode-script-padding 0) ) As well as simply, (setq web-mode-...
1
vote
0answers
108 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 ...
1
vote
0answers
360 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
1k 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
338 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
45 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
565 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
818 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

Emacs Mode to edit template toolkit files

Is there a mode to edit template toolkit files ? Web-Mode works decently, but maybe some modes can be combined to proved some specific Perl-editing-Funcitonality?
0
votes
1answer
53 views

Change `standard-indent` for 1 specific major mode

I author web apps with the web-mode in GNU Emacs, and I use 2 spaces for indentation. After I examined the web-mode source, I found out that the mode defaults to the standard-indent variable, which in ...
0
votes
1answer
47 views

No php highlighting in .blade.php using web-mode

there's no highlighting php into a .blade.php file using web-mode. I just installed from MELPA and added this to my .emacs file: (require 'web-mode) (add-to-list 'auto-mode-alist '("\\.html?\\'&...
0
votes
0answers
43 views

GraphQL and Styled Components syntax highlighting in web-mode?

How can I add syntax highlighting for GraphQL and Styled Components in web-mode? Right now it doesn't work, which makes programming much less convenient, and it's surprisingly difficult to find the ...
0
votes
1answer
24 views

Auto-indentation for Meteor/spacebars

How do I get Emacs to auto-indent Spacebars blocks when coding with Meteor? Right now, Emacs automatically does this: {{#each player}} {{name}} {{/each}} instead of this: {{#each player}} {{name}}...
0
votes
0answers
53 views

web-mode - PHP code indentation

I have been using Emacs for some time but I am quite new for PHP and Web development. I want to use Emacs as a PHP editor. I have searched a lot of pages and I have found that many people recommend ...
0
votes
0answers
25 views

How to have a tag replace its parent in web-mode? (Equivalent to paredit-raise-sexp in paredit)

I'm having a hard time searching for the answer to this, probably I'm using the wrong terminology. How do I have a child element replace its parent element (the parent element deleted completely and ...
0
votes
0answers
42 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
198 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
60 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
348 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
283 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
70 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 ...
0
votes
1answer
576 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