Skip to content

Instantly share code, notes, and snippets.

@isthatcentered
Last active December 4, 2016 15:51
Show Gist options
  • Save isthatcentered/3a44c443ed473b5442d3904d85d98eaf to your computer and use it in GitHub Desktop.
Save isthatcentered/3a44c443ed473b5442d3904d85d98eaf to your computer and use it in GitHub Desktop.
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
# console.log "Saved! #{editor.getPath()}"
# Your keymap
#
# Atom keymaps work similarly to style sheets. Just as style sheets use
# selectors to apply styles to elements, Atom keymaps use selectors to associate
# keystrokes with events in specific contexts. Unlike style sheets however,
# each selector can only be declared once.
#
# You can create a new keybinding in this file by typing "key" and then hitting
# tab.
#
# Here's an example taken from Atom's built-in keymap:
#
# 'atom-text-editor':
# 'enter': 'editor:newline'
#
# 'atom-workspace':
# 'ctrl-shift-p': 'core:move-up'
# 'ctrl-p': 'core:move-down'
#
# You can find more information about keymaps in these guides:
# * http://flight-manual.atom.io/using-atom/sections/basic-customization/#_customizing_keybindings
# * http://flight-manual.atom.io/behind-atom/sections/keymaps-in-depth/
#
# If you're having trouble with your keybindings not working, try the
# Keybinding Resolver: `Cmd+.` on macOS and `Ctrl+.` on other platforms. See the
# Debugging Guide for more information:
# * http://flight-manual.atom.io/hacking-atom/sections/debugging/#check-the-keybindings
#
# This file uses CoffeeScript Object Notation (CSON).
# If you are unfamiliar with CSON, you can read more about it in the
# Atom Flight Manual:
# http://flight-manual.atom.io/using-atom/sections/basic-customization/#_cson
'body':
# 'Enter' key actions
'cmd-enter': 'semicolonize:semicolonize' # Add trailing ';' and add new line below
'alt-enter': 'semicolonize:commanize' # Add trailing ',' and add new line below
'ctrl-enter': 'editor:newline-below' # and add new line below
# Move lines
'cmd-up': 'editor:move-line-up' # up
'cmd-down': 'editor:move-line-down' # down
# Comments
'cmd-=': 'editor:toggle-line-comments'
# Folding
'alt-up': 'editor:fold-current-row'
'alt-down': 'editor:unfold-current-row'
[
{
"name": "about",
"version": "1.5.0"
},
{
"name": "advanced-open-file",
"version": "0.16.3"
},
{
"name": "archive-view",
"version": "0.61.1"
},
{
"name": "atom-beautify",
"version": "0.29.10"
},
{
"name": "atom-bootstrap3",
"version": "1.2.12"
},
{
"name": "atom-bracket-highlight",
"version": "0.3.1"
},
{
"name": "atom-css-class-checker",
"version": "0.4.3"
},
{
"name": "atom-dark-syntax",
"version": "0.27.0",
"theme": "syntax"
},
{
"name": "atom-dark-ui",
"version": "0.51.0",
"theme": "ui"
},
{
"name": "atom-light-syntax",
"version": "0.28.0",
"theme": "syntax"
},
{
"name": "atom-light-ui",
"version": "0.43.0",
"theme": "ui"
},
{
"name": "atom-material-syntax",
"version": "0.4.6",
"theme": "syntax"
},
{
"name": "atom-material-syntax-dark",
"version": "0.2.5",
"theme": "syntax"
},
{
"name": "atom-material-syntax-light",
"version": "0.4.5",
"theme": "syntax"
},
{
"name": "atom-material-ui",
"version": "1.2.13",
"theme": "ui"
},
{
"name": "auto-indent-file",
"version": "0.2.0"
},
{
"name": "autocomplete-atom-api",
"version": "0.10.0"
},
{
"name": "autocomplete-css",
"version": "0.11.1"
},
{
"name": "autocomplete-html",
"version": "0.7.2"
},
{
"name": "autocomplete-plus",
"version": "2.29.2"
},
{
"name": "autocomplete-snippets",
"version": "1.10.0"
},
{
"name": "autoflow",
"version": "0.27.0"
},
{
"name": "autosave",
"version": "0.23.1"
},
{
"name": "background-tips",
"version": "0.26.0"
},
{
"name": "base16-tomorrow-dark-theme",
"version": "1.1.0",
"theme": "syntax"
},
{
"name": "base16-tomorrow-light-theme",
"version": "1.1.1",
"theme": "syntax"
},
{
"name": "bookmarks",
"version": "0.39.0"
},
{
"name": "bracket-matcher",
"version": "0.82.0"
},
{
"name": "close-tags",
"version": "0.6.0"
},
{
"name": "command-palette",
"version": "0.38.0"
},
{
"name": "create-and-import",
"version": "0.0.0"
},
{
"name": "deprecation-cop",
"version": "0.54.1"
},
{
"name": "dev-live-reload",
"version": "0.47.0"
},
{
"name": "docblockr",
"version": "0.7.3"
},
{
"name": "emmet",
"version": "2.4.3"
},
{
"name": "encoding-selector",
"version": "0.21.0"
},
{
"name": "exception-reporting",
"version": "0.38.0"
},
{
"name": "expand-selection-to-quotes",
"version": "0.9.0"
},
{
"name": "find-and-replace",
"version": "0.199.0"
},
{
"name": "fuzzy-finder",
"version": "1.0.5"
},
{
"name": "git-diff",
"version": "1.0.1"
},
{
"name": "github-web",
"version": "1.1.0",
"theme": "syntax"
},
{
"name": "go-to-line",
"version": "0.30.0"
},
{
"name": "goto-definition",
"version": "1.1.18"
},
{
"name": "grammar-selector",
"version": "0.48.1"
},
{
"name": "highlight-selected",
"version": "0.11.2"
},
{
"name": "image-view",
"version": "0.57.0"
},
{
"name": "incompatible-packages",
"version": "0.26.1"
},
{
"name": "indent-guide-improved",
"version": "1.4.9"
},
{
"name": "javascript-snippets",
"version": "1.2.1"
},
{
"name": "keybinding-resolver",
"version": "0.35.0"
},
{
"name": "language-babel",
"version": "2.32.0"
},
{
"name": "language-c",
"version": "0.51.3"
},
{
"name": "language-clojure",
"version": "0.20.0"
},
{
"name": "language-coffee-script",
"version": "0.46.1"
},
{
"name": "language-csharp",
"version": "0.12.1"
},
{
"name": "language-css",
"version": "0.36.1"
},
{
"name": "language-gfm",
"version": "0.85.0"
},
{
"name": "language-git",
"version": "0.12.1"
},
{
"name": "language-go",
"version": "0.42.0"
},
{
"name": "language-html",
"version": "0.44.1"
},
{
"name": "language-hyperlink",
"version": "0.16.0"
},
{
"name": "language-java",
"version": "0.17.0"
},
{
"name": "language-javascript",
"version": "0.110.0"
},
{
"name": "language-json",
"version": "0.18.0"
},
{
"name": "language-less",
"version": "0.29.3"
},
{
"name": "language-make",
"version": "0.21.1"
},
{
"name": "language-mustache",
"version": "0.13.0"
},
{
"name": "language-objective-c",
"version": "0.15.1"
},
{
"name": "language-perl",
"version": "0.34.0"
},
{
"name": "language-php",
"version": "0.37.0"
},
{
"name": "language-property-list",
"version": "0.8.0"
},
{
"name": "language-python",
"version": "0.43.1"
},
{
"name": "language-ruby",
"version": "0.68.5"
},
{
"name": "language-ruby-on-rails",
"version": "0.25.0"
},
{
"name": "language-sass",
"version": "0.46.0"
},
{
"name": "language-shellscript",
"version": "0.21.1"
},
{
"name": "language-source",
"version": "0.9.0"
},
{
"name": "language-sql",
"version": "0.20.0"
},
{
"name": "language-text",
"version": "0.7.1"
},
{
"name": "language-todo",
"version": "0.27.0"
},
{
"name": "language-toml",
"version": "0.18.0"
},
{
"name": "language-xml",
"version": "0.34.4"
},
{
"name": "language-yaml",
"version": "0.25.2"
},
{
"name": "line-ending-selector",
"version": "0.4.1"
},
{
"name": "link",
"version": "0.31.1"
},
{
"name": "linter",
"version": "1.11.14"
},
{
"name": "linter-bootlint",
"version": "1.0.2"
},
{
"name": "linter-csslint",
"version": "1.3.2"
},
{
"name": "linter-htmlhint",
"version": "1.2.1"
},
{
"name": "linter-markdown",
"version": "1.5.2"
},
{
"name": "linter-php",
"version": "1.2.0"
},
{
"name": "linter-sass-lint",
"version": "1.6.1"
},
{
"name": "linter-twig",
"version": "0.1.1"
},
{
"name": "livestyle-atom",
"version": "0.2.2"
},
{
"name": "markdown-preview",
"version": "0.158.0"
},
{
"name": "metrics",
"version": "0.53.1"
},
{
"name": "notifications",
"version": "0.63.1"
},
{
"name": "one-dark-syntax",
"version": "1.2.0",
"theme": "syntax"
},
{
"name": "one-dark-ui",
"version": "1.3.1",
"theme": "ui"
},
{
"name": "one-light-syntax",
"version": "1.2.0",
"theme": "syntax"
},
{
"name": "one-light-ui",
"version": "1.3.1",
"theme": "ui"
},
{
"name": "open-on-github",
"version": "1.0.1"
},
{
"name": "package-generator",
"version": "1.0.0"
},
{
"name": "pigments",
"version": "0.31.2"
},
{
"name": "project-sidebar",
"version": "1.3.0"
},
{
"name": "settings-view",
"version": "0.235.1"
},
{
"name": "snippets",
"version": "1.0.2"
},
{
"name": "solarized-dark-syntax",
"version": "1.0.2",
"theme": "syntax"
},
{
"name": "solarized-light-syntax",
"version": "1.0.2",
"theme": "syntax"
},
{
"name": "spell-check",
"version": "0.67.1"
},
{
"name": "status-bar",
"version": "1.2.3"
},
{
"name": "styleguide",
"version": "0.45.2"
},
{
"name": "symbols-view",
"version": "0.112.0"
},
{
"name": "sync-settings",
"version": "0.7.2"
},
{
"name": "tabs",
"version": "0.96.0"
},
{
"name": "timecop",
"version": "0.33.1"
},
{
"name": "tree-view",
"version": "0.205.0"
},
{
"name": "update-package-dependencies",
"version": "0.10.0"
},
{
"name": "welcome",
"version": "0.34.0"
},
{
"name": "whitespace",
"version": "0.32.2"
}
]
{
"advanced-new-file": {
"caseSensitiveAutoCompletion": true,
"createFileInstantly": true,
"showFilesInAutoComplete": true
},
"advanced-open-file": {
"createDirectories": true,
"createFileInstantly": true,
"fuzzyMatch": true
},
"atom-beautify": {
"general": {
"_analyticsUserId": "d291fc5f-bb91-4863-8b38-36e2f9e3baa2"
}
},
"atom-material-ui": {
"colors": {
"abaseColor": {
"red": 52,
"green": 51,
"blue": 255,
"alpha": 1
},
"accentColor": {
"red": 0,
"green": 240,
"blue": 133,
"alpha": 1
},
"predefinedColor": "Pink"
},
"tabs": {
"tintedTabBar": true
},
"treeView": {
"blendTabs": true,
"compactList": true
},
"ui": {
"panelContrast": true
}
},
"core": {
"disabledPackages": [
"linter-js-standard",
"drupal",
"atomic-chrome",
"package-js-generator",
"linter-jslint",
"linter-eslint",
"linter-jscs",
"linter-scss-lint",
"wrap-guide"
],
"themes": [
"atom-material-ui",
"github-web"
]
},
"docblockr": {
"deep_indent": true,
"development_mode": true
},
"drupal": {
"fileTypesPhp": "module,install,inc,test"
},
"editor": {
"fontSize": 11,
"nonWordCharacters": "()\"':,.;<>~!%^&*|+=[]{}`?…",
"scrollPastEnd": true,
"tabLength": 3
},
"exception-reporting": {
"userId": "420f8b90-6a0c-ff8d-79c2-a3aaf08b8ac0"
},
"linter": {},
"linter-eslint": {
"disableWhenNoEslintConfig": false,
"lintHtmlFiles": true
},
"linter-jslint": {
"jslintVersion": "es6"
},
"livestyle-atom": {
"analyzer": {
"enabled": false,
"notify": false,
"selector": false
}
},
"pigments": {
"extendAutocompleteToColorValue": true,
"extendAutocompleteToVariables": true,
"traverseIntoSymlinkDirectories": true
},
"sync-settings": {
"quietUpdateCheck": true
},
"tree-view": {
"hideVcsIgnoredFiles": true
},
"welcome": {
"showOnStartup": false
},
"whitespace": {
"ignoreWhitespaceOnCurrentLine": false
}
}
# HTML: .text.html.basic
# CSS: .source.css
# SASS: .source.sass
# JavaScript: .source.js
# JSON: .source.json
# PHP: .text.html.php
# Java: .source.java
# Ruby: .text.html.erb
# Python: .source.python
# plain text (including markdown): .text.plain
#
# EX:
# '.source.js':
# 'log JSON':
# 'prefix': 'lj'
# 'body': 'console.log(\'%j\', ${1:Object});$2'
# 'log array length':
# 'prefix': 'llen'
# 'body': 'console.log(\'${1:array} length\', ${1:array}.length);$2'
#
# '.text.html.basic':
# '2x2 table':
# 'prefix': 'table2x2'
# 'body': """
# <table summary="$1">
# [...]
# </table>
# """
#
#
# leftLabel will add text to the left part of the autocomplete results box.
# leftLabelHTML will overwrite what's in leftLabel and allow you to use a bit of CSS such as color.
# rightLabelHTML. By default, in the right part of the results box you will see the name of the snippet. When using rightLabelHTML the name of the snippet will no longer be displayed, and you will be able to use a bit of CSS.
# description will add text to a description box under the autocomplete results list.
# descriptionMoreURL URL to the documentation of the snippet.
# https://github.com/atom/snippets
#
#
########## CSS ##########
'.source.css.less':
'Bootstrap @brand-primary':
'prefix': 'brand'
'body': '@brand-${1:primary}'
'Bootstrap Panel variant mixin':
'prefix': 'panelvariant'
'body': '.panel-variant(${1:@border}; ${2:@heading-text-color}; ${3:@heading-bg-color}; ${1:${4:@heading-border}});'
'Media query':
'prefix': 'csmedia'
'body': '@media (${1:min}-width: @screen-${2:sm}-${1:min}) { $3 }'
'@SMALL':
'prefix': 'small'
'body': '@SMALL'
'@TINY':
'prefix': 'tiny'
'body': '@TINY'
'@DEFAULT':
'prefix': 'default'
'body': '@DEFAULT'
'@LARGE':
'prefix': 'large'
'body': '@LARGE'
'@HUGE':
'prefix': 'huge'
'body': '@HUGE'
'@JUMBO':
'prefix': 'jumbo'
'body': '@JUMBO'
'@grid-gutter-width':
'prefix': 'ggw'
'body': '${2:( }@grid-gutter-width${1:/2} ${2:)}'
'pointer-events none':
'prefix': 'pen'
'body': 'pointer-events: none;'
'Border':
'prefix': 'bd'
'body': 'border: ${1:1}px solid ${3:fade(black, ${2:4}%)};$4'
'Background':
'prefix': 'bg'
'body': 'background: ${1:white};$2'
'livestyle':
'prefix': 'livestyle'
'body': """
@line-height-computed: 40px;
@grid-gutter-width: @line-height-computed;
@TINY: (@SMALL/2);
@SMALL: (@DEFAULT/2);
@DEFAULT: (@line-height-computed/2);
@LARGE: @DEFAULT + (@DEFAULT/2);
@HUGE: @DEFAULT*2;
@JUMBO: @DEFAULT*3;
@gray-base: #000;
@gray-darker: lighten(@gray-base, 13.5%);
@gray-dark: lighten(@gray-base, 20%);
@gray: lighten(@gray-base, 33.5%);
@gray-light: lighten(@gray-base, 46.7%);
@gray-lighter: lighten(@gray-base, 93.5%);
@text-color: @gray-light;
@text-muted: @gray-light;
@input-border: #ccc;
"""
########## PHP & HTML ##########
'.source.php,
.text.html':
'Placeholdit image':
'prefix': 'img'
'body': '<img class="$4" src="${1:http://placehold.it/${2:500}x${3:${2:500}}}">'
'Col xs':
'prefix': 'cxs'
'body': 'col-xs-$1'
'Col sm':
'prefix': 'csm'
'body': 'col-sm-$1'
'Col md':
'prefix': 'cmd'
'body': 'col-md-$1'
'Col lg':
'prefix': 'clg'
'body': 'col-lg-$1'
'Classes utilities':
'prefix': 'clu'
'body': '[ $1 ]'
'class=""':
'prefix': 'cl'
'body': 'class="$2[ $1 ]"'
'Dsm':
'prefix': 'dsm'
'body': '<?php dsm( ${1:\$var} ); ?>'
'breadcrumb':
'prefix': 'drbreadcrumb'
'body': '<?php print theme("breadcrumb", array("breadcrumb"=>drupal_get_breadcrumb())); ?>'
'end of ':
'prefix': 'endoftag'
'body': ' <!-- | End of $1 -->'
'Check if first':
'prefix': 'phpfirstofarray'
'body': 'if ( \$key == key(\$stats) )'
'Row results':
'prefix': 'dresults'
'body': '\$results = \$view->result[\$view->row_index];'
'Php Echo':
'prefix': 'echo'
'body': '<?php echo $1; ?>'
'Drupal entity_metadata_wrapper':
'prefix': 'drentity'
'body': '\$node_wrapped = entity_metadata_wrapper(\'node\', \$node);'
'Str Pos':
'prefix': 'strpos'
'body': "print_r( strpos( ${1: 'haystack'}, ${2:'needle'} ) !== false );"
'Masthead':
'prefix': 'mastsnip'
'body': """
<header id="masthead" class="masthead theme-pinned-masthead" role="banner">
<div class="masthead-cap-container">
<div id="masthead-cap" class="masthead-cap">
<div class="quick-navigation button-group">
<!-- // hamburger menu, secondary nav -->
</div><!-- close quick-navigation -->
<div class="user-tools">
<!-- // login, subscribe, settings -->
<ul class="user-subscriptions-menu">
<li id="bar1-button" class="user-subscriptions-menu user-subscriptions-group button subscribe-button bar1_hover" ><a id="nyt-button-sub">Subscribe Now</a></li>
</ul>
</div><!-- close user-tools -->
</div><!-- close masthead-cap -->
</div><!-- close masthead-cap-container -->
<nav id="navigation-main" class="navigation-main">
<h2 class="sr-only">Quick Site Sections Navigation</h2>
<ul class="navigation-main-menu">
<li><button class="button sections-button">Sections</button> </li>
[...]
<li> <button class="button search-button">Search</button> </li>
<li><button class="button all-sections-button">all</button></li>
</ul>
</nav>
</header>
"""
'Php if':
'prefix': 'phpif'
'body': """
<?php if ( $1 ): ?>
$2
<?php endif; ?>
"""
'Php foreach':
'prefix': 'phpforeach'
'body': """
<?php foreach (${1:\$variable} as $\${2:key} => $\${3:value}): ?>
$4
<?php endforeach; ?>
"""
'Drupal img':
'prefix': 'drimg'
'body': """
<?php
global $theme;
${1:\$hero_img} = array(
'path' => ${2:drupal_get_path('theme', $theme).${3:'/images/name.png'}},
'alt' => $4,
'attributes' => array('class' => ['img-responsive']),
// 'style_name' => [0]['rendered']['#image_style'],
);
echo theme('image', ${1:\$hero_img});
// echo theme('image_style', ${1:\$hero_img}); // (with crop)
?>
"""
'Drupal block':
'prefix': 'drblock'
'body': """
<?php
// Block import
\$block = block_load('${1:views | boxes | apidiffusion-blocks menu_block}', '${2:blog_custom_hp-block_1 | 3 | footer_nav}');
\$block = _block_get_renderable_array(_block_render_blocks(array(\$block)));
echo render(\$block);
?>
"""
'Drupal view':
'prefix': 'drview'
'body': '<?php echo rc_render_view(${1: $view_name}, ${2: $view_display}, ${3: $items}); // rc_get_view(\$view_name, \$view_display, \$items = 3, \$args = [], \$offset = 0, \$pager = false) ?>'
'Pre':
'prefix': 'phppre'
'body': """
${1:<?php}
echo '<pre>';
print_r( ${2:$variable} );
echo '</pre>';
${1:?>}
"""
'Media object custom':
'prefix': 'media'
'body': """
<div class="-media">
<div class="-media-left -media-middle">${1: media-left}</div>
<div class="-media-body">${2: media-body}</div>
${3:<div class="-media-right -media-middle">${1: media-right}</div>}
</div>
"""
'Styleguide comments':
'prefix': 'styleguide'
'body': """
---
notes: |
${1: notes}
variables: [ '${2: variables}' ]
code: |
${3: code}
---
"""
'.source.js':
'Check el in dom':
'prefix': 'checkcss'
'body': "\$(${1: selector}).css({'border': '2px solid red'});"
/*
* Your Stylesheet
*
* This stylesheet is loaded when Atom starts up and is reloaded automatically
* when it is changed and saved.
*
* Add your own CSS or Less to fully customize Atom.
* If you are unfamiliar with Less, you can read more about it here:
* http://lesscss.org
*/
@brand-primary: #3433FF;
@brand-primary-dark: darken(@brand-primary, 15%);
@brand-secondary: #00F085;
@brand-secondary-dark: darken(#00F085, 5%);
/*
* Examples
* (To see them, uncomment and save)
*/
.editor.mini.is-focused {
padding-left: 10px;
background: fade(@brand-primary, 10%);
}
.settings-view .packages .search-container {
align-items: center;
}
.btn,
button {
box-shadow: none !important;
border: 1px solid fade(black, 20%);
transition: .1s;
&:hover {
background: fade(black, 4%);
}
&:active {
color: fade(@brand-primary, 50%);
background: fade(@brand-primary, 10%);
// border: 1px solid fade(black, 10%);
}
}
.badge {
// color: darken(@brand-secondary, 40%);
font-weight: bold;
box-shadow: 0 0 0 1px fade(black, 10%) inset;
background: @brand-secondary-dark;
}
.tree-view-scroller {
border-right: 1px solid @keyline-color;
}
.list-tree .list-item,
.list-group > .list-item {
line-height: 1em !important;
padding-top: .5em;
padding-bottom: .5em;
&.selected {
&:before { border: 1px solid @keyline-color; }
}
}
.list-tree {
padding-top: 0;
padding-bottom: 0;
margin-bottom: 20px;
}
.tree-view:focus li.directory.selected > .list-item {
color: white;
// color: fade(@brand-primary, 80%);
&:after {
// background: fade(@brand-primary, 10%);
}
}
@keyline-color: fade(black, 6%);
//
// @background-color-info: #48BEFF;
// @background-color-success: #C2F8CB;
// // @background-color-warning: ;
// @background-color-error: #F25757;
//
//
// @text-color-success: #C2F8CB;
// @text-color-info: #E6BDF4;
// // @text-color-warning: ;
// // @text-color-error: ;
//
// @app-background-color: @brand-primary;
//
//
//
// .indent-guide-improved {
// width: 20px;
//
// }
//
atom-text-editor::shadow {
.line.cursor-line {
background: saturate(fade(@brand-primary, 10%), -80%);
}
.highlight.selection .region {
background-color: @brand-secondary;
&,
span,
.string {
color: white; //@brand-primary-dark !important;
}
}
.cursor {
border-color: @brand-secondary-dark;
// border-color: @brand-primary;
}
.bracket-matcher .region {
border: none !important;
background: fade(@brand-primary, 20%);
// z-index: 1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment