9o is GoSublime's command-shell, press ctrl+9
or super+9
activate it.
It has two basic concepts: commands and actions.
Type #
(hash/number sign/pound sign [space]) to begin a command sequence e.g. # help
', then press enter to execute it.
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.
-
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
orrun -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 Windowscmd.exe
. See theshell
setting for more details. -
clear: clears the output panel
-
tskill: lists or cancels active tasks. type
tskill
to show a palette containing a list of active tasks and their summary and cancel them where possibletype
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 commandtskill go
kill the last instance of the go commandgo run
etc. note, however that this may fail to actually kill the executable being run bygo run
-
settings: list settings as seen by GoSublime. type
settings
to get a listing of all settings. typesetting [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. typeenv [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 typehist erase
to erase all historical commands -
cd: change directory type
cd
to cd to the directory of the current file (like ctrl+9 does) typecd ~/go
to cd to thego
directory in your home directory typecd $GOROOT/src/pkg/fmt
to cd thesrc/pkg/fmt
in your GOROOT
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 ] #
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