Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a file that I don't want to put .html in its name. However, I still want gedit to color it like an HTML file. Is there a way that I can tell gedit to color it as an HTML file? Like putting some header at the top.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Gedit should automatically detect the file as HTML if it begins with a doctype declaration. If you're writing HTML 5, make sure the first line is <!DOCTYPE html>. Doctype declarations are required anyway...


If it does not work, add a comment containing a Vim or Emacs style modeline:

  • <!-- vim: set ft=html: -->

  • <!-- -*- mode: html -*- -->

However, this requires the Modelines plugin to be enabled.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.