These are helper functions for rust development inspired by Jeremy Chones cwt and cwe
helper functions (however I call them rwt and rwe). They start examples or tests and watch them with bacon.
This is nice when exploring in examples or doing a kind of test driven development.
These are best if you have fzf, bacon and bat installed but should also work with just bacon (that is needed and recommended, as cargo-watch is unmaintained).
Add the function declarations in rust_helpers.bash to your initialization files (e.g. ~/.bashrc). To also get autocompletion
for them, create files ~/.local/share/bash-completion/completions/{rwe,rwt} and add the contents of rwe_completion.bash
and rwt_completion.bash. Note that the completion files have no file extension. I added an extension here so that the gist
renders more nicely.
Just call rwe or rwt to see the fzf window. For examples it should also display a preview of the code. Select a test or example and press enter to watch it.
One disclaimer about the autocompletion of rwt. It works best when typing rwt ", since test names are fully qualified and
contain :: (double colons).
Selection:
While running: