Skip to content

Instantly share code, notes, and snippets.

@joshuaiz
Last active March 5, 2018 01:22
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 joshuaiz/cc514aec242000973d0bac6c5f8445a0 to your computer and use it in GitHub Desktop.
Save joshuaiz/cc514aec242000973d0bac6c5f8445a0 to your computer and use it in GitHub Desktop.
Wrap selected text in JSX style comment
<snippet>
<!-- Wraps selected text in JSX style comment, e.g. {/* <Component /> */} -->
<!-- Save this to ~/Application Support/Sublime Text 3/Packages/User/ -->
<!-- You'll need to add a keybinding in Sublime Text > Preferences > Key Bindings -->
<!-- {
"keys": ["alt+command+j"],
"command": "insert_snippet",
"args": { "name": "Packages/User/jsx-wrap-comment.sublime-snippet" }
} -->
<content><![CDATA[
{/* ${SELECTION} */}
]]></content>
<description>Wrap selection in JSX comment</description>
<scope>source.js</scope>
</snippet>
@joshuaiz
Copy link
Author

joshuaiz commented Mar 5, 2018

Unfortunately no way to "uncomment" like other syntaxes in Sublime Text but at least this allows you to comment existing code.

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