Skip to content

davorg/tt-mode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tt-mode

Static Badge MELPA License: GPL

An Emacs major mode for editing Template Toolkit files.

Features

  • Syntax highlighting for Template Toolkit directives ([% ... %])
  • Highlights TT keywords (IF, FOREACH, INCLUDE, BLOCK, etc.)
  • Highlights variable names, constants, and comments within TT tags
  • Automatically activates for files with a .tt extension

Installation

Via MELPA (recommended)

tt-mode is available on MELPA. If you have MELPA configured as a package source, you can install it with:

M-x package-install RET tt-mode RET

Manual installation

  1. Download tt-mode.el from the GitHub repository.
  2. Place it somewhere on your Emacs load-path.
  3. Add the following to your .emacs or init.el:
(autoload 'tt-mode "tt-mode")
(add-to-list 'auto-mode-alist '("\\.tt\\'" . tt-mode))

Usage

Once installed, tt-mode will be activated automatically when you open a file with a .tt extension. You can also activate it manually with:

M-x tt-mode

What gets highlighted

Element Face
[% and %] delimiters font-lock-builtin-face
Content inside TT tags font-lock-variable-name-face
TT keywords (IF, FOREACH, etc.) font-lock-keyword-face
Simple variable expressions font-lock-constant-face
Comments ([%# ... %] and inline #) font-lock-comment-face

Contributing

This started as an afternoon of Emacs Lisp hacking in 2002. There are, no doubt, many improvements that can be made. Contributions are very welcome!

To contribute:

  1. Fork the GitHub repository
  2. Make your changes
  3. Submit a pull request

If you have suggestions but don't want to write code, please open an issue.

License

This code is made available under the GPL. Usual caveats apply.

About

Template Toolkit editing mode for Emacs

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

 
 
 

Contributors