Giter VIP home page Giter VIP logo

jarmokivekas / atom-script Goto Github PK

View Code? Open in Web Editor NEW

This project forked from atom-community/atom-script

0.0 2.0 0.0 547 KB

:runner: Run ( scripts | selections | source ) in Atom

Home Page: https://atom.io/packages/script

License: MIT License

Prolog 3.21% Java 0.21% Makefile 0.37% Ruby 1.85% Julia 0.78% Python 1.80% C 0.18% Haskell 0.31% Elixir 0.09% Erlang 0.15% Gherkin 1.93% PHP 2.16% Scala 0.23% Racket 0.38% Groovy 0.46% CoffeeScript 84.95% Shell 0.37% C++ 0.15% F# 0.34% Forth 0.09%

atom-script's Introduction

Script Build Status

Run code in Atom!

Run scripts based on file name, a selection of code, or by line number.

Currently supported grammars are:

  • AppleScript
  • Bash
  • Behat Feature
  • C *
  • C++ *
  • C# Script *
  • Coffeescript
  • CoffeeScript (Literate) ^
  • Cucumber (Gherkin) *
  • D *
  • DOT (Graphviz)
  • Elixir
  • Erlang
  • F# *
  • Forth (via GForth)
  • Go *
  • Groovy
  • Haskell
  • Java
  • Javascript
  • Julia
  • Kotlin
  • LilyPond
  • Lisp (via SBCL)
  • Literate Haskell *
  • LiveScript
  • Lua
  • Makefile
  • MoonScript
  • MongoDB
  • newLISP
  • Objective-C *
  • Objective-C++ *
  • OCaml *
  • Perl
  • Perl 6
  • PHP
  • Python
  • RSpec
  • Racket
  • RANT
  • Ruby
  • Ruby on Rails
  • Rust
  • Sass/SCSS *
  • Scala
  • Swift

NOTE: Some grammars may require you to install a custom language package.

You only have to add a few lines in a PR to support another.

Limitations

^ Running selections of code for CoffeeScript (Literate) only works when selecting just the code blocks

Erlang uses erl for limited selection based runs (see #70)

* Cucumber (Gherkin), D, Go, F#, Literate Haskell, OCaml, PowerShell, and Swift do not support selection based runs

Lisp selection based runs are limited to single line

C, C++, Objective-C, and Objective-C++ are currently only available for Mac OS X (where process.platform is 'darwin'). This is possible due to the commands xcrun clang and xcrun clang++. NOTE: Xcode and the Xcode command line tools are required to ensure xcrun and the correct compilers on your system.

Installation

apm install script

or

Search for script within package search in the Settings View.

Atom can't find node | ruby | python | my socks

Make sure to launch Atom from the console/terminal. This gives atom all your useful environment variables.

If you really wish to open atom from a launcher/icon, see this issue for a variety of workarounds that have been suggested.

Usage

Make sure to run atom from the command line to get full access to your environment variables. Running Atom from the icon will launch using launchctl's environment.

Script: Run will perform a "File Based" run when no text is selected (default).

Script: Run while text is selected will perform a "Selection Based" run executing just the highlighted code.

Script: Run by Line Number to run using the specified line number. Note that if you select an entire line this number could be off by one due to the way Atom detects numbers while text is selected.

Script: Run Options should be used to configure command options, program arguments, and environment variables overrides. Environment variables may be input into the options view in the form VARIABLE_NAME_ONE=value;VARIABLE_NAME_TWO="other value";VARIABLE_NAME_3='test'

Script: Kill Process will kill the process but leaves the pane open.

Script: Close View closes the pane and kills the process.

To kill everything, click the close icon in the upper right and just go back to coding.

Script: Copy Run Results copies everything written to the output pane to the clipboard, allowing you to paste it into the editor.

Command and shortcut reference

Command Mac OS X Linux/Windows Notes
Script: Run cmd-i shift-ctrl-b If text is selected a "Selection Based" is used instead of a "File Based" run
Script: Run by Line Number shift-cmd-j shift-ctrl-j If text is selected the line number will be the last
Script: Run Options shift-cmd-i shift-ctrl-alt-o Runs the selection or whole file with the given options
Script: Close View esc or ctrl-w esc Closes the script view window
Script: Kill Process ctrl-c ctrl-q Kills the current script process

Development

Use the atom contributing guidelines. They're pretty sane.

Quick and dirty setup

apm develop script

This will clone the script repository to ~/github unless you set the ATOM_REPOS_HOME environment variable.

I already cloned it!

If you cloned it somewhere else, you'll want to use apm link --dev within the package directory, followed by apm install to get dependencies.

Workflow

After pulling upstream changes, make sure to run apm update.

To start hacking, make sure to run atom --dev from the package directory. Cut a branch while you're working then either submit a Pull Request when done or when you want some feedback!

atom-script's People

Contributors

rgbkrk avatar erran avatar lbatson avatar entilzha avatar smashwilson avatar pardom avatar calyhre avatar hansrodtang avatar liamdawson avatar danielbayley avatar bjaminn avatar thiconz avatar lmagno avatar ivanoats avatar zedentox avatar ciarand avatar azawawi avatar morinmorin avatar fazo96 avatar cormullion avatar yhpark avatar tg avatar rnhmjoj avatar blvz avatar marekpiechut avatar jchannon avatar ilyapalkin avatar ojima-h avatar dustinblackman avatar radix avatar

Watchers

James Cloos avatar Jarmo Kivekas avatar

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.