sublimtext快速插入appframework的html分頁

來源:互聯網
上載者:User

標籤:app-framework   jqmobi   sublimetext   

  木塵 日期:2014-11-26

sublimtext快速插入html分頁:

1. 建立外掛程式:

Tools → New Plugin:

import sublime_pluginclass AddAfHtmlCommand(sublime_plugin.TextCommand):    def run(self, edit):        self.view.run_command("insert_snippet",            {                "contents":                "<!DOCTYPE html>""\n"                "<html>""\n""   <head>""\n""   <title></title>""\n""   </head>""\n""   <body>""\n""      <!--header頭部-->""\n""      <header id=\"#\">""\n""         <h1>我是header</h1>""\n""         <a href=\"#\" style=\"left:0.7em\">返回</a>""\n""      </header>""\n""      <!--header  end-->""\n""      <!--content部分-->""\n""      <div class=\"content\" >""\n""      </div>""\n""      <!--content end-->""\n""      <!--footer底部  -->""\n""      <footer id=\"#\">""\n""      </footer>""\n""      <!--footer end  -->""\n""   </body>""\n""   <script  type=\"text/javascript\">""\n""   //進入這個頁面時調用""\n""   function myPageLoadedPanel() {""\n""      //dosomething""\n""   }""\n""   //離開這個頁面時調用""\n""   function myPageUnloadedPanel(){""\n""      //dosomething""\n""   }""\n""   </script>""\n""</html>"            }        )


儲存為Sublime Text 2\Packages\User\addAfHtml.py

2. 建立快速鍵:

Preference → Key Bindings - User:

[    {        "command": "add_af_html",        "keys": [            "ctrl+shift+f5"        ]    }]

3. 此時使用快速鍵ctrl+shift+F5即可在當前游標處插入目前時間,如下:


sublimtext快速插入appframework的html分頁

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.