Skip to content

Instantly share code, notes, and snippets.

@vincentmorneau
Last active May 4, 2018 13:57
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 vincentmorneau/e6f335a2ef4108c18d2c to your computer and use it in GitHub Desktop.
Save vincentmorneau/e6f335a2ef4108c18d2c 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',
'user:semicolonize', ->
editor = @getModel()
editor.moveToEndOfLine()
editor.insertText(";", {'.autoIndentNewline': true})
#
atom.commands.add 'atom-text-editor',
'user:semicolonizeLF', ->
editor = @getModel()
editor.moveToEndOfLine()
editor.insertText(";", {'.autoIndentNewline': true})
editor.insertNewline()
# 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.
#
# 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:
# * https://atom.io/docs/latest/using-atom-basic-customization#customizing-key-bindings
# * https://atom.io/docs/latest/behind-atom-keymaps-in-depth
#
# This file uses CoffeeScript Object Notation (CSON).
# If you are unfamiliar with CSON, you can read more about it here:
# https://github.com/bevry/cson#what-is-cson
'atom-workspace atom-text-editor:not([mini])':
'ctrl-alt-[': 'native!'
'ctrl-alt-]': 'native!'
'.workspace .editor:not(.mini)':
'alt-up': 'editor:add-selection-above'
'alt-down': 'editor:add-selection-below'
'atom-workspace atom-text-editor':
'ctrl-backspace': 'editor:delete-to-previous-word-boundary'
'ctrl-delete': 'editor:delete-to-next-word-boundary'
'atom-text-editor':
'ctrl-alt-/': 'block-comment:toggle'
'ctrl-;': 'user:semicolonize'
'ctrl-alt-;': 'user:semicolonizeLF'
'ctrl-alt-shift-b': 'atom-beautify:beautify-editor'
'body':
'ctrl-tab ^ctrl': 'unset!'
'ctrl-tab': 'pane:show-next-item'
'ctrl-shift-tab ^ctrl': 'unset!'
'ctrl-shift-tab': 'pane:show-previous-item'
'atom-workspace, atom-workspace atom-text-editor':
'alt-shift-m': 'markdown-preview:toggle'
'.platform-win32 .editor':
'alt-l': 'editor:split-selections-into-lines'
[
{
"name": "about",
"version": "1.8.1"
},
{
"name": "archive-view",
"version": "0.64.3"
},
{
"name": "atom-beautify",
"version": "0.32.2"
},
{
"name": "atom-dark-syntax",
"version": "0.29.0",
"theme": "syntax"
},
{
"name": "atom-dark-ui",
"version": "0.53.2",
"theme": "ui"
},
{
"name": "atom-light-syntax",
"version": "0.29.0",
"theme": "syntax"
},
{
"name": "atom-light-ui",
"version": "0.46.2",
"theme": "ui"
},
{
"name": "atom-runner",
"version": "2.7.1"
},
{
"name": "autocomplete-atom-api",
"version": "0.10.7"
},
{
"name": "autocomplete-css",
"version": "0.17.5"
},
{
"name": "autocomplete-html",
"version": "0.8.4"
},
{
"name": "autocomplete-oracle",
"version": "1.4.4"
},
{
"name": "autocomplete-plus",
"version": "2.40.6"
},
{
"name": "autocomplete-snippets",
"version": "1.12.0"
},
{
"name": "autoflow",
"version": "0.29.3"
},
{
"name": "autosave",
"version": "0.24.6"
},
{
"name": "background-tips",
"version": "0.28.0"
},
{
"name": "base16-tomorrow-dark-theme",
"version": "1.5.0",
"theme": "syntax"
},
{
"name": "base16-tomorrow-light-theme",
"version": "1.5.0",
"theme": "syntax"
},
{
"name": "block-comment",
"version": "0.4.3"
},
{
"name": "bookmarks",
"version": "0.45.1"
},
{
"name": "bracket-matcher",
"version": "0.89.2"
},
{
"name": "build",
"version": "0.70.0"
},
{
"name": "build-oracle",
"version": "1.6.1"
},
{
"name": "busy",
"version": "0.7.0"
},
{
"name": "busy-signal",
"version": "1.4.3"
},
{
"name": "color-picker",
"version": "2.3.0"
},
{
"name": "command-palette",
"version": "0.43.5"
},
{
"name": "copy-as-rtf",
"version": "0.9.3"
},
{
"name": "dalek",
"version": "0.2.2"
},
{
"name": "dash",
"version": "1.7.1"
},
{
"name": "deprecation-cop",
"version": "0.56.9"
},
{
"name": "dev-live-reload",
"version": "0.48.1"
},
{
"name": "editorconfig",
"version": "2.2.2"
},
{
"name": "encoding-selector",
"version": "0.23.8"
},
{
"name": "exception-reporting",
"version": "0.43.1"
},
{
"name": "file-icons",
"version": "2.1.19"
},
{
"name": "file-types",
"version": "0.5.5"
},
{
"name": "find-and-replace",
"version": "0.215.9"
},
{
"name": "fuzzy-finder",
"version": "1.8.1"
},
{
"name": "git-diff",
"version": "1.3.9"
},
{
"name": "github",
"version": "0.14.2"
},
{
"name": "go-to-line",
"version": "0.33.0"
},
{
"name": "grammar-selector",
"version": "0.50.1"
},
{
"name": "highlight-selected",
"version": "0.13.1"
},
{
"name": "image-view",
"version": "0.62.4"
},
{
"name": "incompatible-packages",
"version": "0.27.3"
},
{
"name": "keybinding-resolver",
"version": "0.38.1"
},
{
"name": "language-c",
"version": "0.59.3"
},
{
"name": "language-clojure",
"version": "0.22.7"
},
{
"name": "language-coffee-script",
"version": "0.49.3"
},
{
"name": "language-csharp",
"version": "1.0.1"
},
{
"name": "language-css",
"version": "0.42.10"
},
{
"name": "language-gfm",
"version": "0.90.3"
},
{
"name": "language-git",
"version": "0.19.1"
},
{
"name": "language-go",
"version": "0.45.3"
},
{
"name": "language-html",
"version": "0.49.0"
},
{
"name": "language-hyperlink",
"version": "0.16.3"
},
{
"name": "language-java",
"version": "0.29.0"
},
{
"name": "language-javascript",
"version": "0.128.5"
},
{
"name": "language-json",
"version": "0.19.1"
},
{
"name": "language-less",
"version": "0.34.2"
},
{
"name": "language-make",
"version": "0.22.3"
},
{
"name": "language-mustache",
"version": "0.14.5"
},
{
"name": "language-objective-c",
"version": "0.15.1"
},
{
"name": "language-oracle",
"version": "1.9.0"
},
{
"name": "language-perl",
"version": "0.38.1"
},
{
"name": "language-php",
"version": "0.43.2"
},
{
"name": "language-property-list",
"version": "0.9.1"
},
{
"name": "language-python",
"version": "0.49.5"
},
{
"name": "language-ruby",
"version": "0.71.4"
},
{
"name": "language-ruby-on-rails",
"version": "0.25.3"
},
{
"name": "language-sass",
"version": "0.61.4"
},
{
"name": "language-shellscript",
"version": "0.26.3"
},
{
"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.3.3"
},
{
"name": "language-xml",
"version": "0.35.2"
},
{
"name": "language-yaml",
"version": "0.32.0"
},
{
"name": "line-ending-selector",
"version": "0.7.6"
},
{
"name": "link",
"version": "0.31.4"
},
{
"name": "markdown-preview",
"version": "0.159.20"
},
{
"name": "metrics",
"version": "1.2.6"
},
{
"name": "minimap",
"version": "4.29.8"
},
{
"name": "monokai",
"version": "0.24.0",
"theme": "syntax"
},
{
"name": "notifications",
"version": "0.70.5"
},
{
"name": "one-dark-syntax",
"version": "1.8.2",
"theme": "syntax"
},
{
"name": "one-dark-ui",
"version": "1.12.1",
"theme": "ui"
},
{
"name": "one-light-syntax",
"version": "1.8.2",
"theme": "syntax"
},
{
"name": "one-light-ui",
"version": "1.12.1",
"theme": "ui"
},
{
"name": "open-on-github",
"version": "1.3.1"
},
{
"name": "package-generator",
"version": "1.3.0"
},
{
"name": "pigments",
"version": "0.40.2"
},
{
"name": "script",
"version": "3.17.3"
},
{
"name": "settings-view",
"version": "0.254.2"
},
{
"name": "snippets",
"version": "1.3.3"
},
{
"name": "solarized-dark-syntax",
"version": "1.1.4",
"theme": "syntax"
},
{
"name": "solarized-light-syntax",
"version": "1.1.4",
"theme": "syntax"
},
{
"name": "spell-check",
"version": "0.73.4"
},
{
"name": "status-bar",
"version": "1.8.15"
},
{
"name": "styleguide",
"version": "0.49.11"
},
{
"name": "symbols-view",
"version": "0.118.2"
},
{
"name": "sync-settings",
"version": "0.8.6"
},
{
"name": "tabs",
"version": "0.109.1"
},
{
"name": "tabs-to-spaces",
"version": "1.0.5"
},
{
"name": "text-pastry",
"version": "0.6.1"
},
{
"name": "timecop",
"version": "0.36.2"
},
{
"name": "tree-view",
"version": "0.222.0"
},
{
"name": "update-package-dependencies",
"version": "0.13.1"
},
{
"name": "welcome",
"version": "0.36.6"
},
{
"name": "whitespace",
"version": "0.37.5"
},
{
"name": "wrap-guide",
"version": "0.40.3"
}
]
{
"activate-power-mode": {
"autoToggle": false,
"particles": {
"colours": {
"type": "random"
}
}
},
"atom-beautify": {
"general": {
"_analyticsUserId": "97bd912c-051e-4ddf-808b-38abef13a61f"
},
"js": {
"indent_with_tabs": true
},
"json": {
"indent_with_tabs": true
}
},
"atom-runner": {
"paneSplitDirection": "Down"
},
"build": {
"panelVisibility": "Keep Visible",
"saveOnBuild": true
},
"build-oracle": {
"sqlPath": "sql"
},
"copy-as-rtf": {
"fontface": "Consolas",
"fontsize": 18,
"style": "monokai"
},
"core": {
"autoHideMenuBar": true,
"closeDeletedFileTabs": true,
"disabledPackages": [
"whitespace"
],
"openEmptyEditorOnStart": false,
"packagesWithKeymapsDisabled": [],
"telemetryConsent": "limited"
},
"editor": {
"nonWordCharacters": "/\\()\"':,.;<>~!@#$%^&*|+=[]{}`?…",
"scrollSensitivity": 200,
"showIndentGuide": true,
"showInvisibles": true,
"softTabs": false,
"softWrap": true
},
"exception-reporting": {
"userId": "61ac1c76-9993-36fe-3f64-a4196a2e60e9"
},
"firacode": {},
"fonts": {
"fontFamily": "Fira Mono"
},
"git-diff": {
"showIconsInEditorGutter": true
},
"git-plus": {
"general": {
"_analyticsUserId": "0c4f0a45-af30-44c6-9e52-b6de472dd116"
}
},
"hidpi": {
"cutoffHeight": 1600
},
"line-ending-selector": {
"defaultLineEnding": "LF"
},
"markdown-preview": {
"useGitHubStyle": true
},
"minimap": {
"plugins": {
"highlight-selected": true,
"highlight-selectedDecorationsZIndex": 0
}
},
"seti-ui": {
"compactView": true
},
"split-diff": {
"ignoreWhitespace": true
},
"sync-settings": {},
"teletype": {},
"welcome": {
"showOnStartup": false
},
"whitespace": {}
}
# 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'
#
# This file uses CoffeeScript Object Notation (CSON).
# If you are unfamiliar with CSON, you can read more about it here:
# https://github.com/bevry/cson#what-is-cson
".source.shell":
"concat-md":
prefix: "concat-md"
body: """
copy *.md $1.md
"""
"document.body.contentEditable":
prefix: "document.body.contentEditable"
body: """
document.body.contentEditable=true
"""
"sqlcl-username":
prefix: "sqlcl-username"
body: """
C:\oracle\sqlcl-4.2.0.16.175.1027-no-jre\sqlcl\bin\sql
longueuil_vd@//einstein:1521/dev115
"""
".source.scss":
"theme-roller-groups":
prefix: "theme-roller-groups"
body: """
/*
{
"translate": false,
"groups": [{
"name": "Webinar",
"common": true,
"sequence": 0
}]
}
*/
"""
"theme-roller-color":
prefix: "theme-roller-color"
body: """
/*
{
"var" : "@$1",
"name" : "$2",
"type" : "color",
"group": "$3"
}
*/
"""
"theme-roller-number":
prefix: "theme-roller-number"
body: """
/*
{
"var" : "@$1",
"name" : "$2",
"type" : "number",
"units": "rem",
"range": {
"min": 0,
"max": 5,
"increment": 1
},
"group": "Fonts"
}
*/
"""
".source.js":
"map-get-join":
prefix: "map-get-join"
body: """
$(selector)
.map(function() {
if ($(this).val())
return $(this).val();
})
.get()
.join(":")
"""
"TODO VMORNEAU":
prefix: "TODO VMORNEAU"
body: """// TODO VMORNEAU: $1"""
"namespacing":
prefix: "namespacing"
body: """/**
* @namespace
**/
ejcSearch = {};
(function( ejcSearch, $, undefined ) {
ejcSearch.mod1 = {
foo: function(p1, p2){
...
}// foo
};
})( ejcSearch, apex.jQuery);"""
"this.browserEvent.which":
prefix: "this.browserEvent.which"
body: """this.browserEvent.which === 13"""
"this.triggeringElement":
prefix: "this.triggeringElement"
body: """this.triggeringElement"""
"apex.item.getValue()":
prefix: "apex.item.getValue()"
body: """apex.item("$1").getValue()"""
"apex.item.setValue()":
prefix: "apex.item.getValue()"
body: """apex.item("$1").setValue($2)"""
"apex-server-process":
prefix: "apex-server-process"
body: """
apex.server.process(
"$1",
{
x01: "test",
pageItems: "#P1_DEPTNO,#P1_EMPNO"
}, {
success: function(data) {
$2
}
}
);
"""
".source.sql":
"logger_logs_5_min":
prefix: "logger_logs_5_min"
body: """
select *
from logger_logs_5_min
order by 1 desc;
"""
"logger_logs_5_min_scope":
prefix: "logger_logs_5_min_scope"
body: """
select *
from logger_logs_5_min
where scope like '%$1%'
order by 1 desc;
"""
"*":
"concat-strings":
prefix: "concat"
body: """' || $1 || '"""
".source.plsql.oracle":
"javadoc-comments":
prefix: "javadoc-comments"
body: """
/**
* $2
*
* @issue
*
* @author Vincent Morneau
* @created $1
*
* @param p_param1_todo type_param_1
* @return
*/
"""
"join-session":
prefix: "join-session"
body: """
begin
oos_util_apex.join_session (
p_session_id => $2
, p_app_id => $1
);
end;
"""
"nvl2":
prefix: "nvl2"
body: """nvl2(string1, value_if_not_null, value_if_null)"""
"TODO VMORNEAU":
prefix: "TODO VMORNEAU"
body: """-- TODO VMORNEAU: $1"""
"row_number":
prefix: "row_number"
body: """row_number() over (partition by $1 order by $2)"""
"instr":
prefix: "instr"
body: """instr('tech on the net', 'e')"""
"listagg":
prefix: "listagg"
body: """listagg($1, ':') within group (order by $1)"""
"trigger_biu":
prefix: "trigger_biu"
body: """
create or replace trigger $1_bi_trg
before insert or update on $1
for each row
begin
if inserting then
:new.$2 := $1_seq.nextval;
end if;
:new.created_by := nvl(apex_application.g_user, user);
:new.created_on := sysdate;
:new.last_updated_by := nvl(apex_application.g_user, user);
:new.last_updated_on := sysdate;
end;
/
"""
"logger-package":
prefix: "logger-package"
body: """
create or replace package $1
is
$2
end $1;
create or replace package body $1
as
/**
* @constant gc_scope_prefix Logger's scope
*/
gc_scope_prefix constant varchar2(31) := lower($$plsql_unit) || '.';
$2
end $1;
"""
"logger-proc":
prefix: "logger-proc"
body: """
/**
* $3
*
* @issue
*
* @author Vincent Morneau
* @created $2
*
* @param p_param1_todo type_param_1
* @param p_param2_todo type_param_2
*/
procedure $1 (
p_param1_todo in varchar2
, p_param2_todo in varchar2
) as
l_scope logger_logs.scope%type := gc_scope_prefix || '$1';
l_params logger.tab_param;
begin
logger.append_param(l_params, 'p_param1_todo', p_param1_todo);
logger.append_param(l_params, 'p_param2_todo', p_param2_todo);
logger.log('START', l_scope, null, l_params);
-- All calls to logger should pass in the scope
-- procedure body
$4
logger.log('END', l_scope);
exception
when others then
logger.log_error('Unhandled Exception', l_scope, null, l_params);
raise;
end $1;
"""
"logger-func":
prefix: "logger-func"
body: """
/**
* $3
*
* @issue
*
* @author Vincent Morneau
* @created $2
*
* @param p_param1_todo type_param_1
* @return $4
*/
function $1 (
p_param1_todo in varchar2
) return $4 as
l_scope logger_logs.scope%type := gc_scope_prefix || '$1';
l_params logger.tab_param;
begin
logger.append_param(l_params, 'p_param1_todo', p_param1_todo);
logger.log('START', l_scope, null, l_params);
-- All calls to logger should pass in the scope
-- function body
$5
logger.log('END', l_scope);
return null;
exception
when others then
logger.log_error('Unhandled Exception', l_scope, null, l_params);
raise;
end $1;
"""
"logger-apex-page-block":
prefix: "logger-apex-page-block"
body: """
declare
l_scope logger_logs.scope%type := 'apex app ' || :APP_ID || ' page ' || :APP_PAGE_ID || ': $1';
l_params logger.tab_param;
begin
logger.log('START', l_scope, null);
$2
logger.log('END', l_scope);
exception
when others then
logger.log_error('Unhandled Exception', l_scope, null, l_params);
raise;
end;
"""
"logger-apex-ajax":
prefix: "logger-apex-ajax"
body: """
declare
l_scope logger_logs.scope%type := 'ajax: $1';
l_params logger.tab_param;
begin
logger.append_param(l_params, 'apex_application.g_x01', apex_application.g_x01);
logger.log('START', l_scope, null, l_params);
$2
logger.log('END', l_scope);
apex_json.open_object;
apex_json.write('success', true);
-- more
apex_json.close_object;
exception
when others then
logger.log_error('Unhandled Exception', l_scope, null, l_params);
apex_json.open_object;
apex_json.write('success', false);
apex_json.write('message', sqlerrm);
apex_json.close_object;
end;
"""
"simulate-apex-session":
prefix: "simulate-apex-session"
body: """
declare
l_workspace_id apex_workspaces.workspace_id%type;
begin
select workspace_id
into l_workspace_id
from apex_workspaces
where upper(workspace) = upper('$1');
-- Set Workspace ID
apex_util.set_security_group_id(l_workspace_id);
-- Set Application ID
apex_application.g_flow_id := $2;
-- Set Session ID
apex_application.g_instance := $3;
end;
"""
"apex-plugin-region":
prefix: "apex-plugin-region"
body: """
function render (
p_region in apex_plugin.t_region
, p_plugin in apex_plugin.t_plugin
, p_is_printer_friendly in boolean
) return apex_plugin.t_region_render_result as
subtype plugin_attr is varchar2(32767);
/* Global variables */
l_result apex_plugin.t_region_render_result;
/* t_plugin Attributes */
l_plugin_attribute_01 plugin_attr := p_plugin.attribute_01;
l_plugin_attribute_02 plugin_attr := p_plugin.attribute_02;
/* t_region Attributes */
l_region_attribute_01 plugin_attr := p_region.attribute_01;
l_region_attribute_02 plugin_attr := p_region.attribute_02;
begin
/* debug information will be included */
if apex_application.g_debug then
apex_plugin_util.debug_region (
p_plugin => p_plugin
, p_region => p_region
, p_is_printer_friendly => p_is_printer_friendly
);
end if;
sys.htp.p(null);
return l_result;
end render;
"""
/*
* 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
*/
// Additional Style for Handlebars
atom-text-editor.editor span.syntax--meta.syntax--tag.syntax--template.syntax--mustache span {
color: #ff982d!important;
}
atom-text-editor {
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
font-family: "Operator Mono";
font-weight: 500;
line-height: 1.7;
}
atom-text-editor.editor {
.syntax--storage.syntax--type.syntax--function.syntax--arrow,
.syntax--keyword.syntax--operator:not(.accessor),
.syntax--punctuation.syntax--definition {
font-family: "Fira Code";
}
.syntax--string.syntax--quoted,
.syntax--string.syntax--regexp {
-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