Github 桌面在 sublime 中打开,而不是 atom

Github desktop open in sublime, not atom

在 GitHub 桌面中,是否有任何方法可以更改右键单击 "Open in Atom" 选项,改为 "Open in Sublime" 或其他文本编辑器?

谢谢!

你不能,因为它似乎是应用程序菜单的一部分。 但是,您可以在 global config 中设置默认编辑器,如

git config --global core.editor "subl -n -w"

更多请参考Associating text editors with Git

GitHub 桌面(Electron)的新答案

他们终于在首选项中添加了一个选项:

GitHub App Classic(本机)的旧答案

GitHub 在点击 "Open in Atom" 时查找 /Applications/Atom.app,因此您只需将编辑器重命名为 Atom.app,或者...

创建一个打开 Sublime 的虚拟应用程序。您可以下载我用 Automator 制作的 the app 或自己制作:

  1. 在 Automator 中,select应用程序
  2. 添加动作运行Shell脚本
  3. Select 作为参数传递输入 下拉菜单
  4. 输入:/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl "$@"
  5. Applications 文件夹中将其另存为 Atom

现在 "Open in Atom" 应该 "Open in Sublime Text"

Windows 使用便携式 Sublime Text 编辑器。

您需要创建一个注册表项,其中包含 subl.exe 文件所在文件夹的路径。 这是键的绝对最小值(值名称):

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Sublime Text 3_is1]
"Publisher"="Sublime HQ Pty Ltd"
"DisplayName"="Sublime Text 3"
"InstallLocation"="C:\Apps\YOUR\PATH\TO\Sublime\"
"Comment"="This key is needed for Github to detect SublimeText"

不需要

valuename Comment。我添加它是为了让自己记住这个键是关于什么的。

这是卸载信息的注册表位置。但是因为我删除了原始 Sublime 安装创建的大部分值名称,Windows 卸载不会将其显示为要在卸载中删除的条目。