Skip to content

Instantly share code, notes, and snippets.

@gj1118
Created July 11, 2019 01:18
Show Gist options
  • Save gj1118/655794bc282951a9d0d4c86f24e3552f to your computer and use it in GitHub Desktop.
Save gj1118/655794bc282951a9d0d4c86f24e3552f to your computer and use it in GitHub Desktop.
React comment code
<snippet>
<content>
<![CDATA[
{/**${SELECTION} **/}
]]>
</content>
<tabTrigger>comment</tabTrigger>
<description>Comment React code</description>
<scope>source.js</scope>
</snippet>
@gj1118
Copy link
Author

gj1118 commented Jul 11, 2019

create a file with the name above and with the contents above and then save in the following location : /Users/<username>/Library/Application Support/Sublime Text 3/Packages/User/react_comment_code.sublime-snippet and then in your keybindings add the following code
"keys": ["alt+shift+t"], "command": "insert_snippet", "args": { "name": "Packages/User/react_comment_code.sublime-snippet" }, "context": [ { "key": "selector", "operator": "equal", "operand": "meta.jsx.js, meta.tag.jsx" }, ]

Next time you select an JSX code you can press alt+shift+t to comment the selected code.

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