Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .