Recommended Bash Scripting Extensions for VS Code
In this article, I would be suggesting out some cool and awesome Visual Studio Code Extension to have to make the Shell Scripting and Bash Scripting work quite easy and handy for a Developer/Site Reliability Engineers(SREs).
VS Code provides excellent extensions for Bash scripting.
Shellman is a VS Code snippet extension for shell scripts. It provides a free ebook (PDF, epub, mobi) that contains scripting basics and snippets.
Shellman has ready to use functions to put into your code if you type
fn, and selected function usage is available after typing
fx. For example the function to create a banner with desired text can be accessed via
fn banner simple and to call this function the
fx banner simple.
You can find the list of commands on its Github repo. Shellman provides not only Bash scripting snippets such as
fn but also
date, and other commands as well.
You can find the list of warnings on GitHub or use the URL https://github.com/koalaman/shellcheck/wiki/SCXXXX where “XXXX” is the warning code (e.g. 2086).
Shell Script Language Basics
This extension is bundled with Visual Studio Code. It can be disabled but not uninstalled. It provides syntax highlighting and bracket matching in shell script files.
You can check it by typing
@builtin shell in the extensions tab, as you see in the above image.
Once it is enabled, click “Plain Text” in the bottom status bar.
Select “Shell Script” in the Select Language mode.
Shell-format formats shell scripts, Dockerfiles, gitignore, dotenv, and more. Shell-format helps you with indentations, removing extra spaces, and alignment.
This extension depends on
shfmt. If you are using Homebrew, you can install it:
$ brew install shfmt
This is the most popular Bash debugger. It provides
launch.json, pause support,
watch-debug, and conditional breakpoints.
This is a SIMPLE bashdb debugger frontend. Useful for learning bash shell usage and writing simple scripts.
Useful hint: shellcheck extension does a great job with finding common script errors before debugging.
You can use Indent-rainbow for all programming languages. It makes indentation more readable by colorizing the indentation on each block of code.
There are some essential extensions which I will recommend for anyone to have installed if working with shared code base repositories.
Once you have these extensions installed , you will be ready to start writing awesome Bash scripts on VS Code Tool and publishing some amazing code-scripts.
What extensions do you find useful for your Bash scripting? Please let me know.