Skip to content
Script to convert a textmate (or SublimeText) tmTheme to Emacs deftheme
Emacs Lisp Ruby Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.bundle
bin Fix light / dark theme automatic colors Jun 28, 2014
data
generatedThemes Enable a ST3/TM theme scope to map to multiple emacs faces Jun 29, 2014
lib Bump to 0.2.1 Jun 29, 2014
sampleThemes Fix bug with 3 digit hex colors Jun 28, 2014
spec Converted to rubygem Jun 27, 2014
templates change template to .erb.el file extension Jun 29, 2014
.gitignore Converted to rubygem Jun 27, 2014
Gemfile Converted to rubygem Jun 27, 2014
Gemfile.lock
LICENSE fixup initial Jun 26, 2014
README.md Added notes to README Jun 28, 2014
install-generated-themes.el Fix typo in install-generated-themes.el - note to self, wear your gla… Jun 28, 2014
slides.gif Update README, add slideshow Jun 28, 2014
test.sh Bump to 0.1.9 Jun 28, 2014
tm2deftheme.gemspec Move scope to faces map to data folder, update gemspec Jun 28, 2014

README.md

tm2deftheme

Convert TextMate/SublimeText .tmTheme to Emacs 24 deftheme .el

Install

gem install tm2deftheme

Usage:

tm2deftheme [options] [themefile.tmTheme]

options:

    -f         ouput Emacs 24 deftheme to file
               e.g. Birds of Paradise.tmTheme

               becomes:

               birds-of-paradise-theme.el

    -s         when used with -f silence output
    -o         when used with -f overwrite existing file

    --debug    debugging output

When run without options converted theme is sent to STDOUT

Notes

Note that Emacs syntax highlighting is managed differently to SublimeText / TextMate. Various Emacs modes provide additional highlighing support, but tm2deftheme (currently) only maps to core font-lock faces. So while things won't look like a one-to-one copy, the results are still pretty good.

Linum, fringe and modeline colours are derived from the base foreground and background colors. Support for Rainbow Delimiters is provided automatically.

The imported foreground colors which constrast most from the background are averaged, from this average colour, 9 tint colors are generated and assigned to the rainbow-delimiters-depth-n-face collection.

I'll be adding additional support for js3-mode, git-gutter, flyspell, flymake, flycheck, isearch and more.

Demo

See for yourself, here's a handful of converted themes, shown in their original format (here rendered by the excellent http://tmtheme-editor.herokuapp.com/) and then shown in Emacs 24 after conversion.

Dependencies

Ruby 1.9 or later required.

Development, clone and run bundle install in the project folder.

Contribution / Development

If you'd like to contribute, the best place to do so is in mapping SublimeText / TextMate scopes to Emacs faces. Although any issue posting, bug fixing, feature pull-requests, etc. are welcome.

Avoid using test.sh and install-generated-themes.el, they're not tuned for general use.

PLEASE NOTE: test.sh will forceably remove all folders matching ~/.emacs.d/elpa/*-theme-140*.

You can’t perform that action at this time.