Sublime Forum

Install plugins with a installer script?

#1

Hello,

I just switched to Linux about 6 months ago and re-installing Linux is a dream since I can just run a script to install all my software. I’m wondering if anyone here knows if it is possible to do the same with Sublime Text 3. Can I make a script to run that installs and configures Sublime Text with a the plugins and the theme I want to use?

0 Likes

#2

Yes, you can. ST can be installed from your favorite package manager
http://www.sublimetext.com/docs/3/linux_repositories.html
(with apt-get you can backup your custom package selections from one machine and restore on another)

then you can use subl --command install_package_control (once ST is running, so maybe best to launch subl and wait a few seconds) to install Package Control, and you can set the preferences for Package Control to tell it what plugins to install as it’s just a JSON file. Same with theme preferences, the user settings are also just JSON.

It may be useful to read the sync docs as its kinda related:
https://packagecontrol.io/docs/syncing

2 Likes

#3

Save the following files to GitHub:

Package Control.sublime-settings
Terminal.sublime-settings

I used the following, after the SublimeText3 Installation, to install the package manager, and then copy the two files above to predefined directories:

    echo Install my Sublime Text 3 packages ...
cwd=$(pwd)

mkdir -p ~/.config/sublime-text-3/Installed\ Packages
cd ~/.config/sublime-text-3/Installed\ Packages/
wget --quiet https://packagecontrol.io/Package%20Control.sublime-package

mkdir -p ~/.config/sublime-text-3/Packages/User
cd ~/.config/sublime-text-3/Packages/User/
wget --quiet https://github.com/rudolfb/ubuntu-elixir-elm-install-shell-script/raw/master/sublime-text-3/Package%20Control.sublime-settings
wget --quiet https://github.com/rudolfb/ubuntu-elixir-elm-install-shell-script/raw/master/sublime-text-3/Terminal.sublime-settings

# Revert back to previous directory
cd $cwd

When you start SublimeText then SublimeText will see the two files and downlaod any packages referenced in those files.

But as @keithking mentioned, you can use the workflow described at packagecontrol.io/docs/syncing link.

0 Likes