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")
            }
        )

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

Sublime Text 3.2.2 (3211)激活码

----- BEGIN LICENSE -----
Member J2TeaM
Single User License
EA7E-1011316
D7DA350E 1B8B0760 972F8B60 F3E64036
B9B4E234 F356F38F 0AD1E3B7 0E9C5FAD
FA0A2ABE 25F65BD8 D51458E5 3923CE80
87428428 79079A01 AA69F319 A1AF29A4
A684C2DC 0B1583D4 19CBD290 217618CD
5653E0A0 BACE3948 BB2EE45E 422D2C87
DD9AF44B 99C49590 D2DBDEE1 75860FD2
8C8BB2AD B2ECE5A4 EFC08AF2 25A9B864
------ END LICENSE ------

发表评论

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