修改sublime Text 的默认配置文件位置

2014-08-06

安装完sublime text2,在第一次运行的时候,sublime text2 会在C盘的%AppData\Roaming%目录下生成一个Sublime Text 2的文件夹,用于存放配置文件,以及后面安装的各种插件(所以第一次打开sublime text2时会比较慢)

要做的第一件事情就是把这个文件移动安装目录,便于设置完后打包。

找到sublime text2的安装目录,并在该目录下新建 Data 文件夹(注意大小写)。如果已经运行了,先删除%AppData\Roaming%目录下的sublime text2文件夹。

完成这一步之后再打开sublime text2所有的配置文件都会被生成在Data文件夹中了

使用Package Control组件安装

1、按Ctrl+`调出console

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())

3、重启Sublime Text 2。

4、如果在Perferences->package settings中看到package control这一项,则安装成功。

发表评论

邮箱地址不会被公开。 必填项已用*标注