sublime text 3 使用简介

1.下载sublime text 3 

http://www.sublimetext.com/3

2.安装插件包管理:调出控制台:view>show console,复制代码到光标闪烁的文本框中,回车.(点开该链接复制,或者直接复制下边代码)

https://sublime.wbond.net/installation

import urllib.request,os,hashlib; h = '7183a2d3e96f11eeadd761d777e62404e330c659d4bb41d3bdf022e94cab3cd0'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)

3.安装使用插件(我安装了BracketHighlighter, alignment, GoToLastEditEnhanced)

http://dengo.org/archives/923

https://packagecontrol.io/packages/GotoLastEditEnhanced

ctrl+shift+p 调出命令框输入install package,等回车后等一会儿,在再次出现的命令框中输入想要安装的插件包名字,选中后回车就行了

bracket highlighter是用来高亮显示代码块儿的,包括PHP和html其它编程语言应该也可以(安装后需要重启sublime)

下边是我觉得不错的配置(preferences>package settings>bracket highlighter>bracket settings-user,复制进去就行了):

{
    "high_visibility_enabled_by_default": true,
    "high_visibility_style": "outline",
    "high_visibility_color": "__default__",
    "match_only_adjacent": true
}

alignment 是用来将等号对齐的,但是它的快捷键和QQ截图的快捷键冲突了,我修改了下(preferences>package settings>alignment>key bindings-user,她的user配置文件和sublime的key bindings-user配置文件共用)

{ "keys": ["alt+a"], "command": "alignment" }

GoToLastEditEnhanced

复制代码
//快捷键绑定
{ "keys": ["ctrl+1"], "command": "goto_last_edit_enhanced", "context": [{"key": "setting.sublime_enhanced_keybindings", "operator": "equal", "operand": true} ] }, //定位到上一次编辑的位置
{ "keys": ["ctrl+2"], "command": "goto_last_edit_enhanced", "args": {"backward": true }, "context": [{"key": "setting.sublime_enhanced_keybindings", "operator": "equal", "operand": true} ] }//定位到下一个编辑的位置

//user 自定义设置
"sublime_enhanced_keybindings": true
复制代码

 

下边的配置是我自己用的sublime的key bindings-user配置

复制代码
[
    { "keys": ["ctrl+`"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Line.sublime-macro"} },
    { "keys": ["ctrl+d"], "command": "duplicate_line" },
    { "keys": ["ctrl+q"], "command": "toggle_comment", "args": { "block": false } },
    { "keys": ["ctrl+shift+q"], "command": "toggle_comment", "args": { "block": true } },
    { "keys": ["alt+a"], "command": "alignment" },
    { "keys": ["alt+z"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} }, // 查找文件名
    { "keys": ["ctrl+1"], "command": "goto_last_edit_enhanced", "context": [{"key": "setting.sublime_enhanced_keybindings", "operator": "equal", "operand": true} ] }, // 定位到上一次编辑的位置
    { "keys": ["ctrl+2"], "command": "goto_last_edit_enhanced", "args": {"backward": true }, "context": [{"key": "setting.sublime_enhanced_keybindings", "operator": "equal", "operand": true} ] } //定位到下一个编辑的位置
]
复制代码

 

说明: 

ctrl+`删除当前行;

ctrl+d 复制当前行,或选中内容

ctrl+q 添加注释,自动判断内容该添加什么样的注释,按第二次取消注释

另外, sublime 的对话框都是可以按键盘的 esc 键关闭的

我的主题/插件设置:

复制代码
 1 {
 2     "color_scheme": "Packages/Color Scheme - Default/Dawn.tmTheme",
 3     "copy_with_empty_selection": false,
 4     "font_size": 11.4,
 5     "highlight_line": true,
 6     "ignored_packages":
 7     [
 8         "Vintage"
 9     ],
10     "word_wrap": false,
11     "sublime_enhanced_keybindings": true //转到上一次编辑的地方用
12 }
复制代码

 

 另: 其它一些快捷键

f12:  转到函数的原始定义文件

ctrl+p : 在当前工程总查找某文件


原文地址:http://www.cnblogs.com/iLoveMyD/p/3529313.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值