Skip to content

hemme/atom-runner

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Atom Runner

This package will run various script files inside of Atom. It currently supports JavaScript, CoffeeScript, Ruby, Python, Go, Bash and PowerShell scripts. You can add more!

Example

Using

  • Hit Ctrl+R (Alt+R on Win/Linux) to launch the runner for the active window.
  • Hit Ctrl+Shift+R (Alt+Shift+R on Win/Linux) to run the currently selected text in the active window.
  • Hit Ctrl+Shift+C to kill a currently running process.
  • Hit Escape to close the runner window.

Features

  • A docked runner window with ANSI support and ESC keybinding to close.
  • PATH and environment variable detection on OSX.
  • Shebang executable detection in all source files.
  • Configurable commands based on file scope or filename matches.
  • Execute unsaved file buffers!

Configuring

This package uses the following default configuration:

'runner':
  'scopes':
    'coffee': 'coffee'
    'js': 'node'
    'ruby': 'ruby'
    'python': 'python'
    'go': 'go run'
    'shell': 'bash'
    'powershell': 'c:\\windows\\sysnative\\windowspowershell\\v1.0\\powershell.exe -noninteractive -noprofile -c -'
  'extensions':
    'spec.coffee': 'mocha'
    'ps1': 'c:\\windows\\sysnative\\windowspowershell\\v1.0\\powershell.exe –file'

Note: If a shebang is detected, that line will supersede the default registered command.

You can add more commands for a given language scope, or add commands by extension instead (if multiple extensions use the same syntax). Extensions are searched before scopes (syntaxes).

To do so, add the configuration to ~/.atom/config.cson in the format provided above.

The mapping is SCOPE|EXT => EXECUTABLE, so to run JavaScript files through phantom, you would do:

'runner':
  'scopes':
    'js': 'phantom'

Note that the source. prefix is ignored for syntax scope listings.

Similarly, in the extension map:

'runner':
  'extensions':
    'js': 'phantom'

Note that the . extension prefix is ignored for extension listings.

License & Copyright

This package is Copyright (c) Loren Segal 2014 and is licensed under the MIT license.

About

This package will run various script files inside of Atom. It currently supports JavaScript, CoffeeScript, Ruby, and Python. You can add more.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • CoffeeScript 89.6%
  • CSS 6.1%
  • Go 2.4%
  • Ruby 1.3%
  • JavaScript 0.3%
  • Shell 0.2%
  • Python 0.1%