Skip to content

Instantly share code, notes, and snippets.

@nagman
Last active February 20, 2019 11:09
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 nagman/5db277ad22111baeadae2db776045fd8 to your computer and use it in GitHub Desktop.
Save nagman/5db277ad22111baeadae2db776045fd8 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()}"
atom.commands.add 'atom-text-editor', 'custom:typescript-format-code', ->
editor = atom.workspace.getActiveTextEditor()
editorView = atom.views.getView(editor)
formatted = false
selected = false
indented = false
timeout = 10
atom.commands.onDidDispatch (e) ->
if (e.type == 'typescript:format-code' && !formatted)
formatted = true;
setTimeout(() ->
atom.commands.dispatch editorView, 'core:select-all'
, timeout)
else if (e.type == 'core:select-all' && !selected)
selected = true;
setTimeout(() ->
atom.commands.dispatch editorView, 'editor:auto-indent'
, timeout)
else if (e.type == 'editor:auto-indent' && !indented)
indented = true;
atom.commands.dispatch editorView, 'typescript:format-code'
# 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
'atom-text-editor':
'ctrl-i': 'editor:auto-indent'
'ctrl-shift-l': 'editor:split-selections-into-lines'
'ctrl-alt-l': 'custom:typescript-format-code'
'f6': 'postcss-sorting:run'
'atom-workspace atom-text-editor:not([mini])':
'ctrl-shift-up': 'editor:move-line-up'
'ctrl-shift-down': 'editor:move-line-down'
'ctrl-up': 'emmet:increment-number-by-1'
'ctrl-down': 'emmet:decrement-number-by-1'
'shift-alt-up': 'emmet:increment-number-by-10'
'shift-alt-down': 'emmet:decrement-number-by-10'
'ctrl-:': 'editor:toggle-line-comments'
'ctrl-shift-alt-m': 'minimap:toggle'
'ctrl--': 'editor:fold-current-row'
'ctrl-+': 'editor:unfold-current-row'
'ctrl-numpad0': 'editor:unfold-all'
'ctrl-numpad1': 'editor:fold-at-indent-level-1'
'ctrl-numpad2': 'editor:fold-at-indent-level-2'
'ctrl-numpad3': 'editor:fold-at-indent-level-3'
'ctrl-numpad4': 'editor:fold-at-indent-level-4'
'ctrl-numpad5': 'editor:fold-at-indent-level-5'
'ctrl-numpad6': 'editor:fold-at-indent-level-6'
'ctrl-numpad7': 'editor:fold-at-indent-level-7'
'atom-text-editor:not([mini])':
'ctrl-alt-enter': 'emmet:wrap-with-abbreviation'
'atom-workspace atom-text-editor':
'ctrl-delete': 'editor:delete-to-next-word-boundary'
'ctrl-backspace': 'editor:delete-to-previous-word-boundary'
'ctrl-left': 'editor:move-to-previous-subword-boundary'
'ctrl-right': 'editor:move-to-next-subword-boundary'
'ctrl-shift-left': 'editor:select-to-previous-subword-boundary'
'ctrl-shift-right': 'editor:select-to-next-subword-boundary'
[
{
"name": "about",
"version": "1.9.1"
},
{
"name": "activate-power-mode",
"version": "2.7.0"
},
{
"name": "archive-view",
"version": "0.65.1"
},
{
"name": "atom-alignment",
"version": "0.13.0"
},
{
"name": "atom-dark-syntax",
"version": "0.29.1",
"theme": "syntax"
},
{
"name": "atom-dark-ui",
"version": "0.53.3",
"theme": "ui"
},
{
"name": "atom-handlebars",
"version": "1.3.0"
},
{
"name": "atom-light-syntax",
"version": "0.29.1",
"theme": "syntax"
},
{
"name": "atom-light-ui",
"version": "0.46.3",
"theme": "ui"
},
{
"name": "atom-ternjs",
"version": "0.18.3"
},
{
"name": "atom-typescript",
"version": "13.1.0"
},
{
"name": "atom-wordpress",
"version": "0.3.0"
},
{
"name": "auto-detect-indentation",
"version": "1.3.0"
},
{
"name": "auto-semicolon",
"version": "1.1.0"
},
{
"name": "autocomplete-atom-api",
"version": "0.10.7"
},
{
"name": "autocomplete-css",
"version": "0.17.5"
},
{
"name": "autocomplete-html",
"version": "0.8.8"
},
{
"name": "autocomplete-modules",
"version": "2.2.6"
},
{
"name": "autocomplete-paths",
"version": "2.12.2"
},
{
"name": "autocomplete-php",
"version": "0.3.7"
},
{
"name": "autocomplete-plus",
"version": "2.42.0"
},
{
"name": "autocomplete-snippets",
"version": "1.12.0"
},
{
"name": "autoflow",
"version": "0.29.4"
},
{
"name": "autosave",
"version": "0.24.6"
},
{
"name": "background-tips",
"version": "0.28.0"
},
{
"name": "base16-tomorrow-dark-theme",
"version": "1.6.0",
"theme": "syntax"
},
{
"name": "base16-tomorrow-light-theme",
"version": "1.6.0",
"theme": "syntax"
},
{
"name": "bookmarks",
"version": "0.45.1"
},
{
"name": "bracket-matcher",
"version": "0.90.4"
},
{
"name": "busy-signal",
"version": "1.4.3"
},
{
"name": "change-case",
"version": "0.6.5"
},
{
"name": "command-palette",
"version": "0.43.5"
},
{
"name": "dalek",
"version": "0.2.2"
},
{
"name": "deprecation-cop",
"version": "0.56.9"
},
{
"name": "dev-live-reload",
"version": "0.48.1"
},
{
"name": "double-tag",
"version": "1.7.0"
},
{
"name": "emmet",
"version": "2.4.3"
},
{
"name": "emmet-jsx-css-modules",
"version": "1.0.0"
},
{
"name": "encoding-selector",
"version": "0.23.9"
},
{
"name": "exception-reporting",
"version": "0.43.1"
},
{
"name": "file-icons",
"version": "2.1.27"
},
{
"name": "find-and-replace",
"version": "0.215.14"
},
{
"name": "fuzzy-finder",
"version": "1.8.2"
},
{
"name": "genesis-ui",
"version": "0.5.0",
"theme": "ui"
},
{
"name": "git-diff",
"version": "1.3.9"
},
{
"name": "github",
"version": "0.23.3"
},
{
"name": "go-to-line",
"version": "0.33.0"
},
{
"name": "grammar-selector",
"version": "0.50.1"
},
{
"name": "highlight-selected",
"version": "0.14.0"
},
{
"name": "image-view",
"version": "0.63.1"
},
{
"name": "incompatible-packages",
"version": "0.27.3"
},
{
"name": "intentions",
"version": "1.1.5"
},
{
"name": "keybinding-resolver",
"version": "0.38.4"
},
{
"name": "language-babel",
"version": "2.85.0"
},
{
"name": "language-c",
"version": "0.60.14"
},
{
"name": "language-clojure",
"version": "0.22.7"
},
{
"name": "language-coffee-script",
"version": "0.49.3"
},
{
"name": "language-csharp",
"version": "1.1.0"
},
{
"name": "language-css",
"version": "0.43.0"
},
{
"name": "language-ejs",
"version": "0.4.0"
},
{
"name": "language-gfm",
"version": "0.90.6"
},
{
"name": "language-git",
"version": "0.19.1"
},
{
"name": "language-go",
"version": "0.46.6"
},
{
"name": "language-graphql",
"version": "0.11.0"
},
{
"name": "language-html",
"version": "0.51.5"
},
{
"name": "language-hyperlink",
"version": "0.17.0"
},
{
"name": "language-java",
"version": "0.31.1"
},
{
"name": "language-javascript",
"version": "0.129.19"
},
{
"name": "language-json",
"version": "0.19.2"
},
{
"name": "language-less",
"version": "0.34.3"
},
{
"name": "language-make",
"version": "0.23.0"
},
{
"name": "language-mjml",
"version": "2.0.1"
},
{
"name": "language-mustache",
"version": "0.14.5"
},
{
"name": "language-objective-c",
"version": "0.15.1"
},
{
"name": "language-perl",
"version": "0.38.1"
},
{
"name": "language-php",
"version": "0.44.1"
},
{
"name": "language-property-list",
"version": "0.9.1"
},
{
"name": "language-python",
"version": "0.51.8"
},
{
"name": "language-ruby",
"version": "0.72.14"
},
{
"name": "language-ruby-on-rails",
"version": "0.25.3"
},
{
"name": "language-rust-bundled",
"version": "0.1.0"
},
{
"name": "language-sass",
"version": "0.62.0"
},
{
"name": "language-shellscript",
"version": "0.27.9"
},
{
"name": "language-source",
"version": "0.9.0"
},
{
"name": "language-sql",
"version": "0.25.10"
},
{
"name": "language-text",
"version": "0.7.4"
},
{
"name": "language-todo",
"version": "0.29.4"
},
{
"name": "language-toml",
"version": "0.18.2"
},
{
"name": "language-typescript",
"version": "0.4.11"
},
{
"name": "language-xml",
"version": "0.35.3"
},
{
"name": "language-yaml",
"version": "0.32.0"
},
{
"name": "line-ending-selector",
"version": "0.7.7"
},
{
"name": "link",
"version": "0.31.6"
},
{
"name": "linter",
"version": "2.2.0"
},
{
"name": "linter-mjml",
"version": "1.2.0"
},
{
"name": "linter-ui-default",
"version": "1.7.1"
},
{
"name": "markdown-preview",
"version": "0.159.25"
},
{
"name": "metrics",
"version": "1.6.2"
},
{
"name": "minimap",
"version": "4.29.9"
},
{
"name": "minimap-highlight-selected",
"version": "4.6.1"
},
{
"name": "notifications",
"version": "0.70.5"
},
{
"name": "one-dark-syntax",
"version": "1.8.4",
"theme": "syntax"
},
{
"name": "one-dark-ui",
"version": "1.12.5",
"theme": "ui"
},
{
"name": "one-light-syntax",
"version": "1.8.4",
"theme": "syntax"
},
{
"name": "one-light-ui",
"version": "1.12.5",
"theme": "ui"
},
{
"name": "open-on-github",
"version": "1.3.1"
},
{
"name": "package-generator",
"version": "1.3.0"
},
{
"name": "pigments",
"version": "0.40.2"
},
{
"name": "postcss-sorting",
"version": "2.10.0"
},
{
"name": "prettier-atom",
"version": "0.56.2"
},
{
"name": "react",
"version": "0.18.0"
},
{
"name": "remember-folds",
"version": "0.3.0"
},
{
"name": "remote-ftp",
"version": "2.2.2"
},
{
"name": "settings-view",
"version": "0.257.2"
},
{
"name": "snippets",
"version": "1.4.0"
},
{
"name": "solarized-dark-syntax",
"version": "1.3.0",
"theme": "syntax"
},
{
"name": "solarized-light-syntax",
"version": "1.3.0",
"theme": "syntax"
},
{
"name": "sort-lines",
"version": "0.18.0"
},
{
"name": "spell-check",
"version": "0.74.2"
},
{
"name": "status-bar",
"version": "1.8.15"
},
{
"name": "styleguide",
"version": "0.49.12"
},
{
"name": "symbols-view",
"version": "0.118.2"
},
{
"name": "sync-settings",
"version": "0.8.6"
},
{
"name": "tab-foldername-index",
"version": "3.3.0"
},
{
"name": "tabs",
"version": "0.109.2"
},
{
"name": "teletype",
"version": "0.13.3"
},
{
"name": "timecop",
"version": "0.36.2"
},
{
"name": "toggle-quotes",
"version": "1.1.3"
},
{
"name": "tree-view",
"version": "0.224.5"
},
{
"name": "tree-view-copy-relative-path",
"version": "1.2.0"
},
{
"name": "update-package-dependencies",
"version": "0.13.1"
},
{
"name": "welcome",
"version": "0.36.7"
},
{
"name": "whitespace",
"version": "0.37.7"
},
{
"name": "wrap-guide",
"version": "0.40.3"
}
]
{
"Remote-FTP": {
"connector": {
"autoUploadOnSave": "only when connected"
},
"notifications": {
"enableTransfer": true
},
"tree": {
"useDockIntegration": true
}
},
"activate-power-mode": {
"comboMode": {
"enabled": false
},
"particles": {
"enabled": false
},
"plugins": {
"playAudio": true,
"screenShake": true
},
"screenShake": {
"enabled": false
}
},
"atom-beautify": {
"general": {
"beautifyEntireFileOnSave": false
},
"handlebars": {
"indent_inner_html": true
}
},
"atom-css-comb": {
"commonConfigs": "C:\\Users\\Adelios\\\\.atom\\\\.csscomb.json",
"readyMadeConfigs": "zen"
},
"atom-ternjs": {
"snippetsFirst": true,
"useSnippets": true
},
"atom-typescript": {
"showSemanticView": true
},
"autocomplete-plus": {
"backspaceTriggersAutocomplete": true,
"enableBuiltinProvider": false,
"moveToCancel": true
},
"core": {
"customFileTypes": {
"source.ini": [
".buckconfig",
".hgrc",
".flowconfig"
],
"source.json": [
"BUCK.autodeps"
],
"source.python": [
"BUCK"
]
},
"disabledPackages": [
"atom-wordpress",
"react",
"activate-power-mode"
],
"ignoredNames": [
".git",
".hg",
".svn",
".DS_Store",
"._*",
"Thumbs.db",
"desktop.ini",
"node_modules",
".next",
".directory",
""
],
"packagesWithKeymapsDisabled": [],
"telemetryConsent": "no",
"uriHandlerRegistration": "always",
"useTreeSitterParsers": false
},
"editor": {
"atomicSoftTabs": false,
"fontFamily": "fira code",
"fontSize": 17,
"invisibles": {
"cr": " ",
"eol": " ",
"tab": " "
},
"nonWordCharacters": "/\\()\"':,.;<>~!@#$%^&*|+=[]{}`-…?",
"scrollPastEnd": true,
"showIndentGuide": true,
"showInvisibles": true,
"softTabs": false,
"softWrap": true,
"tabLength": 4,
"tabType": "hard",
"zoomFontWhenCtrlScrolling": false
},
"exception-reporting": {
"userId": "7de98235-0fa6-667e-9c8f-6893f5da8471"
},
"markdown-preview": {
"breakOnSingleNewline": true
},
"minimap": {
"plugins": {
"highlight-selected": true,
"highlight-selectedDecorationsZIndex": 0
}
},
"motepair": {
"serverAddress": "winhit.biz",
"serverPort": 3000
},
"nuclide": {
"atom-ide-code-format": {
"formatOnSave": true
},
"nuclide-file-tree": {
"showOpenFiles": false,
"showUncommittedChanges": false
},
"nuclide-home": {
"showHome": false
}
},
"prettier-atom": {
"formatOnSaveOptions": {
"enabled": true,
"showInStatusBar": true
},
"prettierEslintOptions": {
"prettierLast": true
},
"prettierOptions": {
"bracketSpacing": false,
"singleQuote": true,
"trailingComma": "all",
"useTabs": true
},
"useEslint": true
},
"remote-ftp": {
"connector": {
"autoUploadOnSave": "only when connected"
},
"notifications": {
"enableTransfer": true
}
},
"sync-settings": {
"quietUpdateCheck": true,
"removeObsoletePackages": true
},
"toggle-quotes": {
"quoteCharacters": "'`\""
},
"tree-view": {
"hideIgnoredNames": true
},
"welcome": {
"showOnStartup": false
}
}
# Your snippets
#
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to
# expand the prefix into a larger code block with templated values.
#
# You can create a new snippet in this file by typing "snip" and then hitting
# tab.
#
# An example CoffeeScript snippet to expand log to console.log:
#
# '.source.coffee':
# 'Console log':
# 'prefix': 'log'
# 'body': 'console.log $1'
#
# Each scope (e.g. '.source.coffee' above) can only be declared once.
#
# 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
# JS
'.source.js':
'Table of contents':
'prefix': 'toc'
'body': """
/*--------------------------------------------------------------
${1:TITLE} >>> TABLE OF CONTENTS:
----------------------------------------------------------------
- ${2:Global}
--------------------------------------------------------------*/
$0"""
'Section':
'prefix': 'sec'
'body': """
/*--------------------------------------------------------------
- ${1:Global}
--------------------------------------------------------------*/
$0"""
'console.log()':
'prefix': 'console'
'body': 'console.log($1);$0'
'require()' :
'prefix': 'require'
'body': 'require(\'$1\');$0'
'import' :
'prefix': 'import'
'body': 'import ${1:Component} from \'${2:./}${1:Component}\';'
'export' :
'prefix': 'export'
'body': """
const ${1:Component} = ${2:props} => (
$0
);
export default ${1:Component};"""
'react' :
'prefix': 'react'
'body': """
class ${1:Component} extends React.Component {
render() {
return (
$0
);
}
}
export default ${1:Component};"""
'import style react' :
'prefix': 'style'
'body': 'import style from \'${1:./}style.scss\';'
'function ()' :
'prefix': 'function'
'body': """
function ($1) {
$0
}"""
'import link next' :
'prefix': 'link'
'body': 'import Link from \'next/link\';'
# TYPESCRIPT
'.source.ts':
'Import':
'prefix': 'import'
'body': 'import { $2 } from \'$1\''
# PHP
'.source.php':
'Section':
'prefix': 'sec'
'body': """
/*--------------------------------------------------------------
- ${1:Global}
--------------------------------------------------------------*/
$0"""
# SCSS
'.source.scss':
'Table of contents':
'prefix': 'toc'
'body': """
/*--------------------------------------------------------------
${1:TITLE} >>> TABLE OF CONTENTS:
----------------------------------------------------------------
- ${2:Global}
--------------------------------------------------------------*/
$0"""
'-webkit-overflow-scrolling':
'prefix': 'webkit-overflow-scrolling;'
'body': '-webkit-overflow-scrolling: ${0:touch};'
'Section':
'prefix': 'sec'
'body': """
/*--------------------------------------------------------------
- ${1:Global}
--------------------------------------------------------------*/
$0"""
'Pseudo':
'prefix': 'pseudo'
'body': """
&::before, &::after {
content: '';
$1
}"""
'Before':
'prefix': 'before'
'body': """
&::before {
$1
}"""
'After':
'prefix': 'after'
'body': """
&::after {
$1
}"""
'Hover':
'prefix': 'hover'
'body': """
&:hover {
$1
}"""
'last-child':
'prefix': 'last-child'
'body': """
&:last-child {
$1
}"""
'first-child':
'prefix': 'first-child'
'body': """
&:first-child {
$1
}"""
'nth-child':
'prefix': 'nth-child'
'body': """
&:nth-child($1) {
$2
}"""
'global':
'prefix': 'global'
'body': """
:global {
$1
}"""
'currentColor':
'prefix': 'currentColor'
'body': 'currentColor'
'rotate':
'prefix': 'rotate'
'body': 'transform: rotate($0deg);'
'transition':
'prefix': 'tr'
'body': 'transition: ${0:.2s};'
'translateX':
'prefix': 'trx'
'body': 'transform: translateX($0);'
'translateY':
'prefix': 'try'
'body': 'transform: translateY($0);'
'scale':
'prefix': 'scale'
'body': 'transform: scale($0);'
'scaleX':
'prefix': 'scalex'
'body': 'transform: scaleX($0);'
'scaleY':
'prefix': 'scaley'
'body': 'transform: scaleY($0);'
'import':
'prefix': 'import'
'body': '@import \'${1:variables}\';$0'
'display flex':
'prefix': 'df'
'body': 'display: flex;'
'breakPoint':
'prefix': 'breakpoint'
'body': """
@include breakPoint {
$0
}"""
'mobileOnly':
'prefix': 'mobileOnly'
'body': """
@include mobileOnly {
$0
}"""
'untilTablet':
'prefix': 'untilTablet'
'body': """
@include untilTablet {
$0
}"""
'tablet':
'prefix': 'tablet'
'body': """
@include tablet {
$0
}"""
'untilLaptop':
'prefix': 'untilLaptop'
'body': """
@include untilLaptop {
$0
}"""
'laptop':
'prefix': 'laptop'
'body': """
@include laptop {
$0
}"""
'laptopS':
'prefix': 'laptops'
'body': """
@include laptopS {
$0
}"""
'untilLaptopS':
'prefix': 'untilLaptops'
'body': """
@include untilLaptopS {
$0
}"""
'untilDesktop':
'prefix': 'untilDesktop'
'body': """
@include untilDesktop {
$0
}"""
'desktop':
'prefix': 'desktop'
'body': """
@include desktop {
$0
}"""
'transitionFull':
'prefix': 'transitionfull'
'body': """
transition: {
property: ${1:opacity, transform};
duration: ${2:.2s};
}"""
'property':
'prefix': 'property'
'body': 'property: $0;'
'full html & body':
'prefix': 'htmlbody'
'body': """
html {
height: 100%;
}
body {
position: relative;
min-height: 100%;
padding-bottom: ${1:50}px;
box-sizing: border-box;
overflow-y: scroll;
}"""
/*
* 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
*/
/*
* Examples
* (To see them, uncomment and save)
*/
// style the background color of the tree view
.tree-view {
background-color: #232830;
}
// style the background and foreground colors on the atom-text-editor-element itself
atom-text-editor {
// color: white;
background-color: #2b303b;
}
// To style other content in the text editor's shadow DOM, use the ::shadow expression
atom-text-editor::shadow .cursor {
// border-color: red;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment