@@ -34,6 +34,40 @@ Git 做的很多工作都有一个默认方式。
34
34
35
35
最后,基本上 <<ch08-customizing-git#r_git_config>> 整个章节都是针对此命令的。
36
36
37
+ [[_core_editor]]
38
+ ==== git config core.editor 命令
39
+
40
+ 就像 <<ch01-introduction#r_first_time>> 里的设置指示,很多编辑器可以如下设置:
41
+
42
+ .详细的 `core.editor` 设置命令列表
43
+ [cols="1,2",options="header"]
44
+ |==============================
45
+ |编辑器 | 设置命令
46
+ |Atom |`git config --global core.editor "atom --wait"`
47
+ |BBEdit (Mac, with command line tools) |`git config --global core.editor "bbedit -w"`
48
+ |Emacs |git config --global core.editor emacs
49
+ |Gedit (Linux) |`git config --global core.editor "gedit --wait --new-window"`
50
+ |Gvim (Windows 64-bit) |`git config --global core.editor "'C:/Program Files/Vim/vim72/gvim.exe' --nofork '%*'"` (Also see note below)
51
+ |Kate (Linux) |`git config --global core.editor "kate"`
52
+ |nano |`git config --global core.editor "nano -w"`
53
+ |Notepad (Windows 64-bit) |`git config core.editor notepad`
54
+ |Notepad++ (Windows 64-bit) |git config --global core.editor "'C:/Program Files/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin" (Also see note below)
55
+ |Scratch (Linux)|`git config --global core.editor "scratch-text-editor"`
56
+ |Sublime Text (macOS) |`git config --global core.editor "/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl --new-window --wait"`
57
+ |Sublime Text (Windows 64-bit) |`git config --global core.editor "'C:/Program Files/Sublime Text 3/sublime_text.exe' -w"` (Also see note below)
58
+ |Textmate |`git config --global core.editor "mate -w"`
59
+ |Textpad (Windows 64-bit) |`git config --global core.editor "'C:/Program Files/TextPad 5/TextPad.exe' -m` (Also see note below)
60
+ |Vim |`git config --global core.editor "vim"`
61
+ |VS Code |`git config --global core.editor "code --wait"`
62
+ |WordPad |`git config --global core.editor '"C:\Program Files\Windows NT\Accessories\wordpad.exe"'"`
63
+ |Xi | `git config --global core.editor "xi --wait"`
64
+ |==============================
65
+
66
+ [NOTE]
67
+ ====
68
+ 如果你在 64 位 Windows 系统上安装了 32 位的文本编辑器,它会被安装在 `C:\Program Files (x86)\` 而不是上面表格所写的 `C:\Program Files\` 。
69
+ ====
70
+
37
71
==== git help
38
72
39
73
`git help` 命令用来显示任何命令的 Git 自带文档。
0 commit comments