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

Build​Parts

by erinata ST2

This is a Sublime Text plugin for executing (or building) part of your code. (It should work for any language that the Sublime Text 2 originally can build)

Details

  • 2012.04.24.17.59.08
  • github.​com
  • github.​com
  • 12 years ago
  • 50 minutes ago
  • 12 years ago

Installs

  • Total 1K
  • Win 839
  • Mac 446
  • Linux 214
May 10 May 9 May 8 May 7 May 6 May 5 May 4 May 3 May 2 May 1 Apr 30 Apr 29 Apr 28 Apr 27 Apr 26 Apr 25 Apr 24 Apr 23 Apr 22 Apr 21 Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10 Apr 9 Apr 8 Apr 7 Apr 6 Apr 5 Apr 4 Apr 3 Apr 2 Apr 1 Mar 31 Mar 30 Mar 29 Mar 28 Mar 27
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

BuildParts (version 0.3.0)

This is a Sublime Text plugin for executing (or building) part of your code.

Installation

Install using Package Control (Recommanded)

  1. I guess most Sublime Text 2 users are using Sublime Package Control. If not, please install it from here http://wbond.net/sublime_packages/package_control
  2. Go to Preference > Package Control, and Choose “Install Package”
  3. Choose the package named “BuildParts” to install it
  4. If BuildParts is not available from Package Control, you can go to Preference > Package Control, and Choose “Add Repository”. Put “https://github.com/erinata/BuildParts” (without quotes) to add the repo and try step 2 and 3 again.

Install manually

  1. Download the repo
  2. Copy everything in the repo to a folder named “BuildParts” under the package folder of SublimeText 2 (create it if it doesn't exist)

Usage

There is only one command: BuildParts: Build the selected code

When you select some code and invoke this command, this package will build the selected code using the currently chosen build system. If you have selected nothing, this package will build the whole file. (So that you still get the default Sublime Text build system behaviour)

BuildParts default keybindings are “ctrl+b” (for Windows and Linux) and “super+b” (for Mac). It's the same as the default keybinding for building your code. If you want to invoke the build system for the whole file. Just select nothing and press “ctrl+b”.

Example:

Suppose you have a document named hello.rb

Puts("Hello")
Puts("World")
Puts("Everyone")

Suppose you select the first 2 lines, and press “ctrl+b”, the package will only build the currently selected parts (which are first 2 lines in this case). The build output console will show:

Hello
World

It is useful when you want to execute several lines of your code (especially for interpreted language say Ruby) and see how it works.

If you select nothing and press “ctrl+b”, the package will involve the default behaviour in Sublime Text and build the whole file. The build output console will show:

Hello
World
Everyone

As BuildParts utilizes the build system in Sublime Text, it supports any language that Sublime Text can build. It also work with custom build systems that are installed via packages.

Limitation

BuildParts is not supporting multiple selections for now.

Operating Systems

I only tested this on Windows, I hope that it works on OSX and Linux.

License

Copyright © 2012 Tom Lam. MIT License.