I imagine most of these things will work in any Unix-like shell. I just happen to use Zsh.
Commands
!!
The double bang operator repeats the last used comand
!
A single bang in an NVIM command input will turn that input into a regular shell
$!
This shows the exit code of the last command executed, the most common exit codes of a Unix script are:
- 0 (successful)
- 1 (generic errors)
- 2 (improper command usage)
Debugging
Standard Output Logging
yarn install 2>&1 | tee yarn-install-debug.txt
This will log standard output of the yarn install
command to a file called yarn-install-debug.txt
, which allows us to navigate and debug long output in a more friendly manner using a text editor.