sublime插件安装记录
-
自定义快捷键
-
普通就不记录了,就记录几个安装比较复杂的
-
一,安装ctags 函数名和函数之间跳来跳去用的插件
-
二,HTMLPrettify 代码美化,支持html js css 需要先安装node.js
-
三,phpfmt php美化
-
四,CodeFormatter 代码美化,支持php js html css scss python visual basic/vbscript
-
五,bootstrap autocompleate
-
六,bootstrap snippets
-
七,颜色值高亮,显示颜色 名:color highter
自定义快捷键
//insert nums和advensednewfile冲突,ctrl+alt+n用于newfile,ctrl+alt+1用于insert
{ "keys": ["ctrl+alt+1"], "command": "prompt_insert_nums" },
{ "keys": ["ctrl+alt+n"], "command": "advanced_new_file_new"},
//gotodocumentation的super+shift+h改为f1
{ "keys": ["f1"], "command": "goto_documentation" },
//设置hjkl左下上右方向键移动步骤一,先改系统占用,k改m 其他三个加alt
{ "keys": ["ctrl+alt+h"], "command": "show_panel", "args": {"panel": "replace", "reverse": false} },
{ "keys": ["ctrl+alt+j"], "command": "join_lines" },
{ "keys": ["ctrl+alt+l"], "command": "expand_selection", "args": {"to": "line"} },
{ "keys": ["ctrl+m", "ctrl+up"], "command": "new_pane" },
{ "keys": ["ctrl+m", "ctrl+shift+up"], "command": "new_pane", "args": {"move": false} },
{ "keys": ["ctrl+m", "ctrl+down"], "command": "close_pane" },
{ "keys": ["ctrl+m", "ctrl+left"], "command": "focus_neighboring_group", "args": {"forward": false} },
{ "keys": ["ctrl+m", "ctrl+right"], "command": "focus_neighboring_group" },
{ "keys": ["ctrl+m", "ctrl+shift+left"], "command": "move_to_neighboring_group", "args": {"forward": false} },
{ "keys": ["ctrl+m", "ctrl+shift+right"], "command": "move_to_neighboring_group" },
//设置hjkl左下上右方向键移动步骤二,再看k改m 其他三个加alt后,是否有新的冲突,m原来有一个,其他没有,m加alt
{ "keys": ["ctrl+alt+m"], "command": "move_to", "args": {"to": "brackets"} },
//设置hjkl左下上右方向键移动步骤三,设置以下四个键
{ "keys": ["ctrl+h"], "command": "move", "args": {"by": "characters", "forward":false} },
{ "keys": ["ctrl+j"], "command": "move", "args": {"by": "lines", "forward":true} },
{ "keys": ["ctrl+k"], "command": "move", "args": {"by": "lines", "forward":false} },
{ "keys": ["ctrl+l"], "command": "move", "args": {"by": "characters", "forward":true} },
普通就不记录了,就记录几个安装比较复杂的
一,安装ctags 函数名和函数之间跳来跳去用的插件
-
ctrl+shift+p install ctags
-
到官网下载ctags软件
<a href="https://sourceforge.net/projects/ctags/files/ctags58.zip">官网下载</a>
该文件解压到d:/lvseruanjian/ctags58/
-
在sublime中配置ctags路径,从默认里复制一份到用户配置里,修改command的值为
"command": "D:\lvseruanjian\ctags58\ctags.exe",
-
项目文件夹上点右键 创建ctags文件
即可使用了
- 修改快捷键
光标所在函数名上,默认按ctrl+ t +t 跳到对应的函数定义的地方
ctrl+t+b 返回上一次光标所在
二,HTMLPrettify 代码美化,支持html js css 需要先安装node.js
1.ctrl+shift+p install html+js+cssprettify
2.配置node.js路径
3.使用快捷键ctrl+shift+h即可格式化html css js代码了
4.还可以配置格式
三,phpfmt php美化
-1. ctrl+shift+p install phpmft
-2. 下载最新的php到自己的目录,PHP版本必须是7.0或7.0以上
如 D:\server\php\php-7.1.0-nts-Win32-VC14-x64
- 配置phpmft的php路径
从默认配置中复制以下代码到用户配置文件,并修改php_bin的路径和去掉前面的//,format_on_save的如果要保存即格式化的话也去掉//
{
"version": 4,
// "php_bin":"/usr/local/bin/php",
// "format_on_save":true,
"option": "value"
}
结果如下:
{
"version": 4,
"php_bin":"D:\\server\\php\\php-7.1.0-nts-Win32-VC14-x64\\php.exe",
"format_on_save":true,
"option": "value"
}
配置方法:
ctrl+shift+p 输入list pakage 找到phpfmt 回车打开所在文件夹,查看readMe文件,里面是一些使用帮助和介绍
配置等号对齐,
ctrl+shift+p 输入phpfmt 找到toggle additional transformation
以下几项是关于等号对齐的
"AlignConstVisibilityEquals",
"AlignEquals",
"AlignDoubleArrow",
"AlignDoubleSlashComments"
"AlignGroupDoubleArrow"
选中后会自动加到phpfmt的用户配置的passes项里,格式化时,连着的行会等号对齐。
配置psr2
-
使用 ctrl+f11格式化php代码
我这里开了保存自动美化功能
还有,当有语法错误时,ctrl+f11没反应
其实codeformatter的php美化也是用的phpfmt:toggle
四,CodeFormatter 代码美化,支持php js html css scss python visual basic/vbscript
-
ctrl+shift+p install codefor
-
配置php路径
"php_path": "", // Path for PHP executable, e.g. "/usr/lib/php" or "C:/Program Files/PHP/php.exe". If empty, uses command "php" from system environments
改为:
"php_path": "D:\\server\\php\\php-5.6.29-nts-Win32-VC11-x64\\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
-
他默认的快捷键是ctrl+alt+f
-
用ctrl+alt+f php尾部的?>会被去掉,不知道是不是php版本是5.6.29的原因。
phpmft的ctrl+f11不会,用的php是7.1.0的
不知道为什么,ctal+alt+f不起作用了。卸载了。
以后格式化php还是用phpfmt的自定义快捷键ctrl+f11
格式化html css js用htcml/css/js prettify 的ctrl+shift+h
phptidy装了没用,又卸载了
PS:用户配置文件添加:
"update_check":false,
意思就是说不要检查更新:
`"update_check":false,是不检查更新`
五,bootstrap autocompleate
写html里class的时候会自动弹出bootstrap的class
六,bootstrap snippets
bs开头的bootstrap代码段
网友评论