- In Atom, open the Atom > Snippets... option in the menu bar
- Copy and paste the contents of the snippets.cson file into your snippets.cson file.
- Save snippets.cson
- Make sure to star this repo.
So far, this repo has snippets for SVG(HTML), JavaScript, React/Redux, and Markdown. More are always being added though, so check back often. The below examples show the shortcut in comments above the code that it will generate.
<!-- rec -->
<rect x="" y="" width="" height=""/>
<!-- cir -->
<circle r="" cx="" cy="" />
<!-- g -->
<g></g>
<!-- defs -->
<defs>
</defs>
<!-- txt -->
<text x="" y=""></text>
// for (overrides default for loop snippet)
for (let i = 0; i < array.length; i++) {
}
// forin (overrides default for-in loop snippet)
for (let variable in object) {
if (object.hasOwnProperty(variable)) {
}
}
// fore
forEach( (el) => {
});
// map
map( (el) => {
});
// evr
every( (el) => {
});
// some
some( (el) => {
});
// fil
filter( (el) => {
});
// red
reduce( (acc, val) => {
});
// imp
import package from 'path';
// imps
import {packages} from 'path';
// impas
import * as alias from 'path';
// saf
(el) => #;
// req
const package = require("path");
// fun (overrides default function snippet)
const functionName = function functionName() {
};
// class_component
React import statement, basic class component structure, and class export statement.
// container
Import statements for connect (from React-Redux) and the contained component.
Also includes the skeleton for mapStateToProps, mapDispatchToProps and the export statement using connect.
// root
Root file template.
// entry
Entry file template.
<Route path="/path" component={component}/>
NB: The autocomplete commands also include ending quotes, but those have been excluded here for display reasons.
h1
# header
h2
## header
h3
### header
h4
#### header
h5
##### header
h6
###### header
css
```css
html
```html
javascript
```javascript
ruby
```ruby
python
```python
xml
```xml
chk
- [ ] item