Mithun Sreedharan
Mithun Sreedharan

Reputation: 51272

How to show git author name in Sublime Text editor?

I'm using GitGutter with Sublime Text editor.

With this plug-in Git > This file > blame will open a new tab with annontations.

Is there any way to show the Git annotations in the same edit window probably just before the line number

Upvotes: 36

Views: 29388

Answers (3)

Purplejacket
Purplejacket

Reputation: 2118

Rubymine (and presumably IntelliJ as well) has an annotate feature that looks like this:

enter image description here

JD Isaacks answer above is the closest I've seen to this, but I don't think Sublime Text 3 has such a feature without a lot of fiddling (as he describes). Vscode has something similar, an "annotate" extension.

Upvotes: 2

Foton
Foton

Reputation: 1287

Use Sublime Text Package Git and Command Git: Blame.

Install Git Package:

Shift + Command + P

Package Control: Install Package

Package Control: Install Package

Use Git: Blame Command:

Shift + Command + P

Git: Blame

Git: Blame

Result

enter image description here

Upvotes: 44

JD Isaacks
JD Isaacks

Reputation: 57974

Ok a couple things here.

First off, The git blame feature is not a part of my GitGutter plugin, it is a part of the Git plugin.

Secondly, @skuroda is correct that you can only put an icon in the gutter.

What you can do to simulate this tho: is use the split pane View > Layout > Columns: 2 and put the git blame on the left pane and the actual file on the right pane. You will want to turn off word wrap View > Word Wrap

Here is a screen shot: enter image description here


Then your only problem is to keep the 2 views in sync when you scroll. I haven't tested it but it looks like this sublime plugin might do that: glue views

Upvotes: 42

Related Questions