https://github.com/davorg/tt-mode
Template Toolkit editing mode for Emacs
https://github.com/davorg/tt-mode
hacktoberfest
Last synced: about 2 months ago
JSON representation
Template Toolkit editing mode for Emacs
- Host: GitHub
- URL: https://github.com/davorg/tt-mode
- Owner: davorg
- Created: 2009-04-09T09:36:56.000Z (about 17 years ago)
- Default Branch: master
- Last Pushed: 2023-09-22T15:28:52.000Z (over 2 years ago)
- Last Synced: 2025-04-02T01:27:35.509Z (about 1 year ago)
- Topics: hacktoberfest
- Language: Emacs Lisp
- Homepage: http://dave.org.uk/emacs/
- Size: 10.7 KB
- Stars: 21
- Watchers: 4
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# tt-mode
[](https://github.com/davorg/tt-mode)
[](https://melpa.org/#/tt-mode)
[](https://www.gnu.org/copyleft/gpl.html)
An Emacs major mode for editing [Template Toolkit](http://tt2.org/) 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](https://melpa.org/#/tt-mode). 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](https://github.com/davorg/tt-mode/).
2. Place it somewhere on your Emacs `load-path`.
3. Add the following to your `.emacs` or `init.el`:
```elisp
(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](https://github.com/davorg/tt-mode/)
2. Make your changes
3. Submit a pull request
If you have suggestions but don't want to write code, please
[open an issue](https://github.com/davorg/tt-mode/issues).
## License
This code is made available under the
[GPL](http://www.gnu.org/copyleft/gpl.html). Usual caveats apply.