现在的位置: 首页 > 综合 > 正文

sublime text2使用和设置

2017年04月11日 ⁄ 综合 ⁄ 共 2548字 ⁄ 字号 评论关闭

以下二篇是网上有人写好的,对sublime text想试用一下的,可以参考一下。

http://lucifr.com/139225/sublime-text-2-tricks-and-tips/

http://hhuai.github.com/blog/2012/01/08/sublime-text-intro/

我的设置:

Key Bindings User: 快捷键

[
    { "keys": ["super+;"], "command": "auto_complete" },
    { "keys": ["super+l"], "command": "show_overlay", "args": {"overlay": "goto", "text": ":"} },
    { "keys": ["super+d"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"} },
    { "keys": ["alt+super+r"], "command": "find_all_under" },
    { "keys": ["shift+enter"], "command": "run_macro_file", "args": {"file": "Packages/Default/Add Line.sublime-macro"} },
    { "keys": ["super+shift+enter"], "command": "run_macro_file", "args": {"file": "Packages/Default/Add Line Before.sublime-macro"} }
]
// super在Mac里指的是Cmd键
// 删除当前行: Cmd + d
// 自动补全: Cmd + ;
// 跳到行: Cmd + l
// 修改当前文件中所有的同一个单词: Cmd + Alt + r
// 列出所有的函数 Cmd + r 
// 在下一行插入行: Shift + Enter
// 在上一行插入行: Shift + super + Enter
File Settings User: 编辑行为
{
"color_scheme": "Packages/Color Scheme - Default/LAZY.tmTheme",
"ensure_newline_at_eof_on_save": true,
"fade_fold_buttons": false,
"font_size": 14.0,
"gutter": true,
"highlight_line": false,
"line_numbers": false,
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true
}
Global Settiings User:
{
"ignored_packages":
[
"Vintage"
],
"open_files_in_new_window": false,
"theme": "Soda Dark.sublime-theme"
}
安装插件: 
1. 安装Package Control: 按下cmd + `打开Console,输入下面的命令,安装好后重启Sublime Text 2

import urllib2,os;pf='Package Control.sublime-package';ipp=sublime.installed_packages_path();os.makedirs(ipp) if not os.path.exists(ipp) else None;open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read())
2. Cmd + Shift + P,输入install,然后再输入下面几个插件的名字安装
    2.1 Format SQL // 格式化SQL
    2.2 Indent XML // 格式化XML
    2.3 Theme - Soda // 安装Soda 主题
    2.4 ZenCoding  // ZenCoding网页前端开发者的利器
    2.5 SublimeRope // Python自动补全,打开文档,...
3. 安装皮肤:Theme - Soda
修改自动补全窗口中被选中项的背景: code-completion-row-selected.png
效果:
不喜欢显示关闭按钮,但未保存的文档需要显示一个圆点表示未保存:
    {
        // Tab button size
        "class": "tab_close_button",
        "settings": ["show_tab_close_buttons"],
        "content_margin": [0, 0] // Note: 隐藏关闭按钮
    },
    // Tab dirty button
    {
        "class": "tab_close_button",
        "parents": [{"class": "tab_control", "attributes": ["dirty"]}],
        "layer0.texture": "Theme - Soda/Soda Dark/tab-dirty.png",
        "layer0.opacity": 1.0,
        "layer1.opacity": 0.0,
        "content_margin": [8, 8] // Note: 当文档被修改时,显示未保存按钮
    },
代码着色主题:微微修改过的Espresso Soda
代码着色主题:微微修改过的Black Perl: 

 

背景微微亮点,也许有时候更舒服:

抱歉!评论已关闭.