【发布时间】:2017-03-09 14:00:25
【问题描述】:
我最近从 Geany 文本编辑器切换到 Atom 文本编辑器进行编程。我在 geany 中有很多 python sn-ps。在 geany 中,编写 sn-ps 非常简单。
例如:
# for geany text editor (snippets.conf file)
h=# Author : Bhishan Poudel\n# Date : {date}\n
如果我输入 h 然后回车,我会得到上面的 sn-p 和当前时间。
我们如何在 ATOM 中做到这一点?
到目前为止,我的尝试是这样的:
我像这样编辑了 sn-ps.cson 文件:
'.source.python':
'example1':
'prefix': 'h'
'body': '
#!/usr/bin/env python\n
# -*- coding: utf-8\n
#\nDate: {date}\n
#Imports\n
import numpy as np
'
但是,这并没有奏效。
相关链接为:
Atom editor: snippet for inserting a timestamp
http://flight-manual.atom.io/using-atom/sections/snippets/
Atom Editor: multiple snippets
【问题讨论】:
标签: javascript coffeescript atom-editor code-snippets