应用介绍
Sublime Text 拥有漂亮的用户界面和非凡的功能,而根据其官网介绍,Sublime Text的特点如下:拥有高效、没有干扰的界面,在编辑方面的多选、宏、代码片段等功能,以及很有特色的Minimap。
用户广受喜爱的众多功能之一GOTO ANYTHING
仅仅敲击几次键盘就能即刻jump to symbols, lines or words.Shortcuts: ⌘ + P
要支持一把的官网购买啊http://www.sublimetext.com/啊不花钱看这里:Sublime Text 3 Build 3156
主题插件安装
soda-theme该插件主要能够使sublime 兼容mac的retina屏幕
我采用Git安装最新版本,可以通过菜单 Preferences -> Browse Packages….,定位到你的Sublime Text Packages文件夹,然后在这个文件夹下面 git clone就OK了。
git clone https://github.com/buymeasoda/soda-theme/ "Theme - Soda"
Configure Sublime Text 3
- 打开配置文件: Sublime Text -> Preferences -> Settings - User
- 添加主题:”theme”: “Soda Light 3.sublime-theme”
我自己的主题和字体配置:
插件与配置
安装插件
所有插件都可以使用Package Control安装,按下快捷键⌘⇧P,在命令提示框搜索插件即可。
前端开发 sublime text 常用插件和配置
快捷键
| 符号 | 说明 |
|---|---|
| ⌘ | command |
| ⌃ | control |
| ⌥ | option |
| ⇧ | shift |
| ↩ | enter |
| ⌫ | delete |
Shortcuts: ⌘ + P 即刻jump to symbols, lines or words.
| 快捷键 | 功能 |
|---|---|
@ |
jump to symbols |
# |
查找文件内的单词 |
: |
跳到行号处 |
Preferences -> Key Bindings,在-User文件里自定义快捷键(会覆盖相应的-Default配置)
打开/关闭/前往
| 快捷键 | 功能 |
|---|---|
| ⌘⇧N | 打开一个新的sublime窗口 |
| ⌘N | 新建文件 |
| ⌘⇧W | 关闭sublime,关闭所有文件 |
| ⌘W | 关闭当前文件 |
| ⌘P | GOTO ANYTHING |
| ⌘⇧T | 重新打开最近关闭的文件 |
| ⌘T | 前往文件 |
| ⌘R | 前往method |
| ⌘⇧P | 命令提示 |
| ⌃` | 打开控制台 |
编辑
| 快捷键 | 功能 |
|---|---|
| ⌘KK | 从光标处删除至行尾 |
| ⌘⌫ | 从光标处删除至行首 |
| ⌘KV | paste_from_history |
| ⌘L | Select line - Repeat to select next lines |
| ⌘D | 删除行(⌃⇧K) |
| ⌘E | 选择词(重复按下时多重选择相同的词进行多重编辑)(⌘D) |
| ⌘J | 选择行(重复按下将下一行加入选择) |
| ⌘JL | Join line below to the end of the current line(⌘J) |
| ⌃ + ⇧ + M | Select all contents of the current parentheses |
| ⌃ + M | Jump to closing parentheses Repeat to jump to opening parentheses |
| ⌘⇧↩ | 在当前行前插入新行 |
| ⌘↩ | 在当前行后插入新行 |
| ⌘+shift+y | 改为大写(⌘KU) |
| ⌘+shift+x | 改为小写(⌘KL) |
| ⌘C | 复制 |
| ⌘X | 剪切 |
| ⌘V | 粘贴 |
| ⌘Z | 撤销 |
| ⌘+shift+z | 恢复撤销 |
| ⌘y | 重做 |
| ⌘u | soft_undo |
| ⌘⇧u | soft_redo |
| ⌘/ | 注释 |
| ⌘] | 向右缩进 |
| ⌘[ | 向左缩进 |
| ⌃ + ⇧ + ↑ | 一个或多行向上移动 |
| ⌃ + ⇧ + ↓ | 一个或多行向下移动 |
打开/关闭/前往
| 快捷键 | 功能 |
|---|---|
| ⌘f | 查找 |
| ⌘⌥f | 查找并替换 |
| ⌘⌥g | 查找下一个符合当前所选的内容 |
| ⌘⌃g | 查找所有符合当前选择的内容进行多重编辑 |
| ⌘⇧F | 在所有打开的文件中进行查找 |
| ⌘ + I | Incremental Find |
结语
Preferences -> Key Bindings,在-User文件里自定义快捷键:
[
{ "keys": ["super+shift+y"], "command": "upper_case" },
{ "keys": ["super+shift+x"], "command": "lower_case" },
{ "keys": ["super+j"], "command": "expand_selection", "args": {"to": "line"} },
{ "keys": ["super+j+l"], "command": "join_lines" },
{ "keys": ["super+e+s+f+s"], "command": "slurp_find_string" },
{ "keys": ["super+e"], "command": "find_under_expand" },
{ "keys": ["super+d"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Line.sublime-macro"} }
]