ATOM:将自定义宏添加到文件模板

时间:2018-12-12 09:39:46

标签: atom-editor file-templates

我刚刚发现了包文件模板,并且想将新的宏添加到init.coffee文件中。这是我想要做的:

process.fileTemplates = {
  macros:
     projectpath: ->
       editor = atom.workspace.getActiveTextEditor()
       path = editor.getPath()
       return path
     isodate: ->
       return (new Date()).toISOString().slice(0, 10)
     year: ->
       return (new Date()).getFullYear()
}

isodate和year工作正常,但是在projectpath(编辑器中打开的项目的路径)上我还是不成功。有什么建议或类似的例子吗?预先感谢。

0 个答案:

没有答案
相关问题