Skip to content

Instantly share code, notes, and snippets.

@ryanpcmcquen
Last active April 30, 2019 16:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanpcmcquen/3c1f8d8611354c4e16a46e63884c1423 to your computer and use it in GitHub Desktop.
Save ryanpcmcquen/3c1f8d8611354c4e16a46e63884c1423 to your computer and use it in GitHub Desktop.
--[[
JavaScript:
--]]
standard = '/usr/local/bin/node /usr/local/bin/standard --fix '
-- Format JavaScript with the 'Compile' command.
textadept.run.compile_commands.javascript = standard .. ' "%f"'
-- Format JavaScript before save:
events.connect(
events.FILE_BEFORE_SAVE,
function()
if buffer:get_lexer() == 'javascript' then
return textadept.editing.filter_through(
standard .. '--stdin'
)
else
return
end
end
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment