Last active
April 30, 2019 16:51
-
-
Save ryanpcmcquen/3c1f8d8611354c4e16a46e63884c1423 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
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