ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Glue

by chrissimpkins ST2/ST3

Glue is a plugin that joins your shell to Sublime Text in quasi-perfect harmony.

Details

Installs

  • Total 9K
  • Win 2K
  • OS X 4K
  • Linux 2K
Feb 27 Feb 26 Feb 25 Feb 24 Feb 23 Feb 22 Feb 21 Feb 20 Feb 19 Feb 18 Feb 17 Feb 16 Feb 15 Feb 14 Feb 13 Feb 12 Feb 11 Feb 10 Feb 9 Feb 8 Feb 7 Feb 6 Feb 5 Feb 4 Feb 3 Feb 2 Feb 1 Jan 31 Jan 30 Jan 29 Jan 28 Jan 27 Jan 26 Jan 25 Jan 24 Jan 23 Jan 22 Jan 21 Jan 20 Jan 19 Jan 18 Jan 17 Jan 16 Jan 15 Jan 14 Jan 13
Windows 5 6 7 6 14 6 1 7 6 3 9 6 5 8 8 16 13 8 5 6 3 15 14 10 8 11 7 4 10 11 15 7 10 9 10 16 11 12 10 8 4 4 13 17 8 15
OS X 10 25 23 19 6 7 8 17 13 17 21 12 9 14 26 25 22 21 16 14 10 21 14 21 18 9 15 11 29 17 19 16 11 5 9 17 23 17 13 15 11 14 19 15 20 20
Linux 5 9 8 15 7 9 4 8 9 6 4 8 4 3 12 10 12 6 15 6 7 13 7 12 16 15 6 8 9 9 9 9 6 4 9 14 9 7 13 8 8 6 10 12 7 10

Readme

Source
raw.​githubusercontent.​com

Glue

Glue is a cross-platform, extensible plug-in for Sublime Text 2 and 3 that connects your favorite editor to your shell.

Detailed documentation is available on http://gluedocs.readthedocs.org.

Confirm Your PATH

Before you get started, please confirm your system PATH string in the Glue settings. Here are the instructions.

Launch

Open with Right Click Menu

Right Click Menu

Open with the Command Palette

Command Palette

Open with Keybinding

Ctrl - Alt - G

Enter Commands

Use the command input box at the bottom of the screen to enter system commands just like you would in your terminal:

Enter Commands in Glue

and the standard output is displayed in an editor view.

System Utilities

It works with system utilities:

grep

Grep Example

cURL

cURL Example

Scripting Languages

It works with scripting languages:

Scripting Languages Examples

Inter-Process Communication

Pipelining data between processes works. You get the standard output from the final executable in the sequence:

Pipelining Example

Version Control

Version control tasks are accessible inside the editor:

Version Control Example

Compile, Unit Test, Profile, Minify, Compress…

You get the picture.

Navigation & Working Directory State

Glue includes its own version of the cd command that allows you to navigate around your directory structure while maintaining your current working directory state between calls to the shell.

File Management

Open files in the Sublime Text editor by file path:

█ glue open <filepath> [filepath2] [...]

or by wildcard pattern:

█ glue wco <wildcard>

and create new files with:

█ glue new

Available Glue Commands

Glue includes its own set of commands to perform common tasks. You can extend these with aliases (see information below).

Usage examples with available command arguments are in the documentation.

CommandDescription
cdchange directory
exit exit the Glue terminal
glue browse open URL or local project file in default browser
glue clear clear text in the Glue view
glue finder reveal current directory (default) or optional path in finder
glue goto Sublime Text GoTo Anything search
glue help view help documentation in Glue view
glue localhost open default web browser to local server
glue new open a new Sublime Text buffer
glue open open one or more project files by filepath
glue path display the system PATH setting that is used by Glue
glue user display alphabetized list of your Glue user extensions
glue wco open one or more files by wildcard pattern

Extend Sublime Text With Glue Extensions

You can build Sublime Text extensions with your favorite language or extend Sublime Text with any system utility using Glue command extensions. These are aliases for system commands that can be called from the Glue command line using the syntax:

█ glue <your-command> [optional arguments]

You have the option to pass additional command line arguments, clipboard data, or the current working directory path to the mapped system command with template tags.

The Glue-Commands Directory

Create a directory in your Sublime Text Packages directory (Preferences > Browse Packages) that is named Glue-Commands.

The glue.json File

Create a new file in this directory with the following path Glue-Commands/glue.json.

Use the glue.json file to create Glue extensions with key = command name to value = command string mapping.

Example

You could make a command that executes a local image compression shell script on the path /Users/me/scripts/cruncher.sh with the following syntax:

{
  "crunch": "/Users/me/scripts/cruncher.sh {{args}}"
}

Then use it in Glue like this:

█ glue crunch image.png

The mapped system command is executed as:

/Users/me/scripts/cruncher.sh image.png

in your current working directory and is accessible in any Sublime Text project.

Make as many as you'd like. You can use the following command to reference an alphabetized list of your extensions:

█ glue user

More detailed extension documentation (including additional examples) is available here.

Changelog

The changelog is available here.

License

MIT License