How to add diff icons to gutter in sublime text 3

I’m adding this blog post more or less for future reference. I often find myself putting together new virtual work environments or working on client systems. In these cases, I need to set up Sublime to work the way I like it. One of the things I like the most, is the ability to see the differences when editing a versioned file. Sublime has a lot of support for Git, but since I mostly work with SVN, this is the process I’ve had to use to get the right customization.

Prerequisites

Your System should have SVN (tortoise SVN) or GIT installed, whose command files will be used by VCS Gutter. Some installations of these programs do not come with the command files, in that case, it must be reinstalled with command files included.

Install Package Control

  1. Install the package control in sublime
    1. Go to https://sublime.wbond.net/installation
    2. Copy the text from the website into the sublime console (bring up the console CTRL + `) and hit ENTER

Install VCS Gutter

  1. In sublime, hit CTRL+SHIFT+P to access the shortcuts. Type “install” and look “Package Control”
  2. When the search box comes up look for “VCS Gutter”

Install a diff checker package

VCS Gutter will need access to command files that will do the work of checking differences between your saved file and current. In order to do that, it needs a specific path to that command file or the file can be added to the default system paths (with the following steps).

If you have a diff package in your system PATH folder, skip this section, otherwise continue.

  1. You can check if you have a diff file in your system PATH folder by opening a CMD line and type “diff”. If not recognized, it is not added.
  2. Download a basic diff package from this website
    1. Download and install the setup file. Install with full features
  3. Now we need to add both the svn and diff file folders to the system PATH folder
    1. Go to Control Panel > System > Advanced System Settings > Environment Variables
    2. Scroll down to see the Path file in the system area
    3. Highlight it and click Edit…
    4. Add the folder paths to both your svn.exe and diff.exe to this text string. Always separate folders with semicolons “;”
      1. Ex. …;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\GnuWin32\bin;
  4. Go back to a CMD line and type “diff” to see if the path file was edited correctly. You can do the same with “svn”
  5. Open a versioned file and make changes to see the gutter icons working

(Optional Troubleshooting) Gutter Color Definition

Some sublime default themes like Monokai have gutter colors defined. If your theme does not have gutter colors defined, you will not see any changes. In that case, we can edit the color theme to add some colors for gutter symbols.

  1. In sublime, hit CTRL+SHIFT+P to access the shortcuts. Type “install” and look “Package Control”
  2. When the search box comes up look for “ColorSublime”
  3. Restart Sublime
  4. Install a new theme with CTRL+SHIFT+P, type “ColorSublime” and search for your desired theme.
  5. Go to Preferences > Browse Packages
  6. In the dialog navigate to Colorsublime – Themes and find your Theme.tm file
  7. Open it in sublime and add this code to the file: GutterColors (code link)
  8. Restart Sublime
  9. Open a versioned file and make changes to see the gutter icons working

(Optional Settings) Theme and Sublimerge

  1. Install Phoenix Theme with these settings: Phoenix User Settings
  2. Install SubliMerge Package (features with Ctrl-Alt-d)

, , , , , , , , ,

Comments are closed.