bash - Atom Snippets 不适用于 Shell 脚本

标签 bash shell ubuntu atom-editor code-snippets

我正在尝试为 Shell 脚本的标题制作一个片段,
#!/bin/bashName of programAuthor
还有那种东西。但我的片段不起作用!
这是我的片段:

"'.text.sh':
  'Headings':
    'prefix': 'head'
    'body': '#!/bin/bash

    # Author:

    # Name:

    # Date of Completion (Update)
    # Date of LEGACY'"

(抱歉,它与空格等的外观不完全一致。但我对其进行了编辑,使其尽可能接近。)

最佳答案

正确的定义是:

'.source.shell':
  'Headings':
    'prefix': 'head'
    'body': """
      #!/bin/bash

      # Author:

      # Name:

      # Date of Completion (Update)
      # Date of LEGACY'
    """
.source.shell可以使用 Editor: Log Cursor Scope 找到定义在打开 shell 脚本时执行命令。

请注意,正文包含多行字符串;它不在多行字符串本身内。

关于bash - Atom Snippets 不适用于 Shell 脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44116293/

相关文章:

bash - 长时间运行的 bash 脚本导致可用 PID 的资源泄漏

regex - [[ :upper:]] and [:upper:] (bash)? 之间有什么区别

linux - 应用修改后的Ubuntu程序源代码

c - MPI_Comm_size 始终返回 1

windows - 如何解决这个 ansible kerberos 错误?

bash - Bash 转义字符 "\c"是什么?

linux - Bash 命令在循环内不起作用

bash - 从具有重复条目名称的 tar 文件中提取

bash - +30 别名的 fish shell 列表

shell - 需要一个 shell 脚本将逗号分隔符更改为管道分隔符