Suggestions for improving live templates for if and case statements
Hi author. After several months of heavy use of this plugin, here are some suggestions for improvement (some of which have been mentioned):
if
As mentioned below: https://github.com/BashSupport-Pro/bashsupport-pro/issues/117#issue-1453053912
Let me provide you with the feelings of these statements. I recommend that you set all of them as templates in later versions, because they are so practical.
if [ ... ] ...
Single bracket is the traditional form in POSIX, and is often implemented as an external command. Using this method can be compatible with almost all shells without much adaptation testing and modification. But most of its judgment methods can't be understood if you haven't studied or understood it.
E.g. sh and ash shell is widely used for router os such as OpenWRT, its based OS or android phone(busybox).
When writing scripts, I need to add a lot of judgment processes for compatibility, ranging from dozens to hundreds. But now the plug-in version defaults to double brackets, which cannot be used in these environments, so I need to manually change these hundreds of double brackets to single brackets, which really drives me mad.
code:
if [ ]; then
:
fi
Tip window now is(first line):
It can change to:
if [ ... ]
if [[ ... ]] ...
Double square brackets can only be used in enhanced shells such as linux bash or macos zsh, which are often not compatible in POSIX. But this way of judging often uses mathematical symbols, so it is very readable and I don't have to input too many extra symbols. The current version of BashSupport-Pro uses this method by default.
code:
if [[ ]]; then
:
fi
Tip window can change to:
if [[ ... ]]
if command; ...
A way to test whether the command to be executed can be executed normally, and then perform different processing according to the success or failure of the execution. It is completely different from the difference between single or double square brackets above. It is a very independent judgment method. Using this method does not need to capture the return value of the command execution separately.
code:
if command; then
:
fi
Tip window can change to:
if command true/false
case
Is it possible to change the automatic indentation of this template from 2 spaces to 4 spaces in the next version?
Now:

case $taskName in
pattern)
:
;;
esac
When I click ENTER at the end of line with "pattern)". IDEA will to the next line with 4 spaces as default. I have to make other line to 4 spaces or delete 2 spaces of the new line every time.
Changing to:

case $taskName in
pattern)
:
;;
esac
# or
case $taskName in
pattern)
:
;;
esac
This way might be better.
Thank you for your feedback!
I‘ll look into the case formatting and what may be wrong here.
regarding the if live template: in version 3.0, this was updated to adapt to the current shell type. With a POSIX shebang like „/bin/sh“ the live template „if“ would insert „[]“, but with a Bash shebang like „/usr/bin/bash“ it should insert „[[ ]]“ brackets.
Which version of the plugin are you using? If this does not work for you, which shebang line and file extension do you use?
I‘ll also look into a new template for „if command;…; fi“.