如何在 Sublime Text 编辑器中显示 git 作者姓名?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14891364/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 15:31:04  来源:igfitidea点击:

How to show git author name in Sublime Text editor?

gitannotationssublimetext

提问by Mithun Sreedharan

I'm using GitGutterwith Sublime Text editor.

我在Sublime Text 编辑器中使用GitGutter

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

使用这个插件 Git > 这个文件 >blame 会打开一个带有注解的新标签页。

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

有没有办法在同一编辑窗口中显示 Git 注释,可能就在行号之前

回答by JD Isaacks

Ok a couple things here.

好的,这里有几件事。

First off, The git blamefeature is not a part of my GitGutterplugin, it is a part of the Gitplugin.

首先,该git blame功能不是我的GitGutter插件的一部分,它是Git插件的一部分。

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

其次,@skuroda 是正确的,您只能在排水沟中放置一个图标。

What you can do to simulate this tho: is use the split pane View > Layout > Columns: 2and 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

您可以做些什么来模拟这个:使用拆分窗格View > Layout > Columns: 2并将 git blame 放在左窗格中,将实际文件放在右窗格中。您将要关闭自动换行视图 > 自动换行

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

那么您唯一的问题是在滚动时保持 2 个视图同步。我还没有测试过,但看起来这个 sublime 插件可能会这样做:粘合视图

回答by Foton

Use Sublime Text Package Gitand Command Git: Blame.

使用 Sublime Text 包Git和 Command Git: Blame

Install GitPackage:

安装Git包:

Shift+ Command+ P

Shift+ Command+P

Package Control: Install Package

Package Control: Install Package

Package Control: Install Package

包控制:安装包

Use Git: BlameCommand:

使用Git: Blame命令:

Shift+ Command+ P

Shift+ Command+P

Git: Blame

Git: Blame

Git: Blame

吉特:责备

Result

结果

enter image description here

在此处输入图片说明

回答by PurpleHymanet

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

Rubymine(也可能是 IntelliJ)有一个如下所示的annotate特性:

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.

上面 JD Isaacks 的回答是我见过的最接近的答案,但我不认为 Sublime Text 3 有这样的功能而不需要大量摆弄(正如他所描述的)。vscode 有类似的东西,一个“注释”扩展。