Skip to content

Instantly share code, notes, and snippets.

@abaez
Last active November 15, 2016 15:18
Show Gist options
  • Save abaez/29e028568069ef29f020 to your computer and use it in GitHub Desktop.
Save abaez/29e028568069ef29f020 to your computer and use it in GitHub Desktop.
Make textadept pretty
--- holds languages NOT to use semantic highlighting if semantic is on.
-- @param `language = true`: language being any one you choose.
local dont = {
perl = true,
yaml = true,
markdown = true,
}
-- enable semantic highlighting
_SEMANATIC = true
-- semantic highlighting. NEED base16 themes to work!
events.connect(events.LEXER_LOADED, function (lang)
if _SEMANATIC == false then return end
if dont[lang] then return end
buffer.edge_colour = buffer.property_int["color.base0A"]
buffer.property[‘style.operator’] = ‘fore:%(color.base0F)’
buffer.property[‘style.function’] = ‘fore:%(color.base08)’
buffer.property[‘style.library’] = ‘fore:%(color.base09)’
buffer.property[‘style.identifier’] = ‘fore:%(color.base0D)’
buffer.property[‘style.number’] = ‘fore:%(color.base0E)’
buffer.property[‘style.constant’] = ‘fore:%(color.base0A)’
buffer.property[‘style.keyword’] = ‘fore:%(color.base05)’
end)
@namandixit
Copy link

Textadept 8.7 (the JIT version) gives the error:

init.lua:19: '' expected near '%'

@powergold1
Copy link

You're using unusual single quotes.
I replaced all of them with ' ', then it worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment