下面介绍如何进行安装
1.首先介绍codeformatte的安装和使用
- 使用快捷键 “ Ctl+Shift+P ”,再选择 "Package Control: Install Package"
- 等待列出可安装的插件列表,输入"CodeFormatter"找到它,并点击即可安装.
- 设置CodeFormatter
- 根据自己的编程环境,可通过”Preferences > package setttings > codeFormatter > settings-user“设置一些参数,如PHP的安装路径。
-
{"codeformatter_php_options": { "syntaxes": "php", // Syntax names which must process PHP formatter "php_path": "D:/phpStudy/php/php-7.0.12-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 "php55_compat": false, // PHP 5.5 compatible mode "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 "passes": [], // Disable specific transformations "exclude": [] }, }
-
使用CodeFormatter,使用快捷键 "ctrl+alt+f" 即可
2.开始安装ctags,相对有一点麻烦
- 使用快捷键 “ Ctl+Shift+P ”,再选择 "Package Control: Install Package"
- 等待列出可安装的插件列表,输入"ctags"找到它,并点击即可安装.
- 下载ctags.exe https://download.csdn.net/download/xyf_1995/10556734
- ctags.exe 解压到一个目录,注意要是纯ASCII字符的目录不要带空格或中文命名的目录。
- 打开菜单在Preferences菜单中打开Package settings->ctags->settings-user和settings-default
- 把default中的配置全部复制到user中,然后改一下command配置项,为ctags的可执行文件路径,这里的路径就是ctags.exe存放的路径
{"command": "D:/phpStudy/ctags.exe"}
-
配置ctags,Preferences->Package Settings->CTags->Mouse Binding – User
-
[ { "button": "button1", "count": 1, "press_command": "drag_select", "modifiers": ["ctrl"], "command": "navigate_to_definition" }, { "button": "button2", "count": 1, "modifiers": ["ctrl"], "command": "jump_prev" } ]
-
项目右键选择使用Tags
-
配置成功后ctrl+鼠标左键就可以跳转到该函数,ctrl+鼠标右键就可以调回使用函数的位置
3.以上操作都完成后,你就拥有格式化代码和调转函数的技能了,你就可以愉快的编辑代码啦!!!