# 插入當前時間插件
### 制作插件
插件放置地址,工程路徑:`Sublime Text 3x64\Data\Packages\User\addCurrentTime.py`
創建文件:**addCurrentTime.py**
輸入一下代碼:
~~~
import datetime
import sublime_plugin
class AddCurrentTimeCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.view.run_command("insert_snippet",
{
"contents": "%s" % datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
}
)
~~~
### 設置調用
開發工具路徑:`Preference → Key Bindings - User `
~~~
[
{"keys": ["shift+alt+d"], "command": "add_current_time"}
]
~~~
### 使用快捷 :
~~~
shift+alt+d
~~~
- 序言
- 安裝
- 漢化
- 快捷鍵 Win
- 快捷鍵 MAC
- Features(功能)
- Alignment
- 設置字體及字體大小
- 自定制代碼片段
- 快速補全
- HTML
- CSS
- 安裝插件
- Emmet
- JsMinifier
- Sublime CodeIntel
- Bracket Highlighter
- CSScomb CSS
- SublimeTmpl
- SideBarEnhancements
- ColorPicker
- Tag
- Clipboard History
- GBK to UTF8
- SFTP
- WordPress
- PHPTidy
- YUI Compressor
- SublimeLinter
- ConvertToUTF8
- AutoFileName
- IMESupport
- FileDiffs
- View In Browser
- HTML-CSS-JS Prettify
- 插件開發
- sublime插件開發教程(附源碼)
- 插入當前時間插件
- 自定義插件
- Sublime-thinkphp
- 其他技術
- 添加右鍵打開的操作
- 激活
- Sublime Text3 3103 激活碼
- 常見錯誤
- an error occurred installing package control
- Sublime Text 全局搜索Ctrl+Shift+F快捷鍵不能用