Skip to content

Instantly share code, notes, and snippets.

@kylebarron kylebarron/init.js
Last active Dec 19, 2018

Embed
What would you like to do?
const { CompositeDisposable, Point, Range } = require('atom');
atom.commands.add('atom-text-editor', 'me:insert-number-list', () => {
var editor = atom.workspace.getActiveTextEditor();
var selections = editor.getSelections();
for (var i = 0; i < selections.length; i++) {
selection = selections[i]
selection.insertText(String(i + 1))
}
})
atom.commands.add('atom-text-editor', 'fold-docstring', () => {
var editor = atom.workspace.getActiveTextEditor();
var currentPosition = editor.getCursorBufferPosition();
var backwardRange = [0, currentPosition];
var docstring_regex = new RegExp(/("""|''')/g);
var foundStart = null;
editor.backwardsScanInBufferRange(docstring_regex, backwardRange, function(result) {
foundStart = result.range;
return result.stop();
});
// now look for the end
var numberOfLines = editor.getLineCount();
var forwardRange = [foundStart.end, new Point(numberOfLines + 1, 0)];
var foundEnd = null;
editor.scanInBufferRange(docstring_regex, forwardRange, function(result) {
foundEnd = result.range;
return result.stop();
});
editor.setSelectedBufferRange([foundStart.start, foundEnd.end]);
var selection = editor.selections[0];
selection.fold();
})
# 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-workspace':
'ctrl-o': 'advanced-open-file:toggle'
'cmd-o': 'advanced-open-file:toggle'
'ctrl-t': 'fuzzy-grep:toggle'
'cmd-t': 'fuzzy-grep:toggle'
'ctrl-q': 'editor:split-selections-into-lines'
'cmd-q': 'editor:split-selections-into-lines'
"atom-text-editor":
'ctrl-shift-r': 'hydrogen:connect-to-remote-kernel'
'cmd-shift-r': 'hydrogen:connect-to-remote-kernel'
'ctrl-alt-a' : 'atom-alignment:align'
'cmd-alt-a' : 'atom-alignment:align'
'ctrl-alt-shift-a' : 'atom-alignment:alignmultiple'
'cmd-alt-shift-a' : 'atom-alignment:alignmultiple'
'ctrl-shift-down' : 'editor:add-selection-below'
'cmd-shift-down' : 'editor:add-selection-below'
'ctrl-shift-up' : 'editor:add-selection-above'
'cmd-shift-up' : 'editor:add-selection-above'
'ctrl-alt-shift-p' : 'editor:log-cursor-scope'
'cmd-alt-shift-p' : 'editor:log-cursor-scope'
"atom-text-editor[data-grammar='source pweave md']":
'ctrl-alt-b' : 'atom-beautify:beautify-language-python'
'cmd-alt-b' : 'atom-beautify:beautify-language-python'
# Default Keymaps for Markdown Writer
# https://atom.io/packages/markdown-writer
#
# Wiki: https://github.com/zhuochun/md-writer/wiki/Settings-for-Keymaps
#
".platform-linux atom-text-editor[data-grammar='text md']":
'ctrl-alt-b' : 'atom-beautify:beautify-language-python'
"shift-ctrl-I": "markdown-writer:insert-image"
"ctrl-v": "markdown-writer:insert-image-clipboard"
"ctrl-i": "markdown-writer:toggle-italic-text"
"ctrl-b": "markdown-writer:toggle-bold-text"
"ctrl-'": "markdown-writer:toggle-code-text"
"ctrl-k": "markdown-writer:toggle-keystroke-text"
"ctrl-h": "markdown-writer:toggle-strikethrough-text"
"ctrl-alt-1": "markdown-writer:toggle-h1"
"ctrl-alt-2": "markdown-writer:toggle-h2"
"ctrl-alt-3": "markdown-writer:toggle-h3"
"ctrl-alt-4": "markdown-writer:toggle-h4"
"ctrl-alt-5": "markdown-writer:toggle-h5"
"shift-ctrl-O": "markdown-writer:toggle-ol"
"shift-ctrl-U": "markdown-writer:toggle-ul"
"shift-ctrl->": "markdown-writer:toggle-blockquote"
'shift-ctrl-"': "markdown-writer:toggle-codeblock-text"
"ctrl-j ctrl-p": "markdown-writer:jump-to-previous-heading"
"ctrl-j ctrl-n": "markdown-writer:jump-to-next-heading"
"ctrl-j ctrl-d": "markdown-writer:jump-to-reference-definition"
"ctrl-j ctrl-t": "markdown-writer:jump-to-next-table-cell"
".platform-linux atom-text-editor[data-grammar='source dyndoc stata']":
"shift-ctrl-I": "markdown-writer:insert-image"
"ctrl-v": "markdown-writer:insert-image-clipboard"
"ctrl-i": "markdown-writer:toggle-italic-text"
"ctrl-b": "markdown-writer:toggle-bold-text"
"ctrl-'": "markdown-writer:toggle-code-text"
"ctrl-k": "markdown-writer:toggle-keystroke-text"
"ctrl-h": "markdown-writer:toggle-strikethrough-text"
"ctrl-alt-1": "markdown-writer:toggle-h1"
"ctrl-alt-2": "markdown-writer:toggle-h2"
"ctrl-alt-3": "markdown-writer:toggle-h3"
"ctrl-alt-4": "markdown-writer:toggle-h4"
"ctrl-alt-5": "markdown-writer:toggle-h5"
"shift-ctrl-O": "markdown-writer:toggle-ol"
"shift-ctrl-U": "markdown-writer:toggle-ul"
"shift-ctrl->": "markdown-writer:toggle-blockquote"
'shift-ctrl-"': "markdown-writer:toggle-codeblock-text"
"ctrl-j ctrl-p": "markdown-writer:jump-to-previous-heading"
"ctrl-j ctrl-n": "markdown-writer:jump-to-next-heading"
"ctrl-j ctrl-d": "markdown-writer:jump-to-reference-definition"
"ctrl-j ctrl-t": "markdown-writer:jump-to-next-table-cell"
'.advanced-open-file atom-text-editor':
'ctrl-w': 'advanced-open-file:delete-path-component'
'cmd-w': 'advanced-open-file:delete-path-component'
[
{
"name": "Hydrogen",
"version": "2.7.0"
},
{
"name": "MagicPython",
"version": "1.1.1"
},
{
"name": "Zen",
"version": "0.18.0"
},
{
"name": "about",
"version": "1.9.1"
},
{
"name": "advanced-open-file",
"version": "0.16.8"
},
{
"name": "archive-view",
"version": "0.65.1"
},
{
"name": "atom-alignment",
"version": "0.13.0"
},
{
"name": "atom-beautify",
"version": "0.33.4"
},
{
"name": "atom-clock",
"version": "0.1.16"
},
{
"name": "atom-dark-syntax",
"version": "0.29.1",
"theme": "syntax"
},
{
"name": "atom-dark-ui",
"version": "0.53.3",
"theme": "ui"
},
{
"name": "atom-fuzzy-grep",
"version": "0.17.2"
},
{
"name": "atom-gmail",
"version": "0.2.0"
},
{
"name": "atom-ide-ui",
"version": "0.13.0"
},
{
"name": "atom-language-r",
"version": "1.4.8"
},
{
"name": "atom-light-syntax",
"version": "0.29.1",
"theme": "syntax"
},
{
"name": "atom-light-ui",
"version": "0.46.3",
"theme": "ui"
},
{
"name": "atom-material-syntax",
"version": "1.0.8",
"theme": "syntax"
},
{
"name": "atom-material-ui",
"version": "2.1.3",
"theme": "ui"
},
{
"name": "atom-typescript",
"version": "12.7.3"
},
{
"name": "auto-detect-indentation",
"version": "1.3.0"
},
{
"name": "autoclose-html",
"version": "0.23.0"
},
{
"name": "autocomplete-atom-api",
"version": "0.10.7"
},
{
"name": "autocomplete-bibtex",
"version": "1.2.1"
},
{
"name": "autocomplete-css",
"version": "0.17.5"
},
{
"name": "autocomplete-html",
"version": "0.8.7"
},
{
"name": "autocomplete-paths",
"version": "2.12.2"
},
{
"name": "autocomplete-plus",
"version": "2.41.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.3"
},
{
"name": "build",
"version": "0.70.0"
},
{
"name": "busy-signal",
"version": "1.4.3"
},
{
"name": "change-case",
"version": "0.6.5"
},
{
"name": "color-picker",
"version": "2.3.0"
},
{
"name": "command-palette",
"version": "0.43.5"
},
{
"name": "cson",
"version": "2.0.1"
},
{
"name": "dalek",
"version": "0.2.2"
},
{
"name": "deprecation-cop",
"version": "0.56.9"
},
{
"name": "dev-live-reload",
"version": "0.48.1"
},
{
"name": "docblockr",
"version": "0.13.7"
},
{
"name": "docstring-fold",
"version": "0.1.0"
},
{
"name": "editor-stats",
"version": "0.17.0"
},
{
"name": "editorconfig",
"version": "2.2.2"
},
{
"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": "flow-ide",
"version": "1.12.1"
},
{
"name": "fuzzy-finder",
"version": "1.8.2"
},
{
"name": "git-diff",
"version": "1.3.9"
},
{
"name": "git-time-machine",
"version": "2.1.0"
},
{
"name": "github",
"version": "0.22.2"
},
{
"name": "go-to-line",
"version": "0.33.0"
},
{
"name": "grammar-selector",
"version": "0.50.1"
},
{
"name": "highlight-line",
"version": "0.12.0"
},
{
"name": "highlight-selected",
"version": "0.14.0"
},
{
"name": "hydrogen-launcher",
"version": "1.2.2"
},
{
"name": "hydrogen-python",
"version": "0.0.6"
},
{
"name": "hyperclick",
"version": "0.0.0"
},
{
"name": "ide-bash",
"version": "1.0.11"
},
{
"name": "ide-java",
"version": "0.8.3"
},
{
"name": "ide-python",
"version": "1.1.0"
},
{
"name": "ide-r",
"version": "0.1.8"
},
{
"name": "ide-typescript",
"version": "0.8.0"
},
{
"name": "image-view",
"version": "0.63.1"
},
{
"name": "incompatible-packages",
"version": "0.27.3"
},
{
"name": "indent-guide-improved",
"version": "1.4.13"
},
{
"name": "insert-timestamp",
"version": "0.2.4"
},
{
"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.13"
},
{
"name": "language-clojure",
"version": "0.22.7"
},
{
"name": "language-cmake",
"version": "1.1.0"
},
{
"name": "language-coffee-script",
"version": "0.49.3"
},
{
"name": "language-csharp",
"version": "1.1.0"
},
{
"name": "language-css",
"version": "0.43.0"
},
{
"name": "language-cython",
"version": "0.3.0"
},
{
"name": "language-gfm",
"version": "0.90.5"
},
{
"name": "language-git",
"version": "0.19.1"
},
{
"name": "language-gitignore",
"version": "0.3.0"
},
{
"name": "language-go",
"version": "0.46.6"
},
{
"name": "language-html",
"version": "0.51.5"
},
{
"name": "language-hyperlink",
"version": "0.17.0"
},
{
"name": "language-ini",
"version": "1.20.0"
},
{
"name": "language-java",
"version": "0.30.0"
},
{
"name": "language-javascript",
"version": "0.129.17"
},
{
"name": "language-json",
"version": "0.19.2"
},
{
"name": "language-julia",
"version": "0.17.0"
},
{
"name": "language-latex",
"version": "1.1.1"
},
{
"name": "language-less",
"version": "0.34.2"
},
{
"name": "language-liquid",
"version": "0.7.0"
},
{
"name": "language-make",
"version": "0.22.3"
},
{
"name": "language-markdown",
"version": "0.27.0"
},
{
"name": "language-matlab",
"version": "0.2.1"
},
{
"name": "language-mediawiki",
"version": "2.2.0"
},
{
"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.0"
},
{
"name": "language-property-list",
"version": "0.9.1"
},
{
"name": "language-python",
"version": "0.51.5"
},
{
"name": "language-restructuredtext",
"version": "1.1.2"
},
{
"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-sas",
"version": "0.2.4"
},
{
"name": "language-sass",
"version": "0.62.0"
},
{
"name": "language-scheme",
"version": "1.4.0"
},
{
"name": "language-shellscript",
"version": "0.27.6"
},
{
"name": "language-source",
"version": "0.9.0"
},
{
"name": "language-sql",
"version": "0.25.10"
},
{
"name": "language-stata",
"version": "1.7.0"
},
{
"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-weave",
"version": "0.4.2"
},
{
"name": "language-xml",
"version": "0.35.2"
},
{
"name": "language-yaml",
"version": "0.32.0"
},
{
"name": "latex",
"version": "0.50.2"
},
{
"name": "latex-completions",
"version": "0.3.6"
},
{
"name": "latexer",
"version": "0.3.0"
},
{
"name": "line-ending-selector",
"version": "0.7.7"
},
{
"name": "link",
"version": "0.31.6"
},
{
"name": "linter",
"version": "2.2.0"
},
{
"name": "linter-eslint",
"version": "8.4.1"
},
{
"name": "linter-flake8",
"version": "2.3.0"
},
{
"name": "linter-gcc",
"version": "0.7.1"
},
{
"name": "linter-mypy",
"version": "2.6.2"
},
{
"name": "linter-shellcheck",
"version": "1.5.0"
},
{
"name": "linter-ui-default",
"version": "1.7.1"
},
{
"name": "markdown-preview",
"version": "0.159.25"
},
{
"name": "markdown-preview-plus",
"version": "3.7.1"
},
{
"name": "markdown-table-formatter",
"version": "2.9.2"
},
{
"name": "markdown-writer",
"version": "2.11.3"
},
{
"name": "metrics",
"version": "1.6.2"
},
{
"name": "minimap",
"version": "4.29.9"
},
{
"name": "minimap-autohider",
"version": "1.6.0"
},
{
"name": "minimap-cursorline",
"version": "0.2.0"
},
{
"name": "minimap-find-and-replace",
"version": "4.5.2"
},
{
"name": "minimap-git-diff",
"version": "4.3.1"
},
{
"name": "minimap-highlight-selected",
"version": "4.6.1"
},
{
"name": "minimap-selection",
"version": "4.5.0"
},
{
"name": "minimap-split-diff",
"version": "0.3.7"
},
{
"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": "pdf-view",
"version": "0.71.0"
},
{
"name": "pigments",
"version": "0.40.2"
},
{
"name": "platformio-ide-terminal",
"version": "2.8.4"
},
{
"name": "project-manager",
"version": "3.3.6"
},
{
"name": "python-yapf",
"version": "0.14.0"
},
{
"name": "qolor",
"version": "0.4.2"
},
{
"name": "regex-railroad-diagram",
"version": "0.19.4"
},
{
"name": "set-syntax",
"version": "0.4.0"
},
{
"name": "settings-view",
"version": "0.257.1"
},
{
"name": "snippets",
"version": "1.4.0"
},
{
"name": "solarized-dark-syntax",
"version": "1.2.0",
"theme": "syntax"
},
{
"name": "solarized-light-syntax",
"version": "1.2.0",
"theme": "syntax"
},
{
"name": "sort-lines",
"version": "0.18.0"
},
{
"name": "spell-check",
"version": "0.74.2"
},
{
"name": "split-diff",
"version": "1.5.3"
},
{
"name": "stata-exec",
"version": "1.8.6"
},
{
"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": "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.2"
},
{
"name": "tree-view-git-status",
"version": "1.5.2"
},
{
"name": "typewriter",
"version": "0.7.1"
},
{
"name": "update-package-dependencies",
"version": "0.13.1"
},
{
"name": "welcome",
"version": "0.36.7"
},
{
"name": "whitespace",
"version": "0.37.7"
},
{
"name": "wordcount",
"version": "3.0.0"
},
{
"name": "wrap-guide",
"version": "0.40.3"
}
]
{
"Hydrogen": {
"autoScroll": false,
"debug": true,
"languageMappings": "{\"bash\": \"shell script\", \"python\": \"magicpython\", \"javascript\": \"Flow JavaScript\", \"stata\": \"Stata Dyndoc (Markdown)\"}",
"startDir": "dirOfFile",
"startupCode": "{\"Python 3\": \"%matplotlib inline\\n%config InlineBackend.figure_format='svg'\"}"
},
"Zen": {
"gutter": true,
"minimap": true,
"tabs": "multiple",
"width": 130
},
"activate-power-mode": {
"particles": {
"colours": {
"type": "random"
}
},
"plugins": {
"playAudio": true,
"screenShake": true
}
},
"advanced-open-file": {
"createDirectories": true,
"createFileInstantly": true,
"fuzzyMatch": true
},
"aligner": {
"alignComments": true
},
"atom-alignment": {
"addSpacePostfix": true,
"alignBy": [
"=>",
":=",
":",
"=",
"\"",
"|",
"//",
"/",
"order"
],
"alignmentSpaceChars": [
"=>",
":="
]
},
"atom-beautify": {
"executables": {
"rscript": {
"path": "/usr/bin/Rscript"
}
},
"general": {},
"js": {
"brace_style": "collapse-preserve-inline",
"indent_size": 2
},
"markdown": {
"default_beautifier": "Remark"
},
"python": {
"default_beautifier": "yapf",
"formater": "yapf",
"max_line_length": 80,
"multi_line_output": "Grid"
},
"xml": {
"default_beautifier": "JS Beautify",
"wrap_attributes": "force"
}
},
"atom-clock": {
"dateFormat": "ddd MMM D YYYY h:mm A"
},
"atom-fuzzy-grep": {
"detectGitProjectAndUseGitGrep": false,
"grepCommandString": "rg -i -n -H --no-heading --column"
},
"atom-ide-ui": {
"atom-ide-code-format": {},
"atom-ide-diagnostics-ui": {},
"debugger-exceptionBreakpointsCollapsed": false,
"use": {
"atom-ide-busy-signal": "default",
"atom-ide-code-actions": "default",
"atom-ide-code-format": "default",
"atom-ide-code-highlight": "default",
"atom-ide-console": "default",
"atom-ide-datatip": "default",
"atom-ide-debugger": "default",
"atom-ide-definitions": "default",
"atom-ide-diagnostics": "default",
"atom-ide-diagnostics-ui": "default",
"atom-ide-find-references": "default",
"atom-ide-global": "default",
"atom-ide-outline-view": "default",
"atom-ide-signature-help": "default",
"atom-ide-terminal": "default",
"hyperclick": "default"
}
},
"atom-material-ui": {
"colors": {},
"tabs": {},
"ui": {
"panelContrast": true,
"panelShadows": true
}
},
"atom-shell-commands": {},
"atom-terminal": {},
"atom-typescript": {},
"autocomplete-bibtex": {
"references": [],
"resultTemplate": "\\cite{[key]}",
"scope": ".text.tex.latex,.source.gfm,.text.md"
},
"autocomplete-paths": {},
"autocomplete-plus": {
"backspaceTriggersAutocomplete": true,
"confirmCompletion": "tab always, enter when suggestion explicitly selected",
"consumeSuffix": false,
"minimumWordLength": 1,
"moveToCancel": true
},
"autocomplete-python": {
"showTooltips": true,
"useKite": false,
"useSnippets": "required"
},
"bracket-matcher": {},
"build-cmake": {},
"command-palette": {
"preserveLastSearch": true
},
"core": {
"autoHideMenuBar": true,
"closeDeletedFileTabs": true,
"customFileTypes": {
"source.ini": [
".hgrc"
]
},
"disabledPackages": [
"linter-flake8",
"highlight-line",
"language-gfm",
"minimap-cursorline",
"teletype",
"linter-shellcheck",
"regex-railroad-diagram",
"linter-ui-default",
"linter",
"markdown-preview",
"color-picker",
"typewriter",
"latexer",
"latex",
"language-liquid",
"markdown-table-formatter",
"linter-mypy",
"language-latex2e",
"welcome",
"indent-guide-improved",
"stata-exec",
"language-python",
"language-babel"
],
"excludeVcsIgnoredPaths": false,
"fileSystemWatcher": "experimental",
"ignoredNames": [
".git",
".hg",
".svn",
".DS_Store",
"._*",
"Thumbs.db",
"desktop.ini",
".ropeproject"
],
"packagesWithKeymapsDisabled": [
"platformio-ide-terminal",
"build",
"fuzzy-finder",
"markdown-preview-enhanced",
"markdown-writer",
"markdown-table-formatter"
],
"telemetryConsent": "no",
"themes": [
"atom-material-ui",
"atom-material-syntax"
],
"warnOnLargeFileLimit": 5
},
"docblockr": {},
"editor": {
"autoIndentOnPaste": false,
"fontFamily": "Fira Code, Menlo, Consolas, DejaVu Sans Mono, monospace",
"fontSize": 13,
"scrollPastEnd": true,
"softWrap": true,
"softWrapAtPreferredLineLength": true,
"softWrapHangingIndent": 4,
"tabLength": 4
},
"file-icons": {},
"find-and-replace": {
"autocompleteSearches": true,
"scrollToResultOnLiveSearch": true
},
"git-plus": {
"general": {},
"remoteInteractions": {}
},
"grammar-token-limit": {
"maxTokensPerLine": 150
},
"highlight-line": {
"underline": "dashed"
},
"highlight-selected": {
"hideHighlightOnSelectedWord": true
},
"hydrogen-launcher": {
"command": "zsh"
},
"hydrogen-python": {
"expandCode": true,
"expandCodeList": [
"else",
"elif",
"\\}",
"\\]",
"\\)",
"except",
"plt\\.(?!plot)",
"fnote"
]
},
"ide-java": {
"javaHome": "/home/kyle/local/java8"
},
"ide-python": {
"pylsPlugins": {
"autopep8": {
"enabled": false
},
"mccabe": {
"enabled": false
},
"pycodestyle": {
"enabled": false,
"ignore": [
""
],
"maxLineLength": 80
},
"pydocstyle": {},
"pyflakes": {},
"yapf": {
"enabled": true
}
}
},
"ide-typescript": {
"diagnosticsEnabled": false
},
"latex": {
"outputDirectory": "build/"
},
"linter": {},
"linter-flake8": {
"ignoreErrorCodes": [
"E221",
"E251"
]
},
"linter-mypy": {
"disallowAnyExpr": false,
"disallowAnyUnimported": false,
"disallowIncompleteDefs": false,
"disallowUntypedDefs": false,
"warnReturnAny": false
},
"linter-ui-default": {
"panelHeight": 300,
"showPanel": true
},
"markdown-preview-enhanced": {
"codeBlockTheme": "atom-material.css",
"enableTypographer": true,
"fileExtension": ".md, .mmark, .markdown, .pmd",
"openPreviewPaneAutomatically": false,
"usePandocParser": true
},
"markdown-preview-plus": {
"grammars": [
"source.gfm",
"source.litcoffee",
"text.html.basic",
"text.md",
"text.plain",
"text.plain.null-grammar",
"source.pweave.md"
],
"markdownItConfig": {
"breakOnSingleNewline": true,
"useLazyHeaders": false
},
"mathConfig": {
"enableLatexRenderingByDefault": true,
"latexRenderer": "HTML-CSS"
},
"pandocConfig": {
"pandocBibliography": true,
"pandocRemoveReferences": false,
"useNativePandocCodeStyles": true
},
"previewConfig": {
"activatePreviewWithEditor": true
},
"renderer": "pandoc",
"saveConfig": {
"saveToPDFOptions": {}
},
"syncConfig": {
"syncEditorOnPreviewScroll": true,
"syncPreviewOnChange": true,
"syncPreviewOnEditorScroll": true
},
"useGitHubStyle": true
},
"markdown-table-formatter": {
"formatOnSave": false,
"limitLastColumnPadding": true,
"markdownGrammarScopes": [
"source.gfm",
"text.md"
]
},
"markdown-writer": {
"fileExtension": ".md",
"relativeImagePath": true,
"siteEngine": "jekyll",
"siteImagesDir": "docs/src/img/",
"tableExtraPipes": true
},
"minimap": {
"adjustAbsoluteModeHeight": true,
"plugins": {
"bookmarks": true,
"bookmarksDecorationsZIndex": 0,
"cursorline": true,
"cursorlineDecorationsZIndex": 0,
"find-and-replace": true,
"find-and-replaceDecorationsZIndex": 0,
"git-diff": true,
"git-diffDecorationsZIndex": 0,
"highlight-selected": true,
"highlight-selectedDecorationsZIndex": 0,
"minimap-autohide": false,
"minimap-autohideDecorationsZIndex": 0,
"minimap-autohider": true,
"minimap-autohiderDecorationsZIndex": 0,
"pigments": true,
"pigmentsDecorationsZIndex": 0,
"selection": true,
"selectionDecorationsZIndex": 0,
"split-diff": true,
"split-diffDecorationsZIndex": 0
}
},
"minimap-autohider": {
"TimeToHide": 750
},
"package-generator": {},
"pdf-view": {
"fitToWidthOnOpen": true,
"paneToUseInSynctex": "right",
"reverseSyncBehaviour": "Double click"
},
"platformio-ide-terminal": {
"ansiColors": {
"normal": {
"black": "#252525",
"blue": "#40c4ff",
"cyan": "#18ffff",
"green": "#c3d82c",
"magenta": "#ff4081",
"red": "#ff5252",
"white": "#f5f5f5",
"yellow": "#ffd740"
}
},
"core": {
"mapTerminalsTo": "File"
},
"customTexts": {},
"style": {
"defaultPanelHeight": "15%"
},
"toggles": {
"autoClose": true
}
},
"project-manager": {
"savePathsRelativeToHome": true,
"sortBy": "last modified"
},
"python-indent": {},
"regex-railroad-diagram": {
"enabled": false
},
"script": {
"cwdBehavior": "Directory of the script"
},
"spell-check": {
"addKnownWords": true,
"excludedScopes": [
".code.md",
".python",
".markup.md",
"embedded"
],
"grammars": [
"text.tex.latex",
"text.md",
"source.asciidoc",
"source.gfm",
"text.git-commit",
"text.plain",
"text.plain.null-grammar"
]
},
"split-diff": {
"ignoreWhitespace": true,
"leftEditorColor": "red",
"rightEditorColor": "green"
},
"stata-exec": {},
"sync-settings": {
"blacklistedKeys": [
"Hydrogen.gateways",
"atom-gmail",
"exception-reporting",
"sync-settings.gistId",
"sync-settings.personalAcessToken",
"spell-check.knownWords"
],
"quietUpdateCheck": true
},
"tabs": {
"enableMruTabSwitching": false,
"enableVcsColoring": true
},
"tree-view": {
"hideIgnoredNames": true
},
"typewriter": {
"showGutter": true,
"showScrollbar": true
},
"welcome": {
"showOnStartup": false
},
"whitespace": {
"ensureSingleTrailingNewline": 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
'.source.python':
'pytestmarkparametrize':
'prefix': 'pytestmarkparametrize'
'body': '@pytest.mark.parametrize($1)'
'longtext':
'prefix': 'longtext'
'body': 'f"""\\\\\n $1\n """'
'header':
'prefix': 'header'
'body':
"""#! /usr/bin/env python3
\"\"\"
---------------------------------------------------------------------
Project: ${1:Project Name}
Program: ${2:01process}.py
Author: Kyle Barron <barronk@mit.edu>
Created: ${3:ctrl-shift-alt-T}
Updated: ${3:ctrl-shift-alt-T}
Purpose: ${4:Process data}
Depends: data/${5:base}
${6:dataset.csv}
Outputs: data/${7:final}
${8:final.feather}
\"\"\"
$9"""
'.source.shell':
'header':
'prefix': 'header'
'body':
"""#! /usr/bin/env bash
# Project: ${1:Project Name}
# Program: ${2:01process}.sh
# Author: Kyle Barron <barronk@mit.edu>
# Created: ${3:ctrl-shift-alt-T}
# Purpose: ${4:Process data}
# Depends: data/${5:base}
# Outputs: data/${6:final}
$7"""
'.source.stata':
'docstring':
'prefix': 'docstring'
'body':
'''/* """$1
""" */
'''
'do file header':
'prefix': 'header'
'body':
"""/* \"\"\"
- Project: ${1:Project Name}
- Program: `${2:01process}.do`
- Author: Kyle Barron <barronk@mit.edu>
- Created: ${3:ctrl-shift-alt-T}
- Updated: ${3:ctrl-shift-alt-T}
- Purpose: ${4:Process data into clean .dta files}
- Depends:
```
data/${5:base}
${6:dataset.dta}
```
- Outputs:
```
data/${7:final}
${8:final.dta}
```
\"\"\" */
* Stata start-up options
* ----------------------
version 14
clear all
set more off
set varabbrev off
capture log close _all
qui do "00preamble.do"
* Main program wrapper
* --------------------
cap program drop main
program main
/* \"\"\"Main program
This is the only program called directly. It runs the rest of the file in
the correct order.
\"\"\" */
syntax, [CAPture NOIsily email]
* Set up
* ------
local progname "${1:Project Name}/dofiles/${2:01process}"
local start_time "$S_TIME $S_DATE"
di "Start: `start_time'"
* Run the things
* --------------
`capture' `noisily' {
program_name
}
local rc = _rc
* If requested, notify via e-mail
* -------------------------------
if ("`email'" != "") {
mail_notify, rc(`rc') ///
email("`c(username)'@mit.edu") ///
progname(`progname') ///
start_time(`start_time') `capture'
}
exit `rc'
end
$9"""
'main program definition':
'prefix': 'main'
'body':
"""* Main program wrapper
* --------------------
program main
syntax, [CAPture NOIsily email]
* Set up
* ------
local progname ${1:project/dofiles/01process}
local start_time "$S_TIME $S_DATE"
di "Start: `start_time'"
* Run the things
* --------------
`capture' `noisily' {
program_name
}
local rc = _rc
* If requested, notify via e-mail
* -------------------------------
if ("`email'" != "") {
mail_notify, rc(`rc') ///
email("`c(username)'@mit.edu") ///
progname(`progname') ///
start_time(`start_time') `capture'
}
exit `rc'
end
$2"""
'.source.r':
'header':
'prefix': 'header'
'body':
"""#! /usr/bin/env Rscript
#' @Project: ${1:Project Name}
#' @Program: ${2:01process}.R
#' @Author: Kyle Barron <barronk@mit.edu>
#' @Created: ${3:ctrl-shift-alt-T}
#' @Updated: ${3:ctrl-shift-alt-T}
#' @Purpose: ${4:Process data into clean .feather files}
#' @Depends: ${5:data/base}
#' ${6:dataset.feather}
#' @Outputs: ${7:data/final}
#' ${8:final.feather}
$9"""
'.text.md':
'keys':
'prefix': 'kbd'
'body': '<kbd>$1</kbd>$2'
'event':
'prefix': 'event'
'body':
"""**Event: ${1:Event description}**
Date: ${2: ctrl-shift-alt-T}
Note: $3
"""
'people-call':
'prefix': 'people'
'body':
"""${1:Person Name}
email: $2
institution: $3
role: $4
notes: $5
$6
"""
'.source.pweave.md':
'block':
'prefix': 'block'
'body': '```python, name=\'$1\'\n$2\n```'
'inline':
'prefix': 'inline'
'body': '<% $1 %>$2'
'inline2':
'prefix': '<%'
'body': '<% $1 %>$2'
atom-text-editor.editor .syntax--source.syntax--coffee {
-webkit-font-feature-settings: "liga" off, "calt" off;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.