Documentation
¶
Overview ¶
The autocmd command is used to execute a command when some source file changes. The source files can be specified as actual path names or using shell metacharacters (e.g., *.go).
The typical usage is:
autocmd --clear '*.go' -- go test
Normally autocmd immediately executes the specified command. The --wait option causes autocmd wait for the first change to the file before executing the command.
The --go flag is a short cut to specify --clear and all .go files from the current directory on down. The --go flag implies --, typical usage;
autocmd --go go test
Multiple sets of commands can be set to run by separating them with ---. For example:
autocmd grammer.y -- goyacc -o grammar.go grammar.y \ --- .../*.go go build
This will cause autocmd to run goyacc if grammer.y changes and go build if any .go file changes. If grammar.y changes then grammer.go will change which will trigger the go build.
CONFIG ¶
A config file, specified by --config, can be used to alter the patterns looked for by --go. An example configuration:
# this is a comment go: .../*.go go: .../*.sdl go: BUILD