Live Templates
BashSupport provides live templates for your shell scripts. Please refer to JetBrains’ documentation about live templates to learn how to use this feature of your IDE.
Commands
The following live templates are available in a command context.
Name | Beschreibung |
---|---|
case | Case statement |
cmd | Command substitution |
cmd_success_check | Cmd success check |
curl | HTTP request |
dir_bash | Directory of the source script (Bash) |
dir_posix | Directory of the source script (POSIX) |
dir_zsh | Directory of the source script (Zsh) |
find | Find file or directory |
for | For loop in list |
foreach | foreach loop |
foreach_kv | foreach loop over key-value pairs of associative array |
fori | Arithmetic for loop |
function | Define a function |
if | if statement |
repeat | repeat loop |
select | select expression |
tar_compress | tar compress |
until | until loop with condition |
while | while loop with condition |
Arrays
The following live templates are available in contexts where arrays can be used.
Name | Beschreibung |
---|---|
array_add | Add new item to the end of array |
array_all | All array elements |
array_at_index | Elements at index |
array_create | Create array |
array_delete | Delete array |
array_delete_at | Delete from array |
array_iteration | Iterate through array |
array_length | Array length |
array_set_element | Array set element at index |
bats-core
The following live templates are available in bats-core files.
Name | Beschreibung |
---|---|
@test | bats-core test |
setup | Executed before each bats-core @test |
setup_file | Executed before the first setup() of a file |
teardown | Executed after each bats-core @test |
teardown_file | Executed after the last teardown() of a file |