Skip to content

A collection of useful custom atom snippets and bash aliases

Notifications You must be signed in to change notification settings

ldtcooper/atom-snippets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 

Repository files navigation

Instructions

  1. In Atom, open the Atom > Snippets... option in the menu bar
  2. Copy and paste the contents of the snippets.cson file into your snippets.cson file.
  3. Save snippets.cson
  4. Make sure to star this repo.

Snippets

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.

SVG Snippets

  <!-- rec -->
  <rect x="" y="" width="" height=""/>

  <!-- cir -->
  <circle r="" cx="" cy="" />

  <!-- g -->
  <g></g>

  <!-- defs -->
  <defs>

  </defs>

  <!-- txt -->
  <text x="" y=""></text>

JavaScript

  // 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() {

  };

React/Redux

  // 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}/>

Markdown

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

About

A collection of useful custom atom snippets and bash aliases

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages