Home

Awesome

Buildview

A Sublime Text plugin to show build output in a view.

Donate with Bitcoin Donate with Ethereum

In Sublime Text, build results are shown in a fixed horizontal panel; you can't drag it to put it vertically next to your code, like in Eclipse, VS.

With this plugin, like any other view, you can put your build results where you want:

buildview vertical

This is super useful if you are repeatedly running a program on your code/ script and want to have its output handy. (You probably already have a .sublime-build or build_systems entry in your .sublime-project.)

The core functionality is done in pipe_views.PipeViews, an abstraction allowing Unix-like "pipes" to be created between Views in Sublime.

Installation

  1. Install via Package Control or git clone into your Packages folder (you can browse to it via Preferences -> Browse Packages).
  2. Ensure your build system is set up correctly (eg. Python in the case of the screenshot above).
  3. That's it, you should see build output by pressing the shortcut key to Build (eg. Ctrl-B or ⌘-B).

Custom Build Key Bindings

If you have different shortcuts for launching builds, you need to modify your .sublime-keymap files, as this plugin comes baked with configuration to hook on to the default Sublime Text keyboard shortcuts for launching builds. These bindings must have the following context:

"context": [{"key": "build_fake", "operator":"equal", "operand":true}]

For example, say you have a key binding for F13 to build:

{
  "keys": ["f13"],  "command": "build",
},

To configure it to trigger the Buildview plugin, change it like:

{
  // the usual config...
  "keys": ["f13"],  "command": "build",
  // ...this is the extra bit
  "context": [{"key": "build_fake", "operator":"equal", "operand":true}]
},

Configuration

Several aspects of the plugin's behaviour can be changed as detailed below. They can be changed on a per-view basis via the Command Palette in either the view source code or with build output, or through settings under "buildview".

Note: it seems settings set via Command Palette are persisted through sublime exits/launches, so you might not have to edit the JSON .sublime-settings files.

Disabling

Command Palette:

key: "buildview.enabled" values: true/false

Sublime's settings hierarchy is respected. So you could, for example, enable the plugin only for selected projects, by setting "enabled" to false in Packages/User/Preferences.sublime-settings, and set it to true in your .sublime-project.

For example, you can add this to your Preferences.sublime-settings:

{
	...
	"buildview.enabled": false
	...
}

Then in the project's .sublime-project file:

{
	...
	"folders": [...],
	"settings": {
		"buildview.enabled": true,
		"buildview.scroll": "top"
	}
	...
}

("scroll" added for demonstration; for details on "scroll", refer below.)

Output scrolling

Command Palette:

key: "buildview.scroll"

values:

default: "bottom"

The plugin can scroll the output to the top, bottom, or the position before the current build was launched. The default is to scroll to the bottom (ie. continually show fresh output as it is emitted).

"Save changes?" warning

key: "buildview.silence_modified_warning"

values: true/false

default: true.

Since version 90e2365182e9566b2fa79dd7dc79d6b0d7e433f6 (Package Control: 2014.01.27.15.16.48), closing the build output view, directly, or indirectly, eg. by exiting Sublime Text, no longer causes a "Save changes?" warning to be displayed.

If you wish to have the old behaviour (of having a warning displayed), set to false.

Suppress build results panel

The built-in build results view will display momentarily. To disable this, use the User preference setting:

{
	...
	"show_panel_on_build": false,
	...
}

Known Issues/TODO

Pull requests welcome!

Hacking notes

Donate

If you liked this plugin, you can donate here: Donate with Bitcoin Donate with Ethereum