Skip to content

Commit

Permalink
Merge pull request progit#1270 from katrinleinweber/1269-aggregate-co…
Browse files Browse the repository at this point in the history
…re.editor-commands

Aggregate core.editor command list in Appendix C
  • Loading branch information
ben authored Jun 27, 2019
2 parents 03164e8 + 86f30e3 commit 0b020b2
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 9 deletions.
31 changes: 31 additions & 0 deletions C-git-commands.asc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,37 @@ In <<ch08-customizing-git#_keyword_expansion>> we showed how to set up smudge an

Finally, basically the entirety of <<ch08-customizing-git#_git_config>> is dedicated to the command.

[[_core_editor]]
==== git config core.editor commands

In <<ch01-getting-started#_editor>> the configuration commands for Emacs and Notepad++ are shown as examples. Other editors can be set as follows:

.Exhaustive list of `core.editor` configuration commands
[cols="1,2",options="header"]
|==============================
|Editor | Configuration command
|Atom |`git config --global core.editor "atom --wait"`
|BBEdit (Mac, with command line tools) |`git config --global core.editor "bbedit -w"`
|Gedit (Linux) |`git config --global core.editor "gedit --wait --new-window"`
|Gvim (Windows 64-bit) |`git config --global core.editor "'C:/Program Files/Vim/vim72/gvim.exe' --nofork '%*'"`
|Kate (Linux) |`git config --global core.editor "kate"`
|nano |`git config --global core.editor "nano -w"`
|Notepad (Windows 64-bit) |`git config core.editor notepad`
|Scratch (Linux)|`git config --global core.editor "scratch-text-editor"`
|Sublime Text (macOS) |`git config --global core.editor "/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl --new-window --wait"`
|Sublime Text (Windows 64-bit) |`git config --global core.editor "'C:/Program Files/Sublime Text 3/sublime_text.exe' -w"`
|Textmate |`git config --global core.editor "mate -w"`
|Textpad (Windows 64-bit) |`git config --global core.editor "'C:/Program Files/TextPad 5/TextPad.exe' -m`
|Vim |`git config --global core.editor "vim"`
|VS Code |`git config --global core.editor "code --wait"`
|WordPad |`git config --global core.editor '"C:\Program Files\Windows NT\Accessories\wordpad.exe"'"`
|==============================

[NOTE]
====
If you have a 32-bit editor on a Windows 64-bit system, the program will be installed in `C:\Program Files (x86)\` rather than `C:\Program Files\` as in the table above.
====

==== git help

The `git help` command is used to show you all the documentation shipped with Git about any command.
Expand Down
12 changes: 3 additions & 9 deletions book/01-introduction/sections/first-time-setup.asc
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ If you want to override this with a different name or email address for specific

Many of the GUI tools will help you do this when you first run them.

[[_editor]]
==== Your Editor

Now that your identity is set up, you can configure the default text editor that will be used when Git needs you to type in a message.
Expand All @@ -68,20 +69,13 @@ If you are on a 32-bit Windows system, or you have a 64-bit editor on a 64-bit s

[source,console]
----
$ git config --global core.editor "'C:/Program Files/Notepad++/notepad++.exe' -multiInst -nosession"
----

If you have a 32-bit editor on a 64-bit system, the program will be installed in `C:\Program Files (x86)`:

[source,console]
----
$ git config --global core.editor "'C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst -nosession"
$ git config --global core.editor "'C:/Program Files/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin"
----

[NOTE]
====
Vim, Emacs and Notepad++ are popular text editors often used by developers on Unix-based systems like Linux and macOS or a Windows system.
If you are not familiar with these editors, you may need to search for specific instructions for how to set up your favorite editor with Git.
If you are using another editor, or a 32-bit version, please find specific instructions for how to set up your favorite editor with Git in <<C-git-commands#_core_editor>>.
====

[WARNING]
Expand Down

0 comments on commit 0b020b2

Please sign in to comment.