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

Shell Turtlestein

by misfo ST2/ST3

Plugin for running arbitrary shell commands in Sublime Text

Details

Installs

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

Readme

Source
raw.​githubusercontent.​com

Shell Turtlestein

A quick and simple way to run arbitrary shell commands in Sublime Text.

Mr. Turtlestein acts as a more flexible alternative to Sublime's build systems. Commands run in your project's directory:

input a shell command

And display their output just like Sublime's build systems:

command output

Input and output

Unix's familiar | and > operators can be used to pipe/redirect a command's input and output:

  • To pipe the active view's selections to a command, add a leading pipe character (e.g. | sort). If there are no non-empty selections the entire file will be piped to the command.
  • To pipe a command's output back into the view, add a trailing pipe character (e.g. | sort |).
  • To redirect the command's output to a new file, add a trailing greater than symbol to the command (e.g ls > or | sort >).

Using snippets

Snippets are available for frequently used commands. All snippets with the scope name source.shell (source.dosbatch for Windows users) can be used in the prompt shown above. I have some examples you can take a look at to get an idea for this.

Default keybindings

  • Ctrl + Shift + C (Cmd + Shift + C): prompt for a shell command
  • Ctrl + Alt + Shift + C (Cmd + Alt + Shift + C): launch a terminal in the window's directory

Optional Configuration

In your own Packages/User/Shell Turtlestein.sublime-settings file you can override the following settings:

  • surround_cmd: A two-element array that specifies text to append before and after the command (e.g. ["source ~/.profile && ", ""]).
  • exec_args: The arguments that will be passed to ExecCommand. The same options that are available to build systems are available here, but file_regex, line_regex, encoding, env, and path are the only options that make sense to use with this plugin. Arguments specified in the cmd_settings (see below) will override these defaults.
  • cmd_settings: An array of configurations to use for commands that are executed. The first configuration to match the command being run will be used. The keys that each configuration should have are:
    • cmd_regex: A regex that must match the command for this configuration for this configuration to be used.
    • exec_args and surround_cmd override the settings described above for any matching command.

PAQ

Q: Who the balls is Shell Turtlestein?

A: He was a pet turtle that died in some episode of Modern Family. That's about as high-brow as my references get. R.I.P. Shell :(

Q: What does “PAQ” stand for?

A: Possibly asked questions

Thanks!

Thanks to all the contributors. I'd give you all high fives if my arm would fit through the internet.