插件系列:
TrailingSpacer 高亮显示多余的空格和Tab
有时候在代码结尾打多了几个空格或Tab,一般不会察觉,TrailingSpacer这款插件能高亮显示多余的空格和Tab,并可以一键删除它们,有代码洁癖的朋友应该会喜欢这个插件。
Deletion
The main feature you gain from using this plugin is that of deleting all trailing spaces in the currently edited document. In order to use this deletion feature, you may either:
click on "Edit / Trailing Spaces / Delete";
bind the deletion command to a keyboard shortcut:
To add a key binding, open "Preferences / Key Bindings - User" and add:
{ "keys": ["ctrl+shift+t"], "command": "delete_trailing_spaces" }
With this setting, pressing Ctrl + Shift + t will delete all trailing spaces at once in the current file! For OSX users, quoting wbond: "When porting a key binding across OSes, it is common for the ctrl key on Windows and Linux to be swapped out for super on OS X" (eg. use "super+ctrl+t" instead).
Beware: the binding from this example overrides the default ST's mapping for reopening last closed file. You can look at the default bindings in "Preferences / Key Bindings - Default".

SideBarEnhancements 侧边栏增强
SideBarEnhancements本是增强侧边栏的插件,这里将教大家如何用来做sublime text 3浏览器预览插件,并可自定义浏览器预览的快捷键。

安装此插件,点击工具栏的preferences > package setting > side bar > Key Building-User,键入以下代码,这里设置按Ctrl+Shift+C复制文件路径,按F1~F2分别在firefox,chrome 浏览器预览效果,当然你也可以自己定义喜欢的快捷键,最后注意代码中的浏览器路径要以自己电脑里的文件路径为准。
{ "keys": ["ctrl+shift+c"], "command": "copy_path" },
//firefox
{ "keys": ["f1"], "command": "side_bar_files_open_with",
"args": {
"paths": [],
"application": "/usr/lib64/firefox/firefox",
"extensions":".*" //匹配任何文件类型
}
},
//chrome
{ "keys": ["f2"], "command": "side_bar_files_open_with",
"args": {
"paths": [],
"application": "/opt/google/chrome/google-chrome",
"extensions":".*"
}
}