Adding Copy Filename and Copy Path to Sublime Text's Sidebar

Feb 14, 2013

Sublime_Text_Logo[1]My text editor of choice is Sublime Text but right out of the box, it does not include copy filename or copy file path in the sidebar (both of which I use constantly). Seems that whenever I install it on a new machine (which I just did) I forget how to install the Package Control package, which offers such goodies. Therefore, I thought I would park the instructions here for your--and more importantly, my--convenience.

It's pretty easy...

  1. In Sublime Text, type ctrl+` to access the console
  2. Copy the code below, paste it in the console and hit return
  3. Restart Sublime Text
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')

Now, when right/ctrl-clicking a file or files in Sublime Text's sidebar, you should see a wealth of options including copy path/name.

If for some reason this fails to work, you can download and install manually with the instructions here...

Now that you have Package Control installed, use it by typing shift-ctrl-p. You can then, as you might imagine, control Sublime packages. Eg. install, remove, etc.... My two must-haves are: SideBarEnhancements and All Complete. To install them:

  1. Click shift-ctrl-p
  2. Start typing "install" and select Package Control: Install Package
  3. A package prompt appears; start typing the package name, eg. All Auto Complete

That's it! Just repeat these steps for each package you'd like to install.