苏苏的博客

简约至极

Sublime使用和设置

配置文件

最喜欢的字体Monaco,此处下载

配置文件 Preferences.sublime-settings

{
	"close_windows_when_empty": true,
	"default_encoding": "UTF-8",
	"default_line_ending": "unix",
	"folder_exclude_patterns":
	[
		".svn",
		".git",
		".hg",
		"CVS",
		"node_modules"
	],
	"font_face": "Monaco",
	"font_size": 14,
	"highlight_line": true,
	"highlight_modified_tabs": true,
	"ignored_packages":
	[
		"Vintage"
	],
	"show_encoding": true,
	"show_line_endings": true,
	"tab_size": 4,
	"translate_tabs_to_spaces": false,
	"update_check": false,
	"word_wrap": false
}

插件

open_browser.py 插件

import sublime, sublime_plugin
import webbrowser
import os

url_map = {
    'D:\\git\\bbs\\' : 'http://127.0.0.3/',
    'D:\\php\\su\\' : 'http://127.0.0.2/',
    'D:\\php\\htdocs\\' : 'http://127.0.0.1/'
}

class OpenBrowserCommand(sublime_plugin.TextCommand):
    def run(self,edit):
        window = sublime.active_window()
        window.run_command('save')
        url = self.view.file_name()
        flag = False
        for path, domain in url_map.items():
            if url.startswith(path):
                url = url.replace(path, domain).replace('\\', '/')
                flag = True
                break
        if not flag:
            cmd1='taskkill /f /im php.exe'
            cmd2='php -S 0.0.0.0:8088 -t '+os.path.abspath(os.path.dirname(self.view.file_name()))
            os.system(cmd1)
            os.popen(cmd2)
            url =  'http://127.0.0.1:8088/'+os.path.basename(self.view.file_name())
        webbrowser.open_new(url)

编译系统

node.sublime-build 执行nodejs代码

{
	"shell_cmd": "node ${file}"
}

快捷键配置

Default (OSX).sublime-keymap

[
	{ "keys": ["alt+d"], "command": "open_dir", "args": {"dir": "$file_path", "file": "$file_name"} },
	{ "keys": ["ctrl+shift+c"], "command": "copy_path" },
	{ "keys": ["ctrl+f11"], "command": "toggle_distraction_free" }
]

添加sublime到命令行

MacOs

ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/sublime

激活码

Sublime Text 3 build 3143 LICENSE

—– BEGIN LICENSE —–
TwitterInc
200 User License
EA7E-890007
1D77F72E 390CDD93 4DCBA022 FAF60790
61AA12C0 A37081C5 D0316412 4584D136
94D7F7D4 95BC8C1C 527DA828 560BB037
D1EDDD8C AE7B379F 50C9D69D B35179EF
2FE898C4 8E4277A8 555CE714 E1FB0E43
D5D52613 C3D12E98 BC49967F 7652EED2
9D2D2E61 67610860 6D338B72 5CF95C69
E36B85CC 84991F19 7575D828 470A92AB
—— END LICENSE ——

3103,3126可用激活码

—– BEGIN LICENSE —–
Ryan Clark
Single User License
EA7E-812479
2158A7DE B690A7A3 8EC04710 006A5EEB
34E77CA3 9C82C81F 0DB6371B 79704E6F
93F36655 B031503A 03257CCC 01B20F60
D304FA8D B1B4F0AF 8A76C7BA 0FA94D55
56D46BCE 5237A341 CD837F30 4D60772D
349B1179 A996F826 90CDB73C 24D41245
FD032C30 AD5E7241 4EAA66ED 167D91FB
55896B16 EA125C81 F550AF6B A6820916
—— END LICENSE ——

3103之前版本可用

----- BEGIN LICENSE -----
Andrew Weber
Single User License
EA7E-855605
813A03DD 5E4AD9E6 6C0EEB94 BC99798F
942194A6 02396E98 E62C9979 4BB979FE
91424C9D A45400BF F6747D88 2FB88078
90F5CC94 1CDC92DC 8457107A F151657B
1D22E383 A997F016 42397640 33F41CFC
E1D0AE85 A0BBD039 0E9C8D55 E1B89D5D
5CDB7036 E56DE1C0 EFCC0840 650CD3A6
B98FC99C 8FAC73EE D2B95564 DF450523
------ END LICENSE ------