amoilanen / Brackets-Command-Line-Shortcuts

Brackets IDE plugin. Adds support of shortcuts for execution of terminal commands right from the IDE.
8 stars 1 forks source link

Command Line Shortcuts for Brackets

Brackets IDE plugin. Adds support of shortcuts for execution of terminal commands right from the IDE.

Configure Shortcuts

Find the configuration under command-line-shortcuts.commands in your preferences file.

Example configuration

[
  {
    "name": "Build whole project",
    "cmd": "grunt",
    "shortcut": "Ctrl-Shift-B",
    "autohide": true
  },
  {
    "name": "Run unit tests",
    "dir": "$PROJECT_ROOT",
    "cmd": "grunt test",
    "shortcut": "Ctrl-Alt-B",
    "autohide": true
  },
  {
    "name": "Update the source",
    "dir": "$PROJECT_ROOT",
    "cmd": "git pull",
    "shortcut": "Ctrl-Shift-P",
    "autohide": true
  },
  {
    "name": "Display contents of the currently selected file",
    "dir": "$SELECTED_ITEM_DIR",
    "cmd": "cat $SELECTED_ITEM",
    "shortcut": "Ctrl-Alt-C"
  }
]

$PROJECT_ROOT is a special variable that denotes the root directory of the currently open project. This way when opening multiple projects in a sequence the shortcuts will be applicable for each project provided that the configured commands can be run in the root of each open project.

If no dir field is specified it is assumed to be $PROJECT_ROOT.

In order for changes to be applied just reload Brackets.

Supported variables

The following variables can be used in the configuration as values for dir and cmd:

Use shortcuts

After re-loading Brackets with the latest version of the configuration just use the shortcuts. In the example above

Ctrl-Shift-B will build the project and Ctrl-Shift-P will fetch the latest sources from its Git repository.

Supported platforms

The plugin has been tested on Windows 8 and Ubuntu Linux.

Report issues

Issues can be reported at https://github.com/antivanov/Brackets-Command-Line-Shortcuts/issues

License

MIT License (c) Anton Ivanov

Credits

The plugin was in part inspired by Brackets Builder