Run go install on file change
souvikhaldar opened this issue · comments
Souvik Haldar commented
I want to run go install
in my current directory whenever a go file is changed (using vim :w
). How can I do it?
I tried the following but it did not work:
reflex -v -g "*.go" 'go install'
Caleb Spare commented
Reflex will try to run a command named go install
; you need to let the shell do argument splitting for you so you want
reflex -v -g "*.go" go install
If the .go files you're editing are inside some subdirectory, this won't work since there's no recursive globbing. In that case you could use a regex match instead:
reflex -v -r '\.go$' go install
Souvik Haldar commented
Awesome, thanks!