Iâm a fairly newcomer to SublimeText2 and Iâve searched high and low for this answer and couldnât find a concrete solution. I prefer SublimeText2 over TextMate and would like to include #{} syntax highlighting for Ruby.
Any help appreciated!!
Iâm a fairly newcomer to SublimeText2 and Iâve searched high and low for this answer and couldnât find a concrete solution. I prefer SublimeText2 over TextMate and would like to include #{} syntax highlighting for Ruby.
Any help appreciated!!
[pre=#0C1021]
name
Embedded Ruby Punctuation
scope
string punctuation.section.embedded.ruby
settings
foreground
#F92672
[/pre]
You could add a section like the above to the Packages/Color Scheme - Default/Monokai.tmTheme
file, adjusting color to taste.
[pre=#272822]âThen the punctuation should be highlighted #{ 2 + 2 }â[/pre]
[pre=#272822]âAnd without any #{ 2 + 2 }â[/pre]
[pre=#0C1021]settings = sublime.load_settings(âhtml-export.sublime-settingsâ)
defaults = {
âopen_html_in_editorâ : False,
âopen_html_in_browserâ : True,
âcopy_css_to_clipboardâ : False,
âcopy_html_to_clipboardâ : True,
âencode_asâ : âutf-8â,
âadd_line_numbersâ : False,
âroot_nodeâ : âpreâ,
âuse_styleâ : True,
âbulletin_boardâ : True,
}
[/pre]
[pre=#0C1021]def memoize(func):
âImplementation taken from python test suiteâ
saved = {}
def call(*args):
try:
return saved[args]
except KeyError:
res = func(*args)
saved[args] = res
return res
except TypeError:
# Unhashable argument
return func(*args)
call.func_name = func.func_name
return call[/pre]
A few milliseconds, it uses memoization.
Oh, and stop giving me shit and apply for the Google Summer of Code already you young upstart.