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