Skip to content

Instantly share code, notes, and snippets.

@axhello
Last active February 18, 2016 04:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save axhello/6ebae35931f4c71f70c5 to your computer and use it in GitHub Desktop.
Save axhello/6ebae35931f4c71f70c5 to your computer and use it in GitHub Desktop.
Sublime Text 3 插件整理文档

Package Control

通过快捷键ctrl+``,或者菜单View` > `Show Console` 打开控制台;

import urllib.request,os,hashlib; h = '2915d1851351e5ee549c20394736b442' + '8bc59f460fa1548d1514676163dafc88'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)

Github: https://github.com/wbond/package_control

Emmet

这个就不用细说了吧。如果还不懂就点去好好看看吧。

中文文档: http://www.w3cplus.com/tools/emmet-cheat-sheet.html

BracketHighlighter

该插件提供行数列高亮的各种配对的语法符合。注:就是将配对的括号等显示在行数列上。

ChineseLocalization

安装后即可立即汉化..支持简体、繁体、日语、英语等...

ColorPicker

颜色取色器

使用方法:Ctrl + Shift + C

SideBarEnhancements

侧边栏增强型菜单...不多说了😳

HTML-CSS-JS Prettify

一款代码格式化插件...

  • 配置node的路径

Sublime Text->Preferences->Packages settings->HTML-CSS-JS Prettify->Set'node'Path

  • 将对应的系统的路径改为你nodejs的路径
"node_path": {
    "windows": "C:/Program Files/nodejs/node.exe",
    "linux": "/usr/bin/nodejs",
    "osx": "/usr/local/bin/node"
  }
  • 使用

快捷键:win:Ctrl+Shift+H mac:Command+Shift+H

Github: https://github.com/HolicEro/HTML-CSS-JS-Prettify-Custom

SublimeCodeIntel

SublimeCodeIntel具有自动提示功能。

扩展的作用是,按住alt+鼠标左键(Mac下可能是ctrl键),可以实现自定义函数之间的跳转,方便查找和修改函数内容和读写代码!

  • 生成config Preferences->Browse Packages->SublimeCodeIntel然后添加一个.codeintel文件夹,在文件夹里面添加一个config文件 Windows创建.codeintel文件夹需要输入.codeintel; Mac直接终端touch 一个.codeintel就行了。

  • config文件配置:

{
    "PHP": {
        "php": '/usr/bin/php',
        "phpExtraPaths": [],
        "phpConfigFile": 'php.ini'
    },
    "JavaScript": {
        "javascriptExtraPaths": []
    },
    "Perl": {
        "perl": "/usr/bin/perl",
        "perlExtraPaths": []
    },
    "Ruby": {
        "ruby": "/usr/bin/ruby",
        "rubyExtraPaths": []
    },
    "Python": {
        "python": '/usr/bin/python',
        "pythonExtraPaths": []
    },
    "Python3": {
        "python": '/usr/bin/python3',
        "pythonExtraPaths": []
    }
}

看你所需要的语言,自己配置路径就行了,然后打开Sublime创建个文件试一下,如果还不行就按下 ctrl+shift+space 开启提示功能。

Github: https://github.com/SublimeCodeIntel/SublimeCodeIntel

PHP Companion

这款插件...怎么说呢?功能主要在于编写php时能想phpstorm那样便捷的生成一些代码,快速的引入命名空间。

详细使用教程:https://laracasts.com/series/sublime-text-mastery/episodes/7

Github: https://github.com/erichard/SublimePHPCompanion

PHP Getters and Setters

同上,详细使用教程:https://laracasts.com/series/sublime-text-mastery/episodes/7

Github: https://github.com/francodacosta/sublime-php-getters-setters

phpfmt

phpfmt大法好(空樱酱如是说)

phpfmt是一款能让你保持着php psr规范的Code Style的插件,关于phppsr规范,请看:

安装后通过编辑(phpfmt.sublime-settings)文件,去掉注释或编辑 "php_bin": "/usr/local/bin/php",为你的php路径。

下面是参考文件(来自空樱酱):

{ 
    "enable_auto_align": false,
    "format_on_save": false,
    "indent_with_space": false, 
    "passes": [ "AllmanStyleBraces" ],
    "php55warning": true, 
    "php_bin": "/usr/local/bin/php",
    "psr2": true,
    "version": 4
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment