ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Git​Gutter

by jisaacks ST2/ST3 Top 100

A Sublime Text 2/3 plugin to see git diff in gutter

Details

Installs

  • Total 110K
  • Win 27K
  • OS X 55K
  • Linux 28K
Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6 Sep 5 Sep 4
Windows 21 73 106 108 109 123 108 64 73 110 120 125 130 113 70 80 103 128 102 99 101 78 53 93 91 97 92 111 43 57 96 102 125 116 102 54 67 140 114 106 121 96 58 63 109 131
OS X 88 194 303 193 197 226 196 80 108 216 184 196 224 189 73 85 176 197 215 202 205 79 77 171 179 205 184 207 68 95 177 184 192 201 199 94 118 184 210 212 183 228 91 105 171 191
Linux 26 53 126 120 102 120 95 64 59 103 98 106 118 101 56 57 99 108 89 112 118 78 64 91 93 98 107 93 52 59 78 102 94 120 91 62 58 119 104 100 124 125 57 65 101 121

Readme

Source
raw.​githubusercontent.​com

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.

Screenshot:

screenshot

Installation

You can install via Sublime Package Control: * GitGutter - Release based * GitGutter-Edge - Stick with master branch (at your own peril)

Or you can clone this repo into your Sublime Text x/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:

Error: language “dos” is not supported
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.

Non Blocking Mode

By default, GitGutter runs in the same thread which can block if it starts to perform slowly. Usually this isn't a problem but depending on the size of your file or repo it can be. If you set non_blocking to true then GitGutter will run in a seperate thread and will not block. This does cause a slight delay between when you make a modification and when the icons update in the gutter. This is a Sublime Text 3 only feature, ST2 users can turn off live mode if performance is an issue.

Debounce Delay

When using non_blocking mode, delay update of gutter icons by the following amount (in milliseconds). Useful for performance issues. Default 1000 (1 second).

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.

Untracked Files

GitGutter shows icons for new files and ignored files. These icons will be on everyline. You can toggle the setting show_markers_on_untracked_file to turn this feature off. Defaults to true (shows icons). You may need to add scopes to your color scheme (markup.ignored.git_gutter and markup.untracked.git_gutter) to color the icons.

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; “json { "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 <kbd>Project</kbd> > <kbd>Edit Project</kbd> menu and add the `settings` key as shown.
```json
{
    "folders":
    [
        {
            "path": "src"
        }
    ],
    "settings":
    {
        "live_mode": false
    }
}

Icon Coloring

The colors come from your color scheme .tmTheme file.

Color schemes that already have support for GitGutter include:

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>GitGutter deleted</string>
  <key>scope</key>
  <string>markup.deleted.git_gutter</string>
  <key>settings</key>
  <dict>
    <key>foreground</key>
    <string>#F92672</string>
  </dict>
</dict>
<dict>
  <key>name</key>
  <string>GitGutter inserted</string>
  <key>scope</key>
  <string>markup.inserted.git_gutter</string>
  <key>settings</key>
  <dict>
    <key>foreground</key>
    <string>#A6E22E</string>
  </dict>
</dict>
<dict>
  <key>name</key>
  <string>GitGutter changed</string>
  <key>scope</key>
  <string>markup.changed.git_gutter</string>
  <key>settings</key>
  <dict>
    <key>foreground</key>
    <string>#967EFB</string>
  </dict>
</dict>
<dict>
  <key>name</key>
  <string>GitGutter ignored</string>
  <key>scope</key>
  <string>markup.ignored.git_gutter</string>
  <key>settings</key>
  <dict>
    <key>foreground</key>
    <string>#565656</string>
  </dict>
</dict>
<dict>
  <key>name</key>
  <string>GitGutter untracked</string>
  <key>scope</key>
  <string>markup.untracked.git_gutter</string>
  <key>settings</key>
  <dict>
    <key>foreground</key>
    <string>#565656</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? - Vim GitGutter - Emacs GitGutter

Don't use Git? - VcsGutter - Modific Not a port/fork of GitGutter but similar