Skip to content

Latest commit

 

History

History
110 lines (71 loc) · 3.46 KB

9o.md

File metadata and controls

110 lines (71 loc) · 3.46 KB

9o is GoSublime's command-shell, press ctrl+9 or super+9 activate it.

It has two basic concepts: commands and actions.

Commands

Type # (hash/number sign/pound sign [space]) to begin a command sequence e.g. # help', then press enter to execute it.

Actions

Filename and other actionable text are highlighted (usually bold). Place the cursor over these areas and press ctrl+dot,ctrl+g' (or super+dot,super+g on OS X) to open the corresponding file. Alternatively, press ctrl+shift', (or super+shift on OS X) and left-click.

Supported commands

  • help: Present documentation for 9o and its supported commands

  • build: build the current package

  • run: build the current package. If it's a regular package run its tests otherwise(package main) execute it. e.g. run or run -flag1 -flag2=abc

  • replay: like run but attempts to cancel any active executions before running

  • go: run the go command e.g. go help

  • sh: execute a shell command. 9o does not attempt to emulate or support you system's shell/command interpreter. Use this command run shell commands. Your shell, by default, is the default python shell which may not be what you want(doesn't load environment variables etc.). On Linux and OS X it's usually /bin/sh and on Windows cmd.exe. See the shell setting for more details.

  • clear: clears the output panel

  • tskill: lists or cancels active tasks. type tskill to get a list of active tasks and their summary

      [ tskill | done ]
      	#t1 0:01:39 9o: pending
    

    type tskill [TASK ID] to cancel the task. The task is represented by #TASK_ID. (you will be prompted with an ok/cancel dialog to confirm the action)

      [ tskill t1 | done ]
      	kill t1: yes
    

    the following aliases can be used in place of task ids: tskill replay kill the last instance of the replay command tskill go kill the last instance of the go command go run etc. note, however that this may fail to actually kill the executable being run by go run

  • settings: list settings as seen by GoSublime. type settings to get a listing of all settings. type setting [NAME1] [NAME2] ... to the value of the listed names

  • env: list environment variables as seen/generated by GoSublime. type env to get a listing of all environment vars usable by GoSublime. type env [NAME1] [NAME2] ... to the value of the listed names

  • share: share the active view's content on play.golang.org

  • hist: manage command history type hist to list all historical commands type hist erase to erase all historical commands

Executing commands

When you run a command e.g. replay, its line is replaced with the command followed by and hour glass and a new prompt is initialised. When the command completes a its output is printed and the hour glass replaced with a summary.

[ /go ] # replay
	|
	v
[ replay ⌛ ]
[ /go ] #
	|
	v
[ replay | done: 2.987ms ]
	hello world
[ /go ] #

Command History

In the 9o autocompletion menu, old commands are listed in the (reversed) order they were last executed. They are prefixed with a carret(^) e.g. ^1 replay. In addition to being able to autocomplete them, you can also expand them by their alias(without execution). To do so, type the alias and press [enter] e.g.

[ /go ] # ^1

is replaced with:

[ /go ] # replay

To expand and execute an old command by its alias, use two carrets e.g.

[ /go ] # ^^1

executes the last command:

[ `replay` | done: 2.557ms ]
	hello world