sublime text 的相关配置

来源:互联网 发布:mac excel导出图片 编辑:程序博客网 时间:2024/06/05 10:03
需要安裝DocBlockr(文档头部注释生成),SublimeLinter(代码检测),codeFormatter(格式化插件),ConvertToUTF8(解决中文乱码)GBK Support(GBK编码支持)插件
step1:Preferences -> Package Control;
step2:框内输入命令Install Package回车;
step3:继续在框内输入插件名,选中需要的后安装即可。
其中SublimeLinter需要node.js 环境支持,安裝node.js后。
运行下面命令即可
npm install -g jshintnpm install -g csslintnpm install -g phplint

其中codeFormatter快捷键为:ctrl+alt+f,如果需要配置php格式化,則需要在Preference->Package setting->codeFormatter-> setting users下添加配置(JSON格式文档)
{"codeformatter_php_options":{"syntaxes": "php", // Syntax names which must process PHP formatter"php_path": "e:/phpStudy/php/php-5.6.27-nts/php.exe", // Path for PHP executable, e.g. "/usr/lib/php" or "C:/Program Files/PHP/php.exe". If empty, uses command "php" from system environments"format_on_save": false, // Format on save. Either a boolean (true/false) or a string regexp tested on filename. Example : "^((?!.min.|vendor).)*$""psr1": false, // Activate PSR1 style"psr1_naming": false, // Activate PSR1 style - Section 3 and 4.3 - Class and method names case"psr2": true, // Activate PSR2 style"indent_with_space": 4, // Use spaces instead of tabs for indentation"enable_auto_align": true, // Enable auto align of = and =>"visibility_order": true, // Fixes visibility order for method in classes - PSR-2 4.2"smart_linebreak_after_curly": true, // Convert multistatement blocks into multiline blocks// Enable specific transformations. Example: ["ConvertOpenTagWithEcho", "PrettyPrintDocBlocks"]// You can list all available transformations from command palette: CodeFormatter: Show PHP Transformations// You can also see examples of many transformations at https://github.com/akalongman/sublimetext-codeformatter/blob/master/PHP-Transformations.md"passes": [],// Disable specific transformations"excludes": []}}

原创粉丝点击