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语句
cmd命令替换
cmd_success_checkCmd成功检测
curlHTTP请求
dir_bash源代码(Bash)脚本的文件夹
dir_posix源代码脚本(POSIX)的文件夹
dir_zshDirectory of the source script (Zsh)
find查找文件或文件夹
for在列表中的For循环
foreachforeach loop
foreach_kvforeach loop over key-value pairs of associative array
fori循环中的算术
function定义函数
ifif语句
repeatrepeat loop
select选择表达式
tar_compresstar压缩
untiluntil循环条件
whilewhile循环条件

Arrays

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

NameDescription
array_add在数组尾部添加新项目
array_all所有数组元素
array_at_index下标处元素
array_create创建数组
array_delete删除数组
array_delete_at从数组中删除
array_iteration遍历数组
array_length数组长度
array_set_element设置数组下标处的元素

bats-core

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

NameDescription
@testbats-core测试
setup在每个bats-core @test之前执行
setup_file在文件首个setup()之前执行
teardown在每个bats-core @test之后执行
teardown_file在每个文件的最后一个teardown()之后执行
© 2020–2024 Joachim Ansorg
声明
隐私政策
许可条款