GithubHelp home page GithubHelp logo

idleberg / atom-atomizr Goto Github PK

View Code? Open in Web Editor NEW
13.0 4.0 1.0 732 KB

Converts snippets for Atom, Sublime Text, TextMate, and Visual Studio Code

License: MIT License

CoffeeScript 94.38% JavaScript 5.62%

atom-atomizr's Introduction

Atomizr for Atom

apm apm apm Travis David

Converts snippets for Atom, Sublime Text, TextMate, and Visual Studio Code

Also available for Sublime Text and the command line (see the comparison chart).

Installation

Install atomizr from Atom's Package Manager or the command-line equivalent:

$ apm install atomizr

Using Git

Change to your Atom packages directory:

# Windows
$ cd %USERPROFILE%\.atom\packages

# Linux & macOS
$ cd ~/.atom/packages/

Clone the repository as atomizr:

$ git clone https://github.com/idleberg/atom-atomizr atomizr

Inside the cloned directory, install Node dependencies:

$ yarn || npm install

Usage

This plugin works on active views only, so start by opening a Sublime Text completion or an Atom snippet.

There are several commands available to start conversion, each available from the Command Palette and the Packages menu.

Action Input Output
Automatic conversion¹ CSON, JSON, XML CSON, JSON, XML
Convert Atom to Sublime Text CSON, JSON JSON
Convert Atom to TextMate CSON, JSON Plist
Convert Atom to Visual Studio Code CSON, JSON JSON
Convert Sublime Text to Atom² JSON, XML CSON, JSON
Convert Sublime Text to TextMate JSON, XML Plist
Convert Sublime Text to Visual Studio Code JSON, XML JSON
Convert TextMate to Atom² Plist CSON, JSON
Convert TextMate to Sublime Text Plist JSON
Convert TextMate to Visual Studio Code Plist JSON
Convert Visual Studio Code to Atom² JSON CSON, JSON
Convert Visual Studio Code to Sublime Text JSON JSON
Convert Visual Studio Code to TextMate JSON Plist
Toggle Atom format CSON, JSON JSON, CSON
Toggle Sublime Text format JSON, XML XML, JSON

¹⁾ converts Atom and Sublime Text only
²⁾ target syntax can be specified in the settings

Keyboard Shortcuts

The following examples use the macOS keyboard shortcuts. On Linux or Windows use Ctrl+Alt as modifier key instead of Ctrl.

Memorizing the keyboard shortcuts for conversion is easy. Just think of the A key for Atom, the S key for Sublime Text, the T key for TextMate, and the V key for Visual Studio Code:

Action Mnemonic Shortcut
Atom to Sublime Text “A to S” Ctrl+A, Ctrl+S
Atom to TextMate “A to T” Ctrl+A, Ctrl+T
Atom to Visual Studio Code “A to V” Ctrl+A, Ctrl+V
Sublime Text to Atom “S to A” Ctrl+S, Ctrl+A
Sublime Text to TextMate “S to T” Ctrl+S, Ctrl+T
Sublime Text to Visual Studio Code “S to V” Ctrl+S, Ctrl+V
Visual Studio Code to Atom “V to A” Ctrl+V, Ctrl+A
Visual Studio Code to Sublime Text “V to S” Ctrl+V, Ctrl+S
Visual Studio Code to TextMate “V to T” Ctrl+V, Ctrl+T
TextMate to Atom “T to A” Ctrl+T, Ctrl+A
TextMate to Sublime Text “T to S” Ctrl+T, Ctrl+S
TextMate to Visual Studio Code “T to V” Ctrl+T, Ctrl+V
Atom to Atom “A to A” Ctrl+A, Ctrl+A
Sublime Text to Sublime Text “S to S” Ctrl+S, Ctrl+S

For automatic conversion, press Ctrl+C twice.

Grammar

To ensure automatic conversion to work more reliably, this package installs grammar for a variety of Sublime Text files. As a side effect, these files get proper syntax highlighting.

License

This work is licensed under the The MIT License.

atom-atomizr's People

Contributors

dependabot[bot] avatar idleberg avatar jtbrinkmann avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

dirkakrid

atom-atomizr's Issues

Uncaught Callback must be a function

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.44.0-nightly2 x64
Electron: 4.2.7
OS: Microsoft Windows 10 Enterprise
Thrown From: atomizr package 0.23.2

Stack Trace

Uncaught Callback must be a function

At fs.js:137

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
    at makeCallback (fs.js:137:11)
    at Object.rename (fs.js:571:14)
    at Object.renameFile (/packages/atomizr/lib/atomizr.coffee:613:10)
    at Object.atomToVsCode (/packages/atomizr/lib/atomizr.coffee:172:8)
    at /packages/atomizr/lib/atomizr.coffee:68:110)
    at CommandRegistry.handleCommandEvent (~/AppData/Local/atom-nightly/app-1.44.0-nightly2/resources/app/static/<embedded>:11:349290)
    at Object.didConfirmSelection (~/AppData/Local/atom-nightly/app-1.44.0-nightly2/resources/app/static/<embedded>:11:699460)
    at SelectListView.confirmSelection (~/AppData/Local/atom-nightly/app-1.44.0-nightly2/resources/app/static/<embedded>:11:874849)
    at SelectListView.didClickItem (~/AppData/Local/atom-nightly/app-1.44.0-nightly2/resources/app/static/<embedded>:11:872791)
    at ListItemView.onclick (~/AppData/Local/atom-nightly/app-1.44.0-nightly2/resources/app/static/<embedded>:11:871781)
    at ListItemView.didClick (~/AppData/Local/atom-nightly/app-1.44.0-nightly2/resources/app/static/<embedded>:11:875869)

Commands

     -1:26 command-palette:toggle (input.hidden-input)
     -1:20.4.0 core:select-all (input.hidden-input)
     -1:09.6.0 atomizr:convert-atom-to-visual-studio-code (input.hidden-input)
     -1:03.1.0 intentions:highlight (input.hidden-input)
     -1:02.9.0 core:undo (input.hidden-input)
     -0:54.2.0 tree-view:remove (span.name.icon.json-icon.medium-cyan)
     -0:43.7.0 tree-view:copy (span.name.icon.database-icon.medium-maroon)
     -0:41.4.0 tree-view:paste (span.name.icon.icon-file-directory)
     -0:38.9.0 intentions:highlight (input.hidden-input)
     -0:38.8.0 command-palette:toggle (input.hidden-input)
     -0:35.5.0 atomizr:convert-atom-to-sublime-text (input.hidden-input)
     -0:18.5.0 intentions:highlight (input.hidden-input)
     -0:18.4.0 core:undo (input.hidden-input)
     -0:16.3.0 intentions:highlight (input.hidden-input)
     -0:15.9.0 command-palette:toggle (input.hidden-input)
     -0:08.5.0 atomizr:convert-atom-to-visual-studio-code (input.hidden-input)

Non-Core Packages

ascii-hex 0.2.0 
atom-beautify 0.33.4 
atom-commander 0.12.0 
atom-console 0.4.6 
atom-ide-ui 0.13.0 
atom-material-syntax 1.0.8 
atom-material-ui 2.1.3 
atom-reverser 3.0.4 
atom-typescript 13.4.4 
atomizr 0.23.2 
auto-fold 0.4.0 
autocomplete 0.47.0 
autocomplete-clang 0.12.1 
autocomplete-en-en 0.2.0 
autocomplete-paths 2.12.2 
build 0.70.0 
busy-signal 2.0.1 
colorful-json 1.1.0 
column-select 1.0.1 
cson-parser 0.1.0 
document-outline 2.1.2 
file-icons 2.1.37 
find-trailing-whitespace 0.1.0 
fold-lines 0.2.2 
git-plus 8.7.1 
git-time-machine 2.1.0 
hey-pane 1.2.0 
highlight-selected 0.16.0 
Hydrogen 2.13.1 
ide-c-cpp 0.1.0 
ide-json 0.2.1 
ide-typescript 0.9.1 
indent-detective 0.4.0 
ink 0.11.7 
intentions 1.1.5 
js2coffee 0.19.1 
json-converter 0.2.4 
julia-client 0.11.3 
juno-plus 0.7.1 
language-ini 1.23.0 
language-julia 0.19.2 
language-matlab 0.2.1 
language-pfm 0.82.0 
language-weave 0.6.5 
latex-completions 0.3.6 
less-than-slash 0.19.0 
linter 2.3.1 
linter-clang 4.1.2 
linter-coffeelint 2.0.28 
linter-cpplint 2.1.0 
linter-eslint 8.5.5 
linter-gcc 0.9.0 
linter-gcc2 0.8.8 
linter-htmlhint 1.6.3 
linter-js-yaml 1.4.6 
linter-julia 0.8.3 
linter-shellcheck 1.6.0 
linter-tslint 1.10.37 
linter-ui-default 1.8.0 
markdown-writer 2.11.9 
open-in-github-app 0.2.6 
open-recent 5.0.0 
pdf-view 0.72.0 
platformio-ide 2.6.0 
platformio-ide-debugger 1.2.6 
platformio-ide-terminal 2.10.0 
preview 0.19.0 
preview-inline 1.5.1 
project-manager 3.3.8 
script 3.25.0 
snippet-generator-plus 0.1.2 
split-diff 1.6.1 
string-encoder 0.2.0 
Sublime-Style-Column-Selection 1.7.5 
sync-settings 0.8.6 
teletype 0.13.4 
tool-bar 1.2.0 
turbo-javascript 1.4.0 
uber-juno 0.3.0 

Can't convert Sublime Text YAML to Atom

I'm trying to convert a .sublime-syntax file to Atom and it just says This doesn't seem to be a valid Sublime Text file. Aborting.. What am I doing wrong?

the default shortcut of your plugin conflict with the default shortcut of windows

in windows, these shortcut have different meaning, it conflict with your shortcut, you may consider to change it from Ctrl to Ctrl+Alt+Shift , thanks!

Memorizing the keyboard shortcuts for conversion is easy. Just think of the s key for Sublime Text and the a key for Atom:

Sublime Text to Atom: Ctrl+s, Ctrl+a (for completions)
Atom to Sublime Text: hold Ctrl+a, Ctrl+s
For automatic conversion, press Ctrl+c twice. To switch the Atom snippet from CSON to JSON (or vice versa), press Ctrl+a twice.

Uncaught TypeError: Cannot read property 'getText' of undefined

  1. Install via APM
  2. Run Convert Sublime to Atom

Atom Version: 1.5.3
System: Microsoft Windows 10 Home
Thrown From: atomizr package, v0.4.0

Stack Trace

Uncaught TypeError: Cannot read property 'getText' of undefined

At /C:/Users/ICG/.atom/packages/atomizr/lib/atomizr.coffee:108

TypeError: Cannot read property 'getText' of undefined
    at Object.module.exports.Atomizr.sublToAtom (file:///C:/Users/ICG/.atom/packages/atomizr/lib/atomizr.coffee:87:18)
    at atom-workspace.subscriptions.add.atom.commands.add.atomizr:convert-sublime-text-to-atom (file:///C:/Users/ICG/.atom/packages/atomizr/lib/atomizr.coffee:29:104)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (C:\Users\ICG\AppData\Local\atom\app-1.5.3\resources\app.asar\src\command-registry.js:260:29)
    at CommandRegistry.handleCommandEvent (C:\Users\ICG\AppData\Local\atom\app-1.5.3\resources\app.asar\src\command-registry.js:3:61)
    at CommandRegistry.module.exports.CommandRegistry.dispatch (C:\Users\ICG\AppData\Local\atom\app-1.5.3\resources\app.asar\src\command-registry.js:160:19)
    at AtomEnvironment.module.exports.AtomEnvironment.dispatchApplicationMenuCommand (C:\Users\ICG\AppData\Local\atom\app-1.5.3\resources\app.asar\src\atom-environment.js:1013:28)
    at emitOne (events.js:77:13)
    at EventEmitter.emit (events.js:169:7)

Commands

     -0:03.8.0 atomizr:convert-sublime-text-to-atom (ul.list-inline.tab-bar.inset-panel)

Config

{
  "core": {
    "audioBeep": false,
    "ignoredNames": [
      ".idea",
      ".rdsTempFiles",
      ".settings",
      ".project",
      ".sublime-gulp.cache",
      "g2u.sublime-workspace"
    ],
    "projectHome": "c:\\inetpub\\wwwroot\\xxxx",
    "themes": [
      "seti-ui",
      "monokai"
    ]
  }
}

Installed Packages

# User
atomizr, v0.4.0
language-cfml, v0.11.0
monokai, v0.18.0
seti-icons, v0.4.5
seti-ui, v0.8.1
wakatime, v5.0.2

# Dev
No dev packages

Uncaught ReferenceError: tabTrigger is not defined

[Enter steps to reproduce below:]

  1. Open ST2 snippet:
Snippet contents:
bi source.scss
2. Select "Convert Sublime Text to Atom (snippet)" from Packages/Atomizr

**Atom Version**: 1.7.1
**System**: Mac OS X 10.11.4
**Thrown From**: [atomizr](https://github.com/idleberg/atom-atomizr) package, v0.8.1


### Stack Trace

Uncaught ReferenceError: tabTrigger is not defined

At /Users/mike/.atom/packages/atomizr/lib/atomizr.coffee:180

ReferenceError: tabTrigger is not defined
at Object.module.exports.Atomizr.sublSnipToAtom (/Users/mike/.atom/packages/atomizr/lib/atomizr.coffee:180:21)
at Object.module.exports.Atomizr.autoConvert (/Users/mike/.atom/packages/atomizr/lib/atomizr.coffee:54:8)
at atom-workspace.subscriptions.add.atom.commands.add.atomizr:automatic-conversion (/Users/mike/.atom/packages/atomizr/lib/atomizr.coffee:32:96)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:260:29)
at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61)
at CommandRegistry.module.exports.CommandRegistry.dispatch (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:160:19)
at AtomEnvironment.module.exports.AtomEnvironment.dispatchApplicationMenuCommand (/Applications/Atom.app/Contents/Resources/app.asar/src/atom-environment.js:1100:28)
at EventEmitter.outerCallback (/Applications/Atom.app/Contents/Resources/app.asar/src/application-delegate.js:314:25)
at emitTwo (events.js:87:13)
at EventEmitter.emit (events.js:172:7)


### Commands

 -1:18.1.0 atomizr:convert-sublime-text-snippet-to-atom (atom-text-editor.editor.is-focused)
 -0:20.6.0 atomizr:convert-sublime-text-completions-to-atom (atom-text-editor.editor.is-focused)
 -0:00.8.0 atomizr:automatic-conversion (atom-text-editor.editor.is-focused)

### Config

```json
{
  "core": {
    "closeEmptyWindows": false,
    "themes": [
      "atom-material-ui",
      "predawn-syntax"
    ]
  }
}

Installed Packages

# User
aligner, v0.20.0
atom-beautify, v0.29.3
atom-material-ui, v1.2.10
atom-ternjs, v0.13.2
atomizr, v0.8.1
editorconfig, v1.3.0
emmet, v2.4.3
file-icons, v1.7.3
highlight-line, v0.11.1
highlight-selected, v0.11.2
jquery-snippets, v11.0.0
language-cshtml, v0.1.1
linter, v1.11.4
linter-elm-make, v0.4.0
linter-htmlhint, v1.1.2
linter-jshint, v2.1.0
linter-jsonlint, v1.2.3
linter-sass-lint, v1.3.1
pigments, v0.26.0
predawn-syntax, v1.0.2
project-manager, v2.9.7
set-syntax, v0.3.0
sublime-panes, v0.2.5
terminal-plus, v0.14.5

# Dev
No dev packages

Uncaught TypeError: Cannot read property '_text' of undefined

[Enter steps to reproduce:]

  1. Tried to convert https://github.com/jeantimex/react-sublime-snippet/blob/master/React/Class%20Component.sublime-snippet to Atom
  2. Big ba da boom!

Atom: 1.18.0 x64
Electron: 1.3.15
OS: Mac OS X 10.12.6
Thrown From: atomizr package 0.23.1

Stack Trace

Uncaught TypeError: Cannot read property '_text' of undefined

At /Users/tom/.atom/packages/atomizr/lib/includes/sublime-text.coffee:69

TypeError: Cannot read property '_text' of undefined
    at Object.read_xml (/packages/atomizr/lib/includes/sublime-text.coffee:69:39)
    at Object.sublSnippetToAtom (/packages/atomizr/lib/atomizr.coffee:221:24)
    at Object.autoConvert (/packages/atomizr/lib/atomizr.coffee:101:8)
    at /packages/atomizr/lib/atomizr.coffee:66:96)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:265:35)
    at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:3:65)
    at CommandRegistry.module.exports.CommandRegistry.dispatch (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:166:25)
    at AtomEnvironment.module.exports.AtomEnvironment.dispatchApplicationMenuCommand (/Applications/Atom.app/Contents/Resources/app/src/atom-environment.js:1314:34)
    at EventEmitter.outerCallback (/Applications/Atom.app/Contents/Resources/app/src/application-delegate.js:334:31)
    at emitThree (events.js:116:13)
    at EventEmitter.emit (events.js:194:7)

Commands

     -1:42.1.0 atomizr:convert-sublime-text-to-atom (input.hidden-input)
  2x -0:35.7.0 atomizr:convert-atom-to-sublime-text (input.hidden-input)
     -0:32.2.0 editor:move-to-first-character-of-line (input.hidden-input)
     -0:32.2.0 editor:consolidate-selections (input.hidden-input)
     -0:32.2.0 core:cancel (input.hidden-input)
  2x -0:30.1.0 atomizr:convert-sublime-text-to-atom (input.hidden-input)
     -0:07.9.0 atomizr:automatic-conversion (input.hidden-input)

Non-Core Packages

advanced-open-file 0.16.6 
atom-beautify 0.30.4 
atom-jade 0.3.0 
atom-material-ui 2.0.4 
atom-ternjs 0.18.3 
atomizr 0.23.1 
autoclose-html 0.23.0 
autocomplete-modules 1.6.10 
busy-signal 1.4.3 
colorful-json 1.1.0 
cson 2.0.1 
docblockr 0.11.0 
editorconfig 2.2.2 
emmet 2.4.3 
esformatter 2.3.0 
file-icons 2.1.9 
fold-functions 0.5.0 
gist 1.0.0 
highlight-line 0.12.0 
highlight-selected 0.13.1 
intentions 1.1.5 
isotope-ui 2.8.5 
jade-beautify 0.1.5 
jumpy 3.1.3 
language-babel 2.68.0 
language-docker 1.1.8 
language-kotlin 0.5.0 
language-pug 0.0.21 
language-tmux 0.4.0 
language-viml 1.1.4 
linter 2.2.0 
linter-coffeescript 1.0.0 
linter-eslint 8.2.1 
linter-jsonlint 1.3.0 
linter-kotlin 0.5.0 
linter-shellcheck 1.4.4 
linter-ui-default 1.6.3 
minimap 4.29.3 
minimap-highlight-selected 4.6.1 
nuclide 0.242.0 
open-recent 5.0.0 
pigments 0.39.1 
pretty-json 1.6.4 
react-snippets 0.9.0 
spacegray-atom-dark-syntax 1.3.2 
standard-formatter 2.8.0 
todo-show 1.11.0 
toggle-quotes 1.0.1 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.