我有两台电脑,一台是台式机,一台是笔记本。现在我已经设置了我的环境变量以便通过Dropbox共享链接进行同步。
有没有办法在这两台电脑之间同步我的Sublime Text 3设置,包括所有插件、首选项文件等等... 如果可以的话,如何设置才能正确同步?
我有两台电脑,一台是台式机,一台是笔记本。现在我已经设置了我的环境变量以便通过Dropbox共享链接进行同步。
有没有办法在这两台电脑之间同步我的Sublime Text 3设置,包括所有插件、首选项文件等等... 如果可以的话,如何设置才能正确同步?
Create a gitignore file with the following content:
# Ignore everything...
*
# ... except preferences and package list
!.gitignore
!Preferences.sublime-settings
!Package Control.sublime-settings
Set up the created repository in the user directory (Windows 10: ~/AppData/Roaming/Sublime\ Text\ 3/Packages/User
, Ubuntu: ~/.config/sublime-text-3/Packages/User
) of the first computer with the following Git commands:
$ git init
$ git remote add origin <repository url>
$ git fetch
$ git commit -am "added: settings and packages"
$ git push
Set up the repository on all other computers (the last line overwrites the current settings with those from the repository):
$ git init
$ git remote add origin <repository url>
$ git fetch
$ git reset --hard origin/master
我假设你正在使用Package Control来管理插件。
在你的Packages/User/
文件夹中,包含了插件列表和所有的设置文件,这就是你想同步的内容。假设该文件夹被同步了,那么你只需要确保已安装了Package Control,它会根据你同步的插件列表自动安装正确的插件。
请查看Package Control网站上的这个页面以获取同步设置的指令。
上述技巧主要包括直接在你的Packages/User/
文件夹中使用Git或者结合符号链接(因为你的Dropbox目录和Sublime Text安装目录可能不在硬盘上相同的位置)使用Dropbox(虽然相同的概念也适用于任何云服务)。
使用SyncSettings软件包。只需30秒钟即可设置。
实际上有一种方法可以在不同设备之间同步Sublime用户设置和软件包数据。请查看这个视频教程,这是Sublime Text开发者社区推荐给我的。同步你的Sublime Text数据
可以通过使用Google Drive的两个步骤完成:
下载Mac/Windows版Drive(https://www.google.com/drive/download/)
同步此文件夹:C:\Users\{user_name}\AppData\Roaming\Sublime Text 3\Packages\User
(右键单击并同步)
这包括所有Sublime设置、软件包设置、按键绑定和所有已安装软件包的列表。
只需在新计算机上替换此文件夹,您就可以使用了。