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.

NameDescription
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)
findFind file or directory
forFor loop in list
foriArithmetic for loop
functionDefine a function
ifif statement
selectSelect expression
tar_compresstar compress
untilUntil loop by condition
whileWhile loop by condition

Arrays

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

NameDescription
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

bats-core

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

NameDescription
@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–2022 Joachim Ansorg
Imprint
Privacy Policy
Legal