File types config

Section "detect" in user.json. Specifies mapping from "file name" to "lexer name".

  1. "detect": {
  2. "*.mht": "HTML",
  3. "myconfig.conf": "Nginx",
  4. ".profile": "Bash script",
  5. },
  • Key name: File mask. Must be full name (without path), or extension after "*." chars. More complex masks are not yet supported.
  • Key value: Lexer name. Value "-" means "don't activate lexer".

Another method to specify this mapping is dialog "Lexer properties", in which you can add extension or name+extension to a lexer. But dialog is more limited: it saves option to the lexer file (data/lexlib/lexername.lcf), so setting will be reset on reinstalling lexer.

Section "detect_line" in user.json. Allows to detect lexer by first line of file.

  1. "detect_line": {
  2. "<html.*": "HTML",
  3. "<!DOCTYPE.*": "HTML",
  4. "<\\?xml.*": "XML",
  5. },
  • Key name: Reg-ex for first line. Case sensitive, but you can use (?i) modifier in reg-ex.
  • Key value: Lexer name. Value "-" means "don't activate lexer".