Questions tagged [filetype-html]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3
votes
1answer
631 views

Nested highlighting

In html eruby files, I would like to highlight the <% ... %> text in dark green only when it is inside double quotes. I.e. in in this example: I want it dark green instead of white. I know ...
2
votes
1answer
656 views

How to remove inner content of html tag conditionally?

I've html file (e.g. curl -o page.html http://example.com/) where I would like to remove inner html block for given html tag. I've the following code which works: $ ex -V1 page.html <<-EOF /&...
4
votes
1answer
991 views

How to change indenting for html files?

I code mainly in 2 languages python and HTML. I currently have the indenting configured for python in my neovim configuration file but I would to know how to make neovim auto-detect the type of file ...
65
votes
4answers
19k views

How to jump between matching HTML/XML tags?

How to jump between matching tags (such as <div>, <span>, etc.) when editing HTML/XHTML/XML documents similarly as % is used to jump between matching parentheses?
14
votes
2answers
9k views

How to convert a source code file into HTML?

I've a file of source code written in a programming language (e.g. PHP) and I would like to convert it into a HTML file, so I can publish it on web in order to share my code. By conversion I mean, ...
6
votes
1answer
922 views

How do I get vim to auto indent block-level html elements?

I'm having trouble with vim wanting to treat the p element as an inline element rather than a block level one. What vim's auto indent should produce is: <body> <p> Aaaaaaaaaaaaaa ...
9
votes
2answers
337 views

How can I check spelling in HTML attributes?

Vim spell check feature works great in most cases - it is even smart enough to distinguish code from literals and comments in most languages. However I have problems with HTML spell check: <div ...
4
votes
1answer
71 views

Syntax coloring is inaccurate for HTML files with CSS code in it

As you can see in the following screencast, when I open an HTML file with some CSS in it, there's some part of the file which does not show syntax coloring. Do you have experience of this? Is it ...
4
votes
2answers
1k views

How to search in Ex mode and place the cursor on the matched pattern?

I've the following example: vim -E http://example.com/ where I'd like to search for <head> tag. It seems that search only works when the lines are separated, but when the lines are joined ...
2
votes
2answers
274 views

Is there an instant way of editing matching inner tags?

In Vim, using the text object i>, you can edit an inner tag, and using the built-in matchit plugin, you can even use % to jump between matching opening and closing tags. Let's say you want to ...