✍️ Working on bash
[!INFORMATION] Disclaimer: This page is just one opinion. This is not the best way to work on bash scripts, this is just an explanation of how I work.
IDE
I work with VS code on windows + WSL.
Install VS code from here.
VS code extensions
Here is a list of recommended extensions to work on bash scripts:
- Bash IDE
- Debug bash scripts
- Shell Script Command Completion
- Better comments
- Better shellscript syntax
- Code spell checker
- EditorConfig
- Indent rainbow
- Format shell script
- Shellcheck
- Snippets manager
- Snippets for bash scripts
- Snippets for shebang
GitHub Copilot is of great help if you can have it. You can also find the list of extensions here.
VS code settings
You can open your ~/.valet.d
directory as a workspace on vscode.
I recommend to copy (or link) the extras/all-valet-functions.sh file present in the Valet installation to ~/.valet.d/.vscode/all-valet-functions.sh
in your workspace folder and add the following settings in your ~/.valet.d/.vscode/settings.json
:
{
"bashIde.includeAllWorkspaceSymbols": true
}
This allows you to have autocompletion and help on the core and libraries functions:
Alternatively, you can use the Valet vscode snippets:
- copy this file in your repository under the
.vscode
directory (you can chose to ignore this in git or push it). - or copy this file as
shellscript.json
in your user snippets folder (%APPDATA%\Code\User\snippets
in windows).