Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A Sublime Text 2/3 plugin to see git diff in gutter
Python JavaScript Ruby Shell Makefile

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
icons
.gitignore
Default (OSX).sublime-keymap
Default (Windows).sublime-keymap
GitGutter.sublime-settings
LICENSE
Main.sublime-menu
README.md
git_gutter.py
git_gutter_change.py
git_gutter_events.py
git_gutter_handler.py
git_helper.py
screenshot.png
view_collection.py

README.md

Git Gutter

A sublime text 2/3 plugin to show an icon in the gutter area indicating whether a line has been inserted, modified or deleted.

It also provides keymaps to jump up and down across changes.

Screenshot:

screenshot

Installation

You can install via Sublime Package Control
Or you can clone this repo into your Sublime Text 2/Packages

OSX

cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/
git clone git@github.com:jisaacks/GitGutter.git

Ubuntu

cd ~/.config/sublime-text-2/Packages
git clone git@github.com:jisaacks/GitGutter.git

Windows

GitGutter assumes that the git command is available on the command line. If it's not, add the directory containing git.exe to your PATH environment variable. Then clone the repo:

cd "%APPDATA%\Sublime Text 2\Packages"
git clone git://github.com/jisaacks/GitGutter.git

Settings

Settings are accessed via the Preferences > Package Settings > GitGutter menu.

Default settings should not be modified, as they are overwritten when GitGutter updates. Instead, you should copy the relevant settings into GitGutter's user settings file.

Live Mode

By default, GitGutter detects changes every time the file is modified. If you experience performance issues you can set it to only run on save by setting live_mode to false.

Git path

If git is not in your PATH, you may need to set the git_binary setting to the location of the git binary, e.g. in a portable environment;

{
  "git_binary": "E:\\Portable\\git\\bin\\git.exe"
}

Per-project Settings

Sublime Text supports project-specific settings, allowing live_mode to be set differently for different repositories. To implement, use the Project > Edit Project menu and add the settings key as shown.

{
    "folders":
    [
        {
            "path": "src"
        }
    ],
    "settings":
    {
        "live_mode": false
    }
}

Icon Coloring

The colors come from your color scheme .tmTheme file. If your color scheme file does not define the appropriate colors (or you want to edit them) add an entry that looks like this:

<dict>
  <key>name</key>
  <string>diff.deleted</string>
  <key>scope</key>
  <string>markup.deleted</string>
  <key>settings</key>
  <dict>
    <key>foreground</key>
    <string>#F92672</string>
  </dict>
</dict>
<dict>
  <key>name</key>
  <string>diff.inserted</string>
  <key>scope</key>
  <string>markup.inserted</string>
  <key>settings</key>
  <dict>
    <key>foreground</key>
    <string>#A6E22E</string>
  </dict>
</dict>
<dict>
  <key>name</key>
  <string>diff.changed</string>
  <key>scope</key>
  <string>markup.changed</string>
  <key>settings</key>
  <dict>
    <key>foreground</key>
    <string>#967EFB</string>
  </dict>
</dict>

Jumping Between Changes

There are commands to jump between modifications. The default keybindings for these commands are:

OSX

prev: command + shift + option + k
next: command + shift + option + j

Windows

prev: ctrl + shift + alt + k
next: ctrl + shift + alt + j



Alternatives

Don't use Sublime?

Don't use Git?

Something went wrong with that request. Please try again.