SublimeText常用命令设置

/ 0评 / 0

SublimeText常用命令设置方法与代码如下

具体功能如下:

ctrl+c:复制文件路径

ctrl+j:复制当前行

ctrl+v:php打印快捷键

ctrl+a:多行显示作者信息与当前时间如下显示效果

/*
 * @Author:      m@jinjiajin.net
 * @DateTime:    2016-09-28 12:11:23
 * @Description: Description
 * @param:       
 */
/* end */

ctrl+d:单行显示作者信息与当前时间,如下显示效果

//@Author:  m@jinjiajin.net @DateTime:  2016-09-28 12:17:33

ctrl+b:日志快捷键,如下显示效果

file_put_contents(DATA_DIR.'/abcde.log',var_export($,true),FILE_APPEND);
import sublime_plugin
class VarDumpCommand(sublime_plugin.TextCommand):
    def run(self, edit):
        self.view.run_command("insert_snippet", 
            {
                "contents":"echo '
';var_dump(\$);exit;"
            }
        )

import sublime_plugin
class FilePutContentsCommand(sublime_plugin.TextCommand):
    def run(self, edit):
        self.view.run_command("insert_snippet", 
            {
                "contents":"file_put_contents(DATA_DIR.'/abcde.log',var_export(\$,true),FILE_APPEND);"
            }
        )

import datetime
import sublime_plugin
class AddInfoCommand(sublime_plugin.TextCommand):
    def run(self, edit):
        self.view.run_command("insert_snippet",
            {
                "contents": "/*""\n"
                " * @Author:      m@jinjiajin.net""\n"
                " * @DateTime:    ""%s"  % datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")+"\n"
                " * @Description: Description""\n"
                " * @param:       ""\n"
                " */""\n"
                "\n"
                "\n"
                "\n"
                "/* end */"
            }
        )


import datetime
import sublime_plugin
class AddInfoSimpleCommand(sublime_plugin.TextCommand):
    def run(self, edit):
        self.view.run_command("insert_snippet",
            {
                "contents": "//@Author:  m@jinjiajin.net @DateTime:  ""%s"  % datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
            }
        )

下面设置快捷键,设置位置图与代码如下:

发表评论

电子邮件地址不会被公开。 必填项已用*标注