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

VCS Gutter

by bradsokol ST2/ST3

A plugin for Sublime Text 2 and 3 to show diffs from Git, Mercurial, or Subversion in the editor's gutter.

Labels vcs, git, hg, svn

Details

  • 1.2.0
  • github.​com
  • github.​com
  • 12 months ago
  • 11 minutes ago
  • 4 years ago

Installs

  • Total 20K
  • Win 8K
  • OS X 6K
  • Linux 5K
Feb 24 Feb 23 Feb 22 Feb 21 Feb 20 Feb 19 Feb 18 Feb 17 Feb 16 Feb 15 Feb 14 Feb 13 Feb 12 Feb 11 Feb 10 Feb 9 Feb 8 Feb 7 Feb 6 Feb 5 Feb 4 Feb 3 Feb 2 Feb 1 Jan 31 Jan 30 Jan 29 Jan 28 Jan 27 Jan 26 Jan 25 Jan 24 Jan 23 Jan 22 Jan 21 Jan 20 Jan 19 Jan 18 Jan 17 Jan 16 Jan 15 Jan 14 Jan 13 Jan 12 Jan 11 Jan 10
Windows 1 12 10 10 15 7 7 1 11 15 12 9 3 6 9 11 6 11 9 4 4 11 3 6 6 4 4 3 10 5 10 15 8 5 6 6 9 15 9 11 3 4 6 5 7 15
OS X 0 1 3 5 2 2 2 8 5 4 4 8 3 2 6 4 6 2 4 1 4 6 3 1 5 4 1 2 8 6 3 3 6 2 0 4 2 6 3 3 1 2 3 5 3 6
Linux 0 5 6 6 2 3 5 2 5 3 3 9 4 0 4 5 4 4 5 1 2 3 2 11 5 2 4 4 6 5 4 5 3 1 2 5 5 6 2 3 0 4 5 5 1 6

Readme

Source
raw.​githubusercontent.​com

VCS Gutter

Now supporting Sublime Text 3.

VCS Gutter is a plugin for Sublime Text 2 and 3 that displays an icon in the gutter area indicating whether a line has been inserted, modified or deleted relative to the version of the file in the local source code repository. VCS Gutter supports Git, Mercurial and Subversion.

VCS Gutter is a “friendly fork” that builds on the original work by jisaacks on GitGutter.

Screenshot:

screenshot

Installation

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

Mac OS X

cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/
git clone git://github.com/bradsokol/VcsGutter.git "VCS Gutter"

Ubuntu

cd ~/.config/sublime-text-2/Packages
git clone git://github.com/bradsokol/VcsGutter.git "VCS Gutter"

Windows

cd %USERPROFILE%\AppData\Roaming\Sublime Text 2\Packages
git clone git://github.com/bradsokol/VcsGutter.git "VCS Gutter"

VcsGutter assumes that the git, hg, svn and diff commands are availible on the command line. The installers for these tools may not add the directory containing the executables to the PATH environment variable. If not, you must add the appropriate directory to your PATH variable.

For example: “dos %PATH%;C:\Program Files (x86)\Git\bin;C:\Program Files (x86)\Git\cmd

Alternatively, you can configure the paths in settings as described below.

Windows does not include a `diff` utility. A good open source option is the [GnuWin DiffUtils](http://gnuwin32.sourceforge.net/packages/diffutils.htm) package.

### Settings

Settings are accessed via the <kbd>Preferences</kbd> > <kbd>Package Settings</kbd> > <kbd>VCS Gutter</kbd> menu.

Default settings should not be modified, as they are overwritten when VCS Gutter is updated. Instead, you should copy the relevant settings into VCS Gutter's user settings file.

#### Live Mode
By default, VCS Gutter 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`.

#### Show in Minimap
By default, this is turned off. When the parameter ```shown_in_minimap``` is set to true, then the gutter icons are also shown on the minimap.

#### Non Blocking Mode
By default, VcsGutter 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 VcsGutter 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***. Sublime Text 2 users can turn off live mode if performance is an issue.

#### Executable Path
If your VCS executable (git, hg, or svn) or diff utility is not in your PATH, you may need to set the `vcs_paths` setting to the location of your executables:
```js
{
    "vcs_paths": {
        "diff": "diff",
        "git": "git",
        "hg": "/usr/local/bin/hg",
        "svn": "svn"
    }
}

Colors

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 key bindings for these commands are:

Linux

prev: ctrl + shift + alt + k

next: ctrl + shift + alt + j

OS X

prev: command + shift + option + k

next: command + shift + option + j

Windows

prev: ctrl + shift + alt + k

next: ctrl + shift + alt + j