Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 14 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save vishaltelangre/5075346 to your computer and use it in GitHub Desktop.
Save vishaltelangre/5075346 to your computer and use it in GitHub Desktop.
[Automate Packages Installation in Sublime Text 2] -- Automatically install Sublime Text 2 packages (some necessary ones, w/o fucking crap ones which makes sublime alike hell!)
  • To install packages, every time pressing ' ctrl+shift+pPackage Control: Install Package is very cumbersome task... right?

  • After fresh installation of ST2, open it and ctrl+` and hit enter after pasting below line (1):

  import urllib2,os; pf='Package Control.sublime-package'; ipp=sublime.installed_packages_path(); os.makedirs(ipp) if not os.path.exists(ipp) else None; urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler())); open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read()); print('Please restart Sublime Text to finish installation')
  • Restart ST2.

  • Open terminal, and navigate to Sublime's dir under your home folder by below command and create file w/ name Package Control.sublime-settings there in:

cd $HOME/.config/sublime-text-2/Packages/User && touch Package\ Control.sublime-settings
  • Add below json (these packages were stable at the time of writing this gist, maybe you can add yours to it) to this above created file, and save it (2):
  {
    "installed_packages":
  	[
  		"Alignment",
  		"Alternative Autocompletion",
  		"ApacheConf.tmLanguage",
  		"Auto Encoding for Ruby",
  		"Autocomplete Javascript with Method Signature",
  		"AutoFileName",
  		"Backbone.js",
  		"BeautifyRuby",
  		"Bracketeer",
  		"BracketHighlighter",
  		"BufferScroll",
  		"C++",
  		"ChangeQuotes",
  		"CoffeeCompile",
  		"CoffeeScript",
  		"CoffeeScript Function Finder",
  		"Color Highlighter",
  		"Color Scheme - Default",
  		"ColorPick",
  		"ColorSchemeSelector",
  		"Console API Snippets (JavaScript)",
  		"copy-file-name",
  		"CSS",
  		"CSS Less(ish)",
  		"CSS Media Query Snippets",
  		"CSS Snippets",
  		"CSScomb",
  		"CSSFormat",
  		"Csslisible",
  		"CSSTidy",
  		"CTags",
  		"Current Scope",
  		"Dayle Rees Color Schemes",
  		"Default",
  		"DetectSyntax",
  		"Diff",
  		"ERB Insert and Toggle Commands",
  		"ERB Snippets",
  		"Git",
  		"Git Status Files",
  		"GitGutter",
  		"Hacker News",
  		"Haml",
  		"HighlightDuplicates",
  		"HTML",
  		"HTML2Haml",
  		"HTML5",
  		"HTMLAttributes",
  		"HtmlTidy",
  		"InsertDate",
  		"JavaScript",
  		"JavaScript Snippets",
  		"jQuery",
  		"jQuery Snippets pack",
  		"JS Snippets",
  		"JS2Coffee",
  		"JsFormat",
  		"JSHint",
  		"JsMinifier",
  		"Language - English",
  		"LESS",
  		"Less2Css",
  		"Line Completion",
  		"LineEndings",
  		"Logs Colorize",
  		"LoremIpsum",
  		"Markdown",
  		"Markdown Preview",
  		"Meld diff",
  		"Missing Palette Commands",
  		"MoveText",
  		"Nodejs",
  		"Open Folder",
  		"Open Recent Files",
  		"Package Control",
  		"PHP",
  		"Placehold.it Image Tag Generator",
  		"PlainTasks",
  		"Prefixr",
  		"Pretty JSON",
  		"Python",
  		"Rails",
  		"Rails Partial",
  		"Regular Expressions",
  		"Ruby",
  		"Ruby on Rails snippets",
  		"RubyFormat",
  		"RubyToggleString",
  		"Sass",
  		"SCSS",
  		"SCSS Snippets",
  		"Search Anywhere",
  		"ShellScript",
  		"SideBarEnhancements",
  		"Simple Rails Navigator",
  		"SortTabs",
  		"SQL",
  		"Sublime-HTMLPrettify",
  		"SublimeWebColors",
  		"SyncedSideBar",
  		"Textile",
  		"Theme - Default",
  		"Theme - Night",
  		"Themr",
  		"Todo",
  		"Toggle Symbol to String",
  		"Twig",
  		"Unicode Character Highlighter",
  		"URLEncode",
  		"User",
  		"Vintage",
  		"WordCount",
  		"XML",
  		"YAML"
  	]
  }
  • Now when you open your ST2 again, it looks for this file, and if the packages specified in this file are missing, then it automatically downloads and installs for you!

  • ctrl+` to see what's it installing, (displays tailed log of al the happenings in your ST2 environment)!

  • You just seat back for some time and watch it or bring some popcorn and hot tea! It takes no time either!

;)


References

@thaiat
Copy link

thaiat commented Jan 30, 2015

do you have an update method for Sublime 3. I can't seem to find $HOME/.config/sublime-text-2/Packages/User

@luchillo17
Copy link

Just change the part "sublime-text-2" -> "sublime-text-3"

@evanplaice
Copy link

I created a sublime-text-seed project to automate the install and configuration of Sublime Text 3:
https://github.com/evanplaice/sublime-text-seed

Just fork the project, add your configuration files, and run the setup script. The script will take care of the rest.

It currently works in OSX and Linux. Windows support is coming soon.

@evanplaice
Copy link

One other note, I don't recommend loading so many plugins by default as the load may effect the responsiveness of the editor UI.

You could either install all of the plugins and incrementally disable the ones not in use by adding entries to the ignore_packages array in the 'User Preferences` or just install only the plugins you plan to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment