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.


The following live templates are available in a command context.

caseCase statement
cmdCommand substitution
cmd_success_checkCmd success check
curlHTTP request
dir_bashDirectory of the source script (Bash)
dir_posixDirectory of the source script (POSIX)
dir_zshDirectory of the source script (Zsh)
findFind file or directory
forFor loop in list
foreachforeach loop
foreach_kvforeach loop over key-value pairs of associative array
foriArithmetic for loop
functionDefine a function
ifif statement
repeatrepeat loop
selectselect expression
tar_compresstar compress
untiluntil loop with condition
whilewhile loop with condition


The following live templates are available in contexts where arrays can be used.

array_addAdd new item to the end of array
array_allAll array elements
array_at_indexElements at index
array_createCreate array
array_deleteDelete array
array_delete_atDelete from array
array_iterationIterate through array
array_lengthArray length
array_set_elementArray set element at index


The following live templates are available in bats-core files.

@testbats-core test
setupExecuted before each bats-core @test
setup_fileExecuted before the first setup() of a file
teardownExecuted after each bats-core @test
teardown_fileExecuted after the last teardown() of a file
© 2020–2024 Joachim Ansorg
Privacy Policy