macos 如何保存/恢复 Sublime Text 2 配置/插件以迁移到另一台计算机?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11365948/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to save/restore Sublime Text 2 configs/plugins to migrate to another computer?
提问by earlyadopter
I need to migrate from one Mac to another, and want Sublime Text 2 on a new computer to have all the same configuration/plugins I have installed on the old one.
我需要从一台 Mac 迁移到另一台 Mac,并希望新计算机上的 Sublime Text 2 具有我在旧计算机上安装的所有相同配置/插件。
Is there some folder(s) I could just copy and restore on another one to replicate everything?
是否有一些文件夹我可以在另一个文件夹上复制和恢复以复制所有内容?
回答by jdc0589
I just set up a good solution for this, it requires dropbox. I am currently using this to sync plugins and settings across ~5 different sublime installs on windows, linux, osx, and a few vm's.
我只是为此设置了一个很好的解决方案,它需要 dropbox。我目前正在使用它在 windows、linux、osx 和一些 vm 上的 ~5 个不同 sublime 安装中同步插件和设置。
Step 1: use PackageControlto manage all your plugins, its awesome.
Step 2: Add a "Sublime" directory to your root drop-box directory (I replicated the full directory structure for the hell of it,
{DropBox}/Sublime/Packages/User
). Make sure sublime is closed, and move the contents of{SublimeRoot}/Packages/User
in to the dropbox directory you just made. Delete{SublimeRoot}/Packages/User
, and replace it with a symlink that points to{DropBox}/Sublime/Packages/User
.
第 1 步:使用PackageControl管理所有插件,太棒了。
第 2 步:将一个“Sublime”目录添加到您的根下拉框目录中(我复制了完整的目录结构
{DropBox}/Sublime/Packages/User
)。确保 sublime 已关闭,并将{SublimeRoot}/Packages/User
in的内容移动到您刚刚创建的 dropbox 目录中。删除{SublimeRoot}/Packages/User
,并将其替换为指向 的符号链接{DropBox}/Sublime/Packages/User
。
Use this same process on every computer where you use sublime, it accomplishes 2 things.
在使用 sublime 的每台计算机上使用相同的过程,它完成两件事。
1) The contents of your
User/
directory are synced, so all your custom settings are the same across machines.2) Every time PackageControl starts up, it checks the
Package Control.sublime-settings
in yourUser/
directory. If if finds a plugin that should be installed according to the settings, but isn't actually installed, it automatically installs it, no questions asked.
1) 您的
User/
目录内容是同步的,因此您的所有自定义设置在机器之间都是相同的。2) 每次 PackageControl 启动时,它都会检查
Package Control.sublime-settings
您的User/
目录中的 。如果发现根据设置应该安装的插件,但实际上没有安装,它会自动安装它,不问任何问题。
Setting up another computer with this solution simply requires sublime and package control to be installed, then just delete the {SublimeRoot}/Packages/User/
directory and point it to the copy in dropbox with a symbolic link. Next time you fire up sublime, package control will automatically install all your plugins.
使用此解决方案设置另一台计算机只需要安装 sublime 和 package control,然后只需删除{SublimeRoot}/Packages/User/
目录并将其指向带有符号链接的 dropbox 中的副本。下次启动 sublime 时,包控制将自动安装所有插件。
Creating the symbolic links: execute from the {Sublime}/Packages
directory
创建符号链接:从{Sublime}/Packages
目录执行
- Windows:
mklink /D .\User C:\Users\[username]\Dropbox\Sublime\Packages\User
- Linux/OSX:
ln -s {DropboxRoot}/Sublime/Packages/User ./User
- 窗户:
mklink /D .\User C:\Users\[username]\Dropbox\Sublime\Packages\User
- Linux/OSX:
ln -s {DropboxRoot}/Sublime/Packages/User ./User
回答by Maxim Yefremov
Add directory ~/Library/Application Support/Sublime Text 2/Packages
to git repository. For example bitbucket. So you can commit after any changes with plugins and settings. If something failes with sublime text2 you can easy rollback.
将目录添加~/Library/Application Support/Sublime Text 2/Packages
到 git 存储库。例如bitbucket。因此,您可以在对插件和设置进行任何更改后提交。如果 sublime text2 出现问题,您可以轻松回滚。
回答by Amol
BACKUP SUBLIME TEXT
备份崇高的文本
- Copy files from
C:\Users\[userName]\AppData\Roaming\Sublime Text 2\
The file location can be found by using - Open Sublime Text -> Browse Packages - Close Sublime Text
- Backup all the folder from Sublime Text 2 Folder
a. Sublime Text 2/Installed Packages
b. Sublime Text 2/Packages
c. Sublime Text 2/Pristine Packages
d. Sublime Text 2/Settings
- 从
C:\Users\[userName]\AppData\Roaming\Sublime Text 2\
文件位置复制文件可以通过使用 - Open Sublime Text -> Browse Packages 找到 - 关闭 Sublime 文本
- 备份 Sublime Text 2 文件夹中
的所有文件夹a。Sublime Text 2/已安装的包
b. Sublime Text 2/Packages
c. Sublime Text 2/Pristine Packages
d. Sublime Text 2/设置
NEW INSTALLATION
新安装
- Now replace all the backup files in new installation
C:\Users\[NewUserName]\AppData\Roaming\Sublime Text 2\
- The file location can be found by using - Open Sublime Text -> Browse Packages
- Close Sublime Text
- If you get error unable to save work-space
- Create a new Project
- Save Project
- Exit
- Restart Sublime Text
- 现在替换新安装中的所有备份文件
C:\Users\[NewUserName]\AppData\Roaming\Sublime Text 2\
- 文件位置可以通过使用 - Open Sublime Text -> Browse Packages 找到
- 关闭 Sublime 文本
- 如果出现无法保存工作空间的错误
- 创建一个新项目
- 保存项目
- 出口
- 重启 Sublime Text