Is there a way to sync Sublime Text settings across multiple computers?

梦想的初衷 提交于 2019-12-31 08:55:50

问题


I have two computers, a desktop and a laptop. Now I have set up my ENV to sync with the help of a dropbox link.

Is there a way to sync my Sublime Text 3 settings between these two computers including all my plugins, preference files, etc... and, if so, how can I set things up to sync properly?


回答1:


I am assuming you are using Package Control for managing your plugins.

What to Sync

Both a list of your packages as well as all of your settings files are all contained within your Packages/User/ folder and that is what you want to keep synced. Assuming that folder is synced, then all you have to do is make sure Package Control is installed and it will automatically install the correct packages based on the packages list you synced.

How to Sync

See this page on the Package Control website for instructions on syncing your settings.

The techniques listed there essentially are either using Git directly in your Packages/User/ folder or are using Dropbox (although the same concept would apply to any cloud service) in combination with symbolic links (since your Dropbox directory and your Sublime Text install are probably not in the same place on your hard drive).




回答2:


Despite DropBox, you can simply use Git to sync Sublime Text settings and Package Control Packages:

  1. Create a repository (e.g. on GitHub)
  2. Create a gitignore file with the following content:

    # Ignore everything...
    *
    # ... except preferences and package list
    !.gitignore
    !Preferences.sublime-settings
    !Package Control.sublime-settings
    
  3. 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
    
  4. 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
    

Now you just have to pull/push changes from the repository to have your settings and packages synchronized. In addition you can sync the settings with the Git Package for Sublime Text. Here you don’t have to switch to a Git Shell to pull or push the changes but you can do it right in Sublime Text.

See this article on Medium for further information.




回答3:


Use the SyncSettings package. Takes like 30 seconds to set up



来源:https://stackoverflow.com/questions/29687417/is-there-a-way-to-sync-sublime-text-settings-across-multiple-computers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!